Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Profile Changes #59

Merged
merged 2 commits into from
Jun 14, 2018
Merged

Conversation

richardcase
Copy link
Contributor

Changes to ensure that AWS profiles are supported. This involved making
sure that the AWS config file is loaded (SharedConfigEnabled) and
also making sure we have a TokenProvider set.

Added an explicit --profile flag that can be used to explicity specify
which AWS profile you would like to use. This will override any profile
that you have specified via AWS_PROFILE.

If endpoints are being overriden then the credentials from the initial
session creation are shared with any subsequent session creation to
ensure that the tokens are shared (otherwise you may get multiple MFA
prompts).

Issue #57

Changes to ensure that AWS profiles are supported. This involved making
sure that the AWS config file is loaded (SharedConfigEnabled) and
also making sure we have a TokenProvider set.

Added an explicit --profile flag that can be used to explicity specify
which AWS profile you would like to use. This will override any profile
that you have specified via AWS_PROFILE.

If endpoints are being overriden then the credentials from the initial
session creation are shared with any subsequent session creation to
ensure that the tokens are shared (otherwise you may get multiple MFA
prompts).

Issue eksctl-io#57
marccarre
marccarre previously approved these changes Jun 13, 2018
Copy link
Contributor

@marccarre marccarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @richardcase 👍
Many thanks for the awesome work on this issue! ✨

@@ -64,6 +64,7 @@ func createClusterCmd() *cobra.Command {

fs.StringVarP(&cfg.ClusterName, "cluster-name", "n", "", fmt.Sprintf("EKS cluster name (generated if unspecified, e.g. %q)", exampleClusterName))
fs.StringVarP(&cfg.Region, "region", "r", DEFAULT_EKS_REGION, "AWS region")
fs.StringVarP(&cfg.Profile, "profile", "p", "", "AWS Profile to use. This overrides the AWS_PROFILE environment variable if its set")

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@marccarre
Copy link
Contributor

marccarre commented Jun 13, 2018

N.B.:

  1. I tried setting a valid profile with AWS_PROFILE and it worked as expected.
  2. I tried setting a valid profile via --profile and it worked as expected.
  3. I tried setting an invalid AWS_PROFILE and a valid --profile and it did override the env. var. and worked as expected.
  4. I tried setting an invalid AWS_PROFILE and it failed as expected.
  5. I tried setting an invalid --profile and it failed as expected.
  6. I tried not to set AWS_PROFILE nor --profile and it failed as expected.

EDIT: I tried a couple more things, see here, here and here.

Changed the description for the --profile flag based on review
feedback to improve the grammar and readability.

Issue eksctl-io#57
@richardcase
Copy link
Contributor Author

@marccarre - small change with the text you suggested for the description of the --profile flag.

@errordeveloper
Copy link
Contributor

@richardcase thanks a lot!

Copy link
Contributor

@marccarre marccarre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 -- Did quite a bit of testing, both related and unrelated to the original issue, and this definitely improves things! Thank you so much @richardcase! ✨

@marccarre marccarre merged commit 98f9899 into eksctl-io:master Jun 14, 2018
@richardcase richardcase deleted the profile-support branch June 15, 2018 06:49
@richardcase
Copy link
Contributor Author

@marccarre @errordeveloper - i think i've run into an issue with this with 'create cluster' and specifically `CreateDefaultNodeGroupAuthConfigMap'. This has come to light as part of my testing for #29. I will let you know what i find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants