ssm: unable to use serialized YAML string values as content for CfnDocument #28341
Labels
@aws-cdk/aws-ssm
Related to AWS Systems Manager
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p3
Describe the bug
According to the documentation for the content property of CfnDocument, it should be able to take an object representing JSON formatted content or a String if creating a YAML based document. When trying to use a string value for content, the document fails to create
Expected Behavior
I should be able to define a document using a YAML formatted string as content. The following code should synthesize and create the appropriate resource:
Current Behavior
The above code fails to synthesize with the following error:
If I wrap the string literal in
new String(...)
, the stack synthesizes, but does so incorrectly. It renders the context as an indexed dictionary of the string array which fails to create the resource with the errorResource handler returned message: "Invalid request provided: Missing "schemaVersion" in the document.
:Reproduction Steps
Create a stack with the following stack and attempt to synthesize the stack:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.114.1 (build 02bbb1d)
Framework Version
No response
Node.js Version
v18.16.1
OS
Mac OS X
Language
TypeScript
Language Version
Typescript (5.2.2)
Other information
No response
The text was updated successfully, but these errors were encountered: