Skip to content
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

E2004 issue with AWS::SSM::Parameter::Value<String> Parameters #1570

Closed
jordan-evans opened this issue Jun 4, 2020 · 1 comment · Fixed by #1571
Closed

E2004 issue with AWS::SSM::Parameter::Value<String> Parameters #1570

jordan-evans opened this issue Jun 4, 2020 · 1 comment · Fixed by #1571

Comments

@jordan-evans
Copy link

cfn-lint version: (cfn-lint --version)
0.33.0

Description of issue.
When using an SSM paramter store lookup to get a CIDR Range to use in a Security group, cfn-lint raised an E2004 error.

Parameters:
  VpcID:
    Description: ID of VPC
    Type: "AWS::SSM::Parameter::Value<String>"
    Default: VpcId
    AllowedValues:
      - VpcId

  VpcCidrRange:
    Description: CIDR range of VPC
    Type: "AWS::SSM::Parameter::Value<String>"
    Default: VpcCIDRRange
    AllowedValues:
      - VpcCIDRRange

Resources:
  SecurityGroup:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Allow HTTP egress
      VpcId: !Ref VpcID
      SecurityGroupEgress:
        - IpProtocol: tcp
          FromPort: 80
          ToPort: 80
          CidrIp: !Ref VpcCidrRange

Error is E2004 Cidr should be a Cidr Range based string for VpcCIDRRange product.template.yaml:9:3

If I'm not misunderstanding, cfn-lint seems to be complaining that the String VpcCIDRRange is not a valid CIDR, where in fact during runtime CloudFormation will lookup the value of VpcCIDRRange in SSM Parameter Store and use that instead.

I guess a sensible approach here would be to disable E2004 for parameters that have a type of AWS::SSM::Parameter::Value<String> maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants