-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
New Fn::ForEach function breaks cloudformation package
CLI
#8075
Comments
Update: It also fails when packaging a template with nested templates when one of the nested templates uses the |
Hi @JeremieRodon - thanks for reporting this behavior. I was able to reproduce it on my end and we will need to further investigate with the team. I'll post here once we have an update. |
From further discussion with the team, we have been advised to refer users of CloudFormation package to the AWS SAM CLI and sam-package command. Any changes related to the CloudFormation customization are currently not prioritized but you're welcome to submit contribution PR on this and the team will be able to take a look. |
As best I can tell, this is an issue with the AWS SAM CLI as well. |
I am also seeing this issue. |
Just wanted to follow up and let everyone know that we are aware of the issue, and the team owning the CloudFormation customization is planning to work on it. Also found a related issue in the SAM CLI repository: aws/aws-sam-cli#5647 |
The |
|
Describe the bug
When using aws cloudformation package on a template file that uses
Transform: AWS::LanguageExtensions
withFn::ForEach
, the command fails with the message:'list' object has no attribute 'get'
Expected Behavior
aws cloudformation package
should accept any syntax accepted by the CloudFormation service engine.Current Behavior
aws cloudformation package
fails with'list' object has no attribute 'get'
when using a template with theFn::ForEach
language extension.Reproduction Steps
This is a valid CloudFormation template that will create two InternetGateways:
If you save that in a file named
igws.yml
and try this:aws cloudformation package --template-file igws.yml --s3-bucket some-bucket --output-template-file igws-new.yml
It will throw the exception
Possible Solution
It fails because the Resource bloc usually only contains sub-objects like:
With the Fn::ForEach, we must define a list, like:
I guess the CLI parser is expecting anything under
Resources
to be a Python dictionary with aType
key so it tries to get that.When it tries to do so on the
Fn::ForEach
list, that throws'list' object has no attribute 'get'
Additional Information/Context
No response
CLI version used
aws-cli/2.13.5
Environment details (OS name and version, etc.)
Windows 10
The text was updated successfully, but these errors were encountered: