Skip to content

"aws cloudformation package" fails with AWS::LanguageExtensions Fn::ForEach in Resources  #8469

Closed

Description

@x6j8x

Describe the bug

Applying aws cloudformation package to a template that includes the AWS::LanguageExtensions transform and a Fn::ForEach in the Resources section results in the following error:

2024-01-08 15:32:38,671 - MainThread - awscli.clidriver - DEBUG - Exception caught in main()
Traceback (most recent call last):
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/clidriver.py", line 217, in main
    return command_table[parsed_args.command](remaining, parsed_args)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/clidriver.py", line 361, in __call__
    return command_table[parsed_args.operation](remaining, parsed_globals)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/customizations/commands.py", line 187, in __call__
    return self._run_main(parsed_args, parsed_globals)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/customizations/cloudformation/package.py", line 150, in _run_main
    exported_str = self._export(template_path, use_json)
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/customizations/cloudformation/package.py", line 166, in _export
    exported_template = template.export()
  File "/root/.pyenv/versions/3.9.16/lib/python3.9/site-packages/awscli/customizations/cloudformation/artifact_exporter.py", line 664, in export
    resource_type = resource.get("Type", None)
AttributeError: 'list' object has no attribute 'get'

Expected Behavior

Template is successfully packaged.

Current Behavior

Packaging fails

Reproduction Steps

Include Fn::ForEach in Resources block and package template.

Possible Solution

No response

Additional Information/Context

No response

CLI version used

aws-cli/1.27.110 Python/3.9.16 Linux/4.14.311-233.529.amzn2.aarch64

Environment details (OS name and version, etc.)

Amazon Linux

Activity

  1. added
    bug
    needs-triage
    on Jan 8, 2024
  2. isuftin commented on Jan 8, 2024

    @isuftin

    @x6j8x - Looks like this was very recently fixed #8075

    Consider updating your version of awscli

  3. added
    investigating
    p3
    and removed
    needs-triage
    on Jan 8, 2024
  4. RyanFitzSimmonsAK commented on Jan 8, 2024

    @RyanFitzSimmonsAK
    Contributor

    Hi @x6j8x, thanks for reaching out. As @isuftin mentioned, please update your CLI version to 2.15.3 or higher, and let me know how that goes.

  5. github-actions commented on Jan 8, 2024

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    Comments on closed issues are hard for our team to see.
    If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcloudformationinvestigatingp3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions