Commit aed9291e authored by Ryan Fredette's avatar Ryan Fredette
Browse files

Use ingress operator config region for AWS session if available

AWS API connections in certain regions require that the session specify
the correct region, otherwise STS authentication can fail. This commit
addresses this by setting the region in the session explictly to match
the region set in the platform status
parent 64ab7b63
......@@ -113,6 +113,9 @@ func NewProvider(config Config, operatorReleaseVersion string) (*Provider, error
if config.CustomCABundle != "" {
sessionOpts.CustomCABundle = strings.NewReader(config.CustomCABundle)
}
if len(config.Region) > 0 {
sessionOpts.Config.Region = aws.String(config.Region)
}
sess, err := session.NewSessionWithOptions(sessionOpts)
if err != nil {
return nil, fmt.Errorf("couldn't create AWS client session: %v", err)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment