aws-cdk
aws-cdk copied to clipboard
fix(iam): incorrect input for AccountPrincipal is building successfully
Reason for this change
There is no validation and test that the AWS Account Id when creating AccountPrincipal Object. In my case I missed a digit when copy pasting an account id and the build still passed, the typo has been caught only during the code review process
Description of changes
Adding simple regex to check that AWS Id is 12 digits long & update error message
Description of how you validated changes
Existing tests are passing and added 2 of them
Checklist
- [x] My code adheres to the CONTRIBUTING GUIDE and DESIGN GUIDELINES
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
Logs are quite odd
[4/4] Building fresh packages...
error /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@lerna/create/node_modules/nx, /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@nx/devkit/node_modules/nx, /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/lerna/node_modules/nx: Command failed.
Exit code: 135
Command: node ./bin/post-install
Arguments:
Directory: /codebuild/output/src3225815236/src/github.com/aws/aws-cdk/node_modules/@lerna/create/node_modules/nx
Output:
Bus error (core dumped)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Seems issue with yarn/nx
This build failure can't possibly have anything to do with this change... I'll retrigger it.
@Mergifyio update
update
✅ Branch has been successfully updated
For fixes, the title should describe the bug, not the solution. Could you please update it?
Hey Kendra, thanks for the review and restarting the build
For fixes, the title should describe the bug, not the solution. Could you please update it?
Done ! Is it better with this ?
fix(iam): incorrect input for AccountPrincipal is building successfully
Seems this PR is breaking lots of existing test ... I'll look into it, if it's too complex or there is actual use case where the an AWS ID is not 12 digits (which should not be the case ?) I'll close it.
Had to refactor/fix in bunch of test files but now they use proper mock AWS Accound id 🙌
Bump !
Test updated :)
Good on my side :) 👍
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.
@TheRealAmazonKendra can you take a quick look ? PR seems big (🥲) but 99% is just updating existing test
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.
AWS CodeBuild CI Report
- CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
- Commit ID: eb7276b17123ff5320104a2421916e7c6ba56c5b
- Result: FAILED
- Build Logs (available for 30 days)
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.