-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix(cli): CLI ignores profile in cdk.json #7398
fix(cli): CLI ignores profile in cdk.json #7398
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
This should be tagged as a fix
as it's resolving a bug and not as a chore
. Can you modify the title and also add corresponding tests.
This test should be an integration test. However, the integration testing requires that I actually generate the stack on AWS. I don't have a personal AWS account, so I cannot develop. If you want me to create a unit test, that involves refactoring of initCommandLine() @ |
@itoyama - It's a straightforward enough change and I agree that the scope of this change isn't to make this module more testable. can you include any validation steps you've done on this change in the commit body? |
This is Indirectly tested by my company's AWS account during my work.
OK I will add. |
@shivlaks Is the following explanation sufficient? validation steps
|
const sdkProvider = await SdkProvider.withAwsCliCompatibleDefaults({ | ||
profile: argv.profile, | ||
profile: configuration.settings.get(['profile']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to write code in Configuration
to copy argv.profile
into itself.
It's not as automatic as you would expect (iirc).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is added to L196 because L218 is in the function for parsing 'context' values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Validated via docker:
Also using command line argument:
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
The profile option was not being passed from cdk.json. Get the values from the merged configuration, instead of using the profile argument directly. Validation steps: * Prepare that the command like `cdk diff $SOME_STACK_NAME --profile $SOME_PROFILE_NAME` succeeds * Execute `cdk diff $SOME_STACK_NAME` and receive failures to confirm no credential is implicitly provided. * Add "profile": "$SOME_PROFILE_NAME" to cdk.json. Execute `cdk diff $SOME_STACK_NAME` and it must finish successfully. Fixes #3007
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
validation steps
cdk diff $SOME_STACK_NAME --profile $SOME_PROFILE_NAME
succeedscdk diff $SOME_STACK_NAME
and receive failures to confirm no credential is implicitly provided.cdk diff $SOME_STACK_NAME
and it must finish successfully.Commit Message
fix(cli): CLI ignores profile in cdk.json (#7398)
The profile option was not being passed from cdk.json.
Get the values from the merged configuration, instead of using the profile argument directly.
Closes #3007
End Commit Message
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license