aws-cloudformation / rain

A development workflow tool for working with AWS CloudFormation.
Apache License 2.0
749 stars 69 forks source link

[rain forecast] - [BUG] - 1.10.0: false-positive for `F0009` on `AWS::EC2::Instance` using `m7a.large` with `ami-034de56da2366e342` #420

Closed r-heimann closed 2 weeks ago

r-heimann commented 3 weeks ago

Hi,

after updating rain from v1.8.6 to v1.10.0 we noticed a false-positive finding:

[!] An error occurred: 1 
    --> Stormy weather ahead! 🌪 
    --> 1 checks failed out of 36 total checks 
    --> F0009 FAIL on line 199: AWS::EC2::Instance Instance - Instance type m7a.large does not support AMI ami-034de56da2366e342

Example AWS::EC2::Instance:

  Instance:
    Type: AWS::EC2::Instance
    Properties:
      AvailabilityZone: eu-central-1a
      InstanceType: m7a.large
      IamInstanceProfile: !Ref InstanceProfile
      ImageId: ami-034de56da2366e342 # amazon/Windows_Server-2022-English-Full-Base-2024.05.15
      NetworkInterfaces:
        - NetworkInterfaceId: !GetAtt NetworkInterface.Id
          DeviceIndex: 0
      BlockDeviceMappings:
        - DeviceName: /dev/sda1 # C:\ Drive
          Ebs:
            VolumeType: gp3
            VolumeSize: 50 # GB
            Iops: 3000
            Encrypted: true
            KmsKeyId: !GetAtt KMSKey.Arn
            DeleteOnTermination: false
      PropagateTagsToVolumeOnCreation: true
      DisableApiTermination: true
      Tags:
        - Key: Name
          Value: EC2Instance

We are able to properly use rain forecast after turning off the check

rain forecast --experimental ${CLOUDFORMATION_TEMPLATE} ${STACKNAME} --config ${PARAMETERFILE} --ignore "F0009"

ericzbeard commented 3 weeks ago

What region are you running this in?

r-heimann commented 3 weeks ago

What region are you running this in?

eu-central-1