aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 56 forks source link

[AWS::AutoScaling::AutoScalingGroup] is not sending "AcceleratorCount" in the CreateAutoScalingGroup API Call. #1653

Open ruchirshetye-aws opened 1 year ago

ruchirshetye-aws commented 1 year ago

Name of the resource

AWS::AutoScaling::AutoScalingGroup

Resource Name

No response

Issue Description

This is a bug in AWS::AutoScaling::AutoScalingGroup

The resource AWS::AutoScaling::AutoScalingGroup is not sending "AcceleratorCount" in the CreateAutoScalingGroupAPI Call. Due to which the Property is not set on the AutoScalingGroup resource.

You can also check the output of describe-auto-scaling-groups CLI Call which will show that the AcceleratorCount is not set on the ASG Resource.

Expected Behavior

AcceleratorCount should be set on the ASG, currently it's not set by CFN.

Observed Behavior

After deploying the above template, if you see the CreateAutoScalingGroup API, there you will see that CFN isn't passing AcceleratorCount.

From the test case template only the below parameters are passed on the API Call.

  "overrides": [
                    {
                        "instanceRequirements": {
                            "vCpuCount": {
                                "min": 1,
                                "max": 2
                            },
                            "memoryMiB": {
                                "min": 0
                            },
                            "instanceGenerations": [
                                "current"
                            ],
                            "localStorageTypes": [
                                "ssd"
                            ]
                        }
                    }
                ]

Test Cases

For example, try deploying the below template which has AcceleratorCount as override

AWSTemplateFormatVersion: '2010-09-09'
Parameters:
  LatestAmiId:
    Description: Region specific image from the Parameter Store
    Type: 'AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>'
    Default: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2'
  InstanceType:
    Description: Amazon EC2 instance type for the instances
    Type: String
    AllowedValues:
      - t3.micro
      - t3.small
      - t3.medium
    Default: t3.micro
  Subnets:
    Type: 'List<AWS::EC2::Subnet::Id>'
    Description: A list of subnets for the Auto Scaling group
Resources:
  myLaunchTemplate:
    Type: AWS::EC2::LaunchTemplate
    Properties: 
      LaunchTemplateName: !Sub ${AWS::StackName}-launch-template
      LaunchTemplateData:
        ImageId: !Ref LatestAmiId
        InstanceType: !Ref InstanceType
  myASG:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      MaxSize: '1'
      MinSize: '0'
      DesiredCapacity: '1'
      VPCZoneIdentifier: !Ref Subnets
      MixedInstancesPolicy:
        LaunchTemplate: 
          LaunchTemplateSpecification:
            LaunchTemplateId: !Ref myLaunchTemplate
            Version: !GetAtt myLaunchTemplate.LatestVersionNumber
          Overrides:
            - InstanceRequirements:
                AcceleratorCount:
                  Max: 3
                MemoryMiB:
                  Min: 0
                InstanceGenerations:
                  - current
                LocalStorageTypes:
                  - ssd
                VCpuCount:
                  Max: 2
                  Min: 1

Other Details

No response

ymrenn commented 1 year ago

This bug could impact ability to serve customer requests.