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

fix(cli): cdk bootstrap --help does not show some options #30113

Merged
merged 2 commits into from
May 9, 2024

Conversation

vinayak-kukreja
Copy link
Contributor

@vinayak-kukreja vinayak-kukreja commented May 8, 2024

Issue

Closes #24882

Reason for this change

As mentioned in the issue, some of the options for bootstrap were not showing up with --help

.option('example-permissions-boundary', { type: 'boolean', alias: ['epb', 'example-permissions-boundary'], desc: 'Use the example permissions boundary.', default: undefined, conflicts: 'custom-permissions-boundary' })
      .option('custom-permissions-boundary', { type: 'string', alias: ['cpb', 'custom-permissions-boundary'], desc: 'Use the permissions boundary specified by name.', default: undefined, conflicts: 'example-permissions-boundary' })

Description of changes

Since alias conflicts with actual sub-command option, it fails silently and does not show the option with --help

Description of how you validated changes

Built the cdk locally and used <local repo path>/aws-cdk/bin/cdk bootstrap --help and verified the options are showing up

Output

cdk bootstrap --help output:

cdk bootstrap [ENVIRONMENTS..]

Deploys the CDK toolkit stack into an AWS environment

Options:
  -a, --app                                 REQUIRED WHEN RUNNING APP:
                                            command-line for executing your app
                                            or a cloud assembly directory (e.g.
                                            "node bin/my-app.js"). Can also be
                                            specified in cdk.json or ~/.cdk.json
                                                                        [string]
      --build                               Command-line for a pre-synth build
                                                                        [string]
  -c, --context                             Add contextual string parameter
                                            (KEY=VALUE)                  [array]
  -p, --plugin                              Name or path of a node package that
                                            extend the CDK features. Can be
                                            specified multiple times     [array]
      --trace                               Print trace for stack warnings
                                                                       [boolean]
      --strict                              Do not construct stacks with
                                            warnings                   [boolean]
      --lookups                             Perform context lookups (synthesis
                                            fails if this is disabled and
                                            context lookups need to be
                                            performed) [boolean] [default: true]
      --ignore-errors                       Ignores synthesis errors, which will
                                            likely produce an invalid output
                                                      [boolean] [default: false]
  -j, --json                                Use JSON output instead of YAML when
                                            templates are printed to STDOUT
                                                      [boolean] [default: false]
  -v, --verbose                             Show debug logs (specify multiple
                                            times to increase verbosity)
                                                        [count] [default: false]
      --debug                               Enable emission of additional
                                            debugging information, such as
                                            creation stack traces of tokens
                                                      [boolean] [default: false]
      --profile                             Use the indicated AWS profile as the
                                            default environment         [string]
      --proxy                               Use the indicated proxy. Will read
                                            from HTTPS_PROXY environment
                                            variable if not specified   [string]
      --ca-bundle-path                      Path to CA certificate to use when
                                            validating HTTPS requests. Will read
                                            from AWS_CA_BUNDLE environment
                                            variable if not specified   [string]
  -i, --ec2creds                            Force trying to fetch EC2 instance
                                            credentials. Default: guess EC2
                                            instance status            [boolean]
      --version-reporting                   Include the "AWS::CDK::Metadata"
                                            resource in synthesized templates
                                            (enabled by default)       [boolean]
      --path-metadata                       Include "aws:cdk:path"
                                            CloudFormation metadata for each
                                            resource (enabled by default)
                                                                       [boolean]
      --asset-metadata                      Include "aws:asset:*" CloudFormation
                                            metadata for resources that uses
                                            assets (enabled by default)[boolean]
  -r, --role-arn                            ARN of Role to use when invoking
                                            CloudFormation              [string]
      --staging                             Copy assets to the output directory
                                            (use --no-staging to disable the
                                            copy of assets which allows local
                                            debugging via the SAM CLI to
                                            reference the original source files)
                                                       [boolean] [default: true]
  -o, --output                              Emits the synthesized cloud assembly
                                            into a directory (default: cdk.out)
                                                                        [string]
      --notices                             Show relevant notices      [boolean]
      --no-color                            Removes colors and other style from
                                            console output
                                                      [boolean] [default: false]
      --ci                                  Force CI detection. If CI=true then
                                            logs will be sent to stdout instead
                                            of stderr [boolean] [default: false]
      --version                             Show version number        [boolean]
  -b, --bootstrap-bucket-name,              The name of the CDK toolkit bucket;
  --toolkit-bucket-name                     bucket will be created and must not
                                            exist                       [string]
      --bootstrap-kms-key-id                AWS KMS master key ID used for the
                                            SSE-KMS encryption          [string]
      --example-permissions-boundary,       Use the example permissions
      --epb                                 boundary.                  [boolean]
      --custom-permissions-boundary, --cpb  Use the permissions boundary
                                            specified by name.          [string]
      --bootstrap-customer-key              Create a Customer Master Key (CMK)
                                            for the bootstrap bucket (you will
                                            be charged but can customize
                                            permissions, modern bootstrapping
                                            only)                      [boolean]
      --qualifier                           String which must be unique for each
                                            bootstrap stack. You must configure
                                            it on your CDK app if you change
                                            this from the default.      [string]
      --public-access-block-configuration   Block public access configuration
                                            on CDK toolkit bucket (enabled by
                                            default)                   [boolean]
  -t, --tags                                Tags to add for the stack
                                            (KEY=VALUE)    [array] [default: []]
      --execute                             Whether to execute ChangeSet
                                            (--no-execute will NOT execute the
                                            ChangeSet) [boolean] [default: true]
      --trust                               The AWS account IDs that should be
                                            trusted to perform deployments into
                                            this environment (may be repeated,
                                            modern bootstrapping only)
                                                           [array] [default: []]
      --trust-for-lookup                    The AWS account IDs that should be
                                            trusted to look up values in this
                                            environment (may be repeated, modern
                                            bootstrapping only)
                                                           [array] [default: []]
      --cloudformation-execution-policies   The Managed Policy ARNs that should
                                            be attached to the role performing
                                            deployments into this environment
                                            (may be repeated, modern
                                            bootstrapping only)
                                                           [array] [default: []]
  -f, --force                               Always bootstrap even if it would
                                            downgrade template version
                                                      [boolean] [default: false]
      --termination-protection              Toggle CloudFormation termination
                                            protection on the bootstrap stacks
                                                                       [boolean]
      --show-template                       Instead of actual bootstrapping,
                                            print the current CLI's
                                            bootstrapping template to stdout for
                                            customization
                                                      [boolean] [default: false]
      --toolkit-stack-name                  The name of the CDK toolkit stack to
                                            create                      [string]
      --template                            Use the template from the given file
                                            instead of the built-in one (use
                                            --show-template to obtain an
                                            example)                    [string]
      --previous-parameters                 Use previous values for existing
                                            parameters (you must specify all
                                            parameters on every deployment if
                                            this is disabled)
                                                       [boolean] [default: true]
  -h, --help                                Show help                  [boolean]

TLDR;

      --example-permissions-boundary,       Use the example permissions
      --epb                                 boundary.                  [boolean]
      --custom-permissions-boundary, --cpb  Use the permissions boundary
                                            specified by name.          [string]

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the p2 label May 8, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team May 8, 2024 21:48
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label May 8, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 and removed p2 labels May 8, 2024
@vinayak-kukreja vinayak-kukreja added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label May 8, 2024
@vinayak-kukreja vinayak-kukreja marked this pull request as ready for review May 8, 2024 22:32
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label May 8, 2024
@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

Copy link
Contributor

@scanlonp scanlonp left a comment

Choose a reason for hiding this comment

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

Aliases are duplicated with the command name, good find.

@scanlonp scanlonp added the pr/do-not-merge This PR should not be merged at this time. label May 8, 2024
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label May 8, 2024
@vinayak-kukreja
Copy link
Contributor Author

Test pipeline run was successful.

@scanlonp scanlonp added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested and removed pr/do-not-merge This PR should not be merged at this time. pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. labels May 9, 2024
@aws-cdk-automation aws-cdk-automation dismissed stale reviews from themself May 9, 2024 17:02

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link
Contributor

mergify bot commented May 9, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 6631bd7
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 8debd20 into main May 9, 2024
11 of 12 checks passed
@mergify mergify bot deleted the vkukreja/fix-bootstrap-help branch May 9, 2024 17:41
Copy link
Contributor

mergify bot commented May 9, 2024

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p1 pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-test The PR linter will not require test changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bootstrap: Missing new permissions boundary options
3 participants