-
Notifications
You must be signed in to change notification settings - Fork 4k
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
CfnAssociation outputs invalid CloudFormation #3092
Comments
@kuhnboy according to the CloudFormation documentation, the first YAML you posted is actually correct... can you tell us what is the error you get from CloudFormation when trying to deploy this? Thanks, |
I've got the same problem, this is my synth template:
CF error is: "Value of {Parameters} must be a map where each value is a list of {String}" Using python, I build it (bit retarted tbh, why not just accept dict / array lol):
If I deploy a manually adjusted cfn like this:
CF is deploying it all fine - maybe there is a problem with the AWS documentation? |
Btw I've submitted feedback to AWS about the documentation being either confusing or wrong :) |
I've received confirmation from AWS that their documentation is wrong and they will update it:
Could you guys fix the CDK part ("Parameters" : {Key : Value, ...}) - cheers |
I'm hitting this today with this version
I have this snippet of CDK code
And I get this cloudformation yaml
And the same error about the contents of the parameter field as above. I'm going to try flipping to an |
It looks like there was a workaround in this issue I get what looks like valid cloudformation with
EDIT: Fixing target syntax, and making Association parameters a list |
@skinny85 I noted above in my original post what the error I was getting from cloud formation: "Value of {Parameters} must be a map where each value is a list of {String}" Interesting this hasn't been fixed yet but I as well do not set Parameters and have to do a property override: `
` |
The CloudFormation schema is wrong. Please report this issue to CloudFormation |
What does that mean? It seems that the way cdk is outputting is not correct, cloud formation expects it in a different format. When we output custom code it works. So how is it an issue with cloud formation? |
@rix0rrr I'm happy to open another bug report on the cloudformation side, but can you share what lead you to that conclusion? |
This is still happening. Contacted AWS support and confirmed they have an internal issue for the documentation, since it states the same as CDK produces. They raised a ticket with the Cloudformation team. Also filed it in their Roadmap: aws-cloudformation/cloudformation-coverage-roadmap#474 The root cause seems to be that specs are missing the Related to CDK, something in the build is not quite correct as it appears to be hitting the us-east-1 spec URL, according to this code update-spec \
"CloudFormation Resource Specification" \
"https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" \
spec-source/000_CloudFormationResourceSpecification.json \
true But that spec does not have the definition, so at some point, CDK is hitting another spec (eg: us-east-2) where that exists, therefore producing templates that are not possible to deploy "AWS::SSM::Association.ParameterValues": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-parametervalues.html",
"Properties": {
"ParameterValues": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ssm-association-parametervalues.html#cfn-ssm-association-parametervalues-parametervalues",
"DuplicatesAllowed": false,
"PrimitiveItemType": "String",
"Required": true,
"Type": "List",
"UpdateType": "Mutable"
}
}
}, For a workaround similar to what @bo67192 posted above, see also: #4057 (comment) |
Issue still active in 1.50 |
Confirming. I'm working on a fix. |
There is a problem with the `Parameters` property of the `AWS::SSM::Association` resource type. Server-side, its type is `Map<String, List<String>>`. Unfortunately, that type is impossible to represent in the current CloudFormation specification that our code generation is based on. Add a patch that changes the `Parameters` property of `AWS::SSM::Association` to: ```json "AWS::SSM::Association": { "Properties": { "Parameters": { "Type": "Map", "ItemType": "List", "PrimitiveItemItemType": "String", "UpdateType": "Mutable", "Required": false } } } ``` That is not a legal CFN spec type. But we add a new property type, `MapOfListsOfPrimitives`, to the `cfnspec` module, that represents it. We then modify our L1 code generation in `cfn2ts` to use the new type, allowing `CfnAssociationProps.parameters` to have type `{ [key: string]: string[] }`. Fixes #3092 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Thanks @skinny85! Excited for the next release to try this and remove my overrides. |
Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
When creating a CfnAssociation parameter:
The output appears to be correct, but cloud formation reports the following error: "Value of {Parameters} must be a map where each value is a list of {String}"
Looking at the documentation, it appears from the sample yaml it should be:
but what is emitted from the code above is:
Would expect the association to be created with the correct parameters and values.
Would like to have CfnAssociation working.
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: