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

cdk.go: support --profile flag by adding missing provisioner #463

Merged
merged 1 commit into from
May 13, 2024

Conversation

waiteb3
Copy link
Contributor

@waiteb3 waiteb3 commented May 2, 2024

Overview

Fixes the cdk plugin not handling the --profile flag correctly when a profile is using role assumption. Now it matches the expected behavior of the aws plugin's --profile flag and the AWS_PROFILE environment variable.

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

How To Test

If you have an existing CDK stack, you can confirm that using a profile to assume a role used for deployments.

cd $YOUR_CDK_DIR
cdk diff --profile cdk-stack-admin

Example ~/.aws/config file. Swap out with names and numbers from your account

[default]

[profile cdk-stack-admin]
source_profile=default
role_arn=arn:aws:iam::<AWS_ACC_NUM>:role/<CDK_ADMIN_ROLE>
role_session_name=cdk-stack-admin

Without the patch, the cdk will encounter the error below and fail

Need to perform AWS calls for account <AWS_ACC_NUM>, but no credentials have been configured

Changelog

AWS CDK Plugin now supports AWS Profiles that assume a role, when specified by the --plugin flag.

Copy link
Member

@SimonBarendse SimonBarendse left a comment

Choose a reason for hiding this comment

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

Security review approved

@SimonBarendse SimonBarendse added waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member and removed waiting-on-sec-review labels May 3, 2024
@AndyTitu
Copy link
Contributor

Looks good to me functionally!

@AndyTitu AndyTitu merged commit 0b156f8 into 1Password:main May 13, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-reviewer signals that a certain PR is waiting for a review from a 1Password team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants