Skip to content

"AWS::SSM::Parameter::Value<String>" should be AWS::SSM::Parameter::Value<AWS::EC2::Image::Id> for /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 #4013

@ygoodmn

Description

@ygoodmn

🐛 Bug Report

What is the problem?

Running cfn-lint on JSON file get Rule W2506 lint
(venv) C:>cfn-lint packages\bitcode\templates\bitcode-sky-03app-prod-0
-1-1.template.json
W2506 Parameter SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05
118Parameter should be of type [AWS::EC2::Image::Id, AWS::SSM::Parameter::ValueAWS::EC2::Image::Id]
packages\bitcode\templates\bitcode-sky-03app-prod-0-1-1.template.json:413:5

JSON looks like:

"Parameters": {
    "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
      "Type": "AWS::SSM::Parameter::Value<String>",
      "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
    }
  },

Expected

Value in JSON to meet cfn-lint cloudformation Specs W2506

"Parameters": {
    "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": {
      "Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
      "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
    }
  },

Reproduction Steps

Run cdk synth which calls machine-image

Environment

  • CDK CLI Version: 1.6.1
  • Module Version: aws-ec-2
  • OS: Windows 10
  • Language: TypeScript
  • cfn-python-lint: 0.24.1

From https://github.com/aws-cloudformation/cfn-python-lint

Other information

In the code search : multiple locations shows it as not AWS::EC2::Image::Id
example:
packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.expected.json
Shows it as

"Type": "AWS::SSM::Parameter::Value<String>",

Assume this is set in:
In packages/@aws-cdk/aws-ec2/lib/machine-image.ts

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ec2Related to Amazon Elastic Compute Cloud@aws-cdk/aws-ssmRelated to AWS Systems ManagerbugThis issue is a bug.needs-reproductionThis issue needs reproduction.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions