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

(cli): Could not create a change set ... Template format error: At least one Resources member must be defined #29233

Closed
andreialecu opened this issue Feb 23, 2024 · 3 comments
Labels
bug This issue is a bug. cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p1 package/tools Related to AWS CDK Tools or CLI

Comments

@andreialecu
Copy link
Contributor

Describe the bug

I have a couple of stacks where the change set mechanism doesn't seem to work.

Expected Behavior

No changes should be observed in this stack. Also, the changeset should work.

Current Behavior

It hints at running the command with -v, and there I can see the following logged:

[14:08:59] Call failed: createChangeSet({"StackName":"...","ChangeSetName":"cdk-diff-change-set","ChangeSetType":"CREATE","Description":"CDK Changeset for diff 8ed8623f-893f-4955-8cff-38c32722e917","ClientToken":"diff8ed8623f-893f-4955-8cff-38c32722e917","TemplateBody":"Parameters:\n  BootstrapVersion:\n    Type: AWS::SSM::Parameter::Value<String>\n    Default: /cdk-bootstrap/hnb659fds/version\n    Description: Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]\nRules:\n  CheckBootstrapVersion:\n    Assertions:\n      - Assert:\n          Fn::Not:\n            - Fn::Contains:\n                - - \"1\"\n                  - \"2\"\n                  - \"3\"\n                  - \"4\"\n                  - \"5\"\n                - Ref: BootstrapVersion\n        AssertDescription: CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI.\n","Parameters":[],"RoleARN":"arn:aws:iam::...:role/cdk-hnb659fds-cfn-exec-role-...-eu-west-1","Capabilities":["CAPABILITY_IAM","CAPABILITY_NAMED_IAM","CAPABILITY_AUTO_EXPAND"]}) => Template format error: At least one Resources member must be defined. (code=ValidationError)
[14:08:59] Template format error: At least one Resources member must be defined.

The "template differences" fallback shows:

Could not create a change set, will base the diff on template differences (run again with -v to see the reason)
Parameters
[+] Parameter BootstrapVersion BootstrapVersion: {"Type":"AWS::SSM::Parameter::Value<String>","Default":"/cdk-bootstrap/hnb659fds/version","Description":"Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"}

Other Changes
[+] Unknown Rules: {"CheckBootstrapVersion":{"Assertions":[{"Assert":{"Fn::Not":[{"Fn::Contains":[["1","2","3","4","5"],{"Ref":"BootstrapVersion"}]}]},"AssertDescription":"CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."}]}}

This also always marks the stack as having diffs, even though when it's deployed, diffs don't exist.

Reproduction Steps

No repro, but I hope the logging above is relevant to see what Resources member is not defined and why.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.130.0

Framework Version

No response

Node.js Version

18.16.1

OS

macOS

Language

TypeScript

Language Version

No response

Other information

No response

@andreialecu andreialecu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2024
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Feb 23, 2024
@andreialecu andreialecu changed the title (cli): Coulld not create a change set ... Template format error: At least one Resources member must be defined (cli): Could not create a change set ... Template format error: At least one Resources member must be defined Feb 23, 2024
@spssmn-aws
Copy link

Same issue for me - same setup as reporter.

@pahud pahud added p1 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Feb 23, 2024
@ashishdhingra ashishdhingra added the cli Issues related to the CDK CLI label Jun 17, 2024
@comcalvi
Copy link
Contributor

Reproduced on 2.130.0, verified that this does not happen on 2.158.0.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 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. cli Issues related to the CDK CLI effort/medium Medium work item – several days of effort p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

5 participants