mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-10-27 08:41:29 +01:00
Apply suggestions from code review
Co-authored-by: Nick Jüttner <nick@juni.io>
This commit is contained in:
parent
03a28eea6e
commit
ce38a40e2b
@ -199,12 +199,13 @@ func NewAWSProvider(awsConfig AWSConfig) (*AWSProvider, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if awsConfig.AssumeRole != "" {
|
if awsConfig.AssumeRole != "" {
|
||||||
log.Infof("Assuming role: %s", awsConfig.AssumeRole)
|
if awsConfig.AssumeRoleExternalID != "" {
|
||||||
if awsConfig.AssumeRole != "" {
|
log.Infof("Assuming role: %s with external id %s", awsConfig.AssumeRole, awsConfig.AssumeRoleExternalID)
|
||||||
session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole, func(p *stscreds.AssumeRoleProvider) {
|
session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole, func(p *stscreds.AssumeRoleProvider) {
|
||||||
p.ExternalID = &awsConfig.AssumeRoleExternalID
|
p.ExternalID = &awsConfig.AssumeRoleExternalID
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
|
log.Infof("Assuming role: %s", awsConfig.AssumeRole)
|
||||||
session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole))
|
session.Config.WithCredentials(stscreds.NewCredentials(session, awsConfig.AssumeRole))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user