aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.4k stars 576 forks source link

E1152 and dynamic parameters #3329

Closed palsivertsen closed 2 weeks ago

palsivertsen commented 2 weeks ago

CloudFormation Lint Version

cfn_lint-1.3.0-py3-none-any

What operating system are you using?

Alpine in docker (python:3.12-alpine / python@sha256:a982997504b8ec596f553d78f4de4b961bbdf5254e0177f6e99bb34f4ef16f95)

Describe the bug

The linter complains that a dynamic parameter is not a valid value for the LaunchTemplateData.ImageId field in AWS::EC2::LaunchTemplate.

The error message is:

E1152 'resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id' is not a 'AWS::EC2::Image.Id'

Expected behavior

cfn-lint should not produce errors for this template

Reproduction template

AWSTemplateFormatVersion: "2010-09-09"

Resources:
  LaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties:
      LaunchTemplateData:
        ImageId: resolve:ssm:/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id