aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

core: cdk.json "qualifier" ignored

Open thoward-godaddy opened this issue 1 year ago • 5 comments

Describe the bug

Setting qualifier attribute in cdk.json appears to not have any impact on running cdk bootstrap as it continues to use the default qualifier.

Expected Behavior

Setting the qualifier attribute in cdk.json should behave the same as running cdk bootstrap --qualifier <QUALIFIER_VALUE>.

Current Behavior

Running cdk bootstrap does not inherit the qualifier value stored in cdk.json

Reproduction Steps

Add a qualifier value to cdk.json:

{
  "app": "npx ts-node --prefer-ts-exts bin/app.ts",
  "versionReporting": false,
  "watch": {
    "include": [
      "**"
    ],
    "exclude": [
      "README.md",
      "cdk*.json",
      "**/*.d.ts",
      "**/*.js",
      "tsconfig.json",
      "package*.json",
      "yarn.lock",
      "node_modules",
      "test"
    ]
  },
  "context": {
    "@aws-cdk/core:bootstrapQualifier": "sample-app",
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": true,
    "@aws-cdk/core:stackRelativeExports": true,
    "@aws-cdk/aws-rds:lowercaseDbIdentifier": true,
    "@aws-cdk/aws-lambda:recognizeVersionProps": true,
    "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": true,
    "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true,
    "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true,
    "@aws-cdk/aws-iam:minimizePolicies": true,
    "@aws-cdk/core:target-partitions": [
      "aws",
      "aws-cn"
    ],
    "@aws-cdk/core:newStyleStackSynthesis": true
  },
  "qualifier": "sample-app",
  "toolkitStackName": "sample-app-cdk-toolkit"
}

Run cdk bootstrap and observe resources being created using the default qualifier.

Possible Solution

Unkown, I'd assume the CLI should plug in the qualifier value from cdk.json if not explicitly provided as an option to the command.

Additional Information/Context

No response

CDK CLI Version

2.113.0 (build ccd534a)

Framework Version

No response

Node.js Version

v20.9.0

OS

OSX 13.6 (22G120)

Language

TypeScript

Language Version

No response

Other information

No response

thoward-godaddy avatar Dec 04 '23 17:12 thoward-godaddy

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Dec 04 '23 18:12 github-actions[bot]

Did you mean cdk bootstrap --qualifier <QUALIFIER_VALUE> works but it just ignores the pre-defined value in cdk.json?

pahud avatar Dec 05 '23 16:12 pahud

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Dec 07 '23 20:12 github-actions[bot]

Did you mean cdk bootstrap --qualifier <QUALIFIER_VALUE> works but it just ignores the pre-defined value in cdk.json?

Yeah, I'd expect it to use the value in cdk.json if the --qualifier option is not provided to the command.

thoward-godaddy avatar Dec 07 '23 21:12 thoward-godaddy

When doing a cdk synth or cdk deploy using the cdk version "2.123.0 (build a594112)", this is being ignored and breaks our deployments:

"context": { "@aws-cdk/core:bootstrapQualifier": "myqualifier", }

Please fix this problem.

taabrcr avatar Feb 09 '24 16:02 taabrcr