From b70f5c49236bd5510f8448327f82ab8b287c83fa Mon Sep 17 00:00:00 2001 From: Aaron Donovan Date: Thu, 27 Jun 2019 11:06:20 -0400 Subject: [PATCH] Allow configuration of nonce for ec2 authentication (#6953) * Allow configuration of nonce for ec2 authentication * Addressing pull request comment --- command/agent/auth/aws/aws.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/command/agent/auth/aws/aws.go b/command/agent/auth/aws/aws.go index fdac099e99..d3ea600720 100644 --- a/command/agent/auth/aws/aws.go +++ b/command/agent/auth/aws/aws.go @@ -134,6 +134,14 @@ func NewAWSAuthMethod(conf *auth.AuthConfig) (auth.AuthMethod, error) { } } + nonceRaw, ok := conf.Config["nonce"] + if ok { + a.nonce, ok = nonceRaw.(string) + if !ok { + return nil, errors.New("could not convert 'nonce' value into string") + } + } + if a.authType == typeIAM { // Check for an optional custom frequency at which we should poll for creds.