Open sparr opened 6 months ago
I think this is more about missing functionality than the Linter being wrong.
TemplateBody is a documented parameter: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stack.html#cfn-cloudformation-stack-templatebody
Do we need to raise a feature request to get a documented feature to work??? I just wasted a couple of hours trying to make this work, assuming I'd got something else wrong. "It must be right, it's in the docs. Maybe I've got my !Sub wrong or something..."
There's further context in https://github.com/aws-cloudformation/cfn-lint/issues/2975
Apparently TemplateBody is only valid in... some unknown context, and it's not valid when using CFN to define a Stack.
Got the same issue. I want to deploy a cloudformation template using the CLI which creates two sub-stacks. I want to pass the template bodies to both stacks as variables (I extract the .yaml-files' content and convert it into .json-syntax) but I get the following error:
"Encountered unsupported property TemplateBody"
Just wasted some hours on trying to get this right. Now I have to change to S3 buckets using the TemplateURL property. Kind of annoying because its clearly part of the documentation.
If it's only valid in some undocumented context : Then the issue is with the documentation.
If the documentation does not declare the unknown context then how can the tooling/users know what the context they must use is?
Considering Cfn is an AWS product, it has far too many bugs like this.
Thanks for reporting this issue and your patience here. Based on what has been discussed, this does appear to be an issue with the underlying ValidateTemplate API and/or documentation. Since service APIs like that are used across SDKs, I'll go ahead and transfer this to our cross-SDK repository. I'll also reach out to the CloudFormation team regarding this issue and will share any updates here. Thanks again. (ref: P129370565)
Describe the bug
The following template validates successfully, but then fails during
create-stack
due toEncountered unsupported property TemplateBody
. Other more-obviously-invalid property names likefoo
produce expected validation failures.Expected Behavior
Validation failure
Current Behavior
Successful validation
Reproduction Steps
aws cloudformation validate-template --template-body file://thefollowingfile.yaml
Possible Solution
No response
Additional Information/Context
No response
CLI version used
aws-cli/2.14.4
Environment details (OS name and version, etc.)
Python/3.11.6 Darwin/23.1.0 MacOS/14.1