jenkins-x / terraform-aws-eks-jx

A Terraform module for creating Jenkins X infrastructure on AWS
Apache License 2.0
63 stars 42 forks source link

Fix #288: not able to use AWS Profiles #310

Closed mrmarcsmith closed 2 years ago

mrmarcsmith commented 2 years ago

Description

Many companies use the AWS best practice of requiring users to assume into a role that grants access to a given account representing an environment (dev, stage, prod etc). When I tried to spin up a cluster using the jx3-terraform-eks repo, it failed because in this module, there is a direct call to AWS that doesn't honor the profile I set in the jx3-terraform-eks terraform variables. This PR adds a conditional flag on the only direct AWS call I could find. Please point out if there are more.

Special notes for the reviewer(s)

In theory this should be backwards compatible because if the variable isn't set the flag wouldn't be added. If this is pulled in I will need to make a separate PR in jx3-terraform-eks for forwarding the profile to this modules, but first things first.

Which issue this PR fixes

fixes #288

mrmarcsmith commented 2 years ago

@ankitm123 Thank you for the ENV_VAR workaround for issue #288. This PR is designed to be a permanent fix. do you have any feedback?

ankitm123 commented 2 years ago

do you have any feedback?

Looks good to me!