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.1k stars 53 forks source link

AWS::AutoScaling::AutoScalingGroup - EstimateTemplateCost issue on validating Autoscaling group #937

Open markedcahinde opened 2 years ago

markedcahinde commented 2 years ago

Name of the resource

AWS::AutoScaling::AutoScalingGroup

Resource Name

AWS::AutoScaling::AutoScalingGroup

Issue Description

EstimateTemplateCost via aws-cli validates that LaunchConfigurationName is required in AWS::AutoScaling::AutoScalingGroup

However, Cloudformation documentation shows that it's requirement is only Conditional, given that other properties needed to create the AutoscalingGroup Exists

LaunchConfigurationName The name of the launch configuration to use to launch instances. If you specify LaunchTemplate, MixedInstancesPolicy, or InstanceId, don't specify LaunchConfigurationName. Required: Conditional

The template used for cost estimation uses LaunchTemplate property instead.

Expected Behavior

EstimateTemplateCost should show the AWS calculator link from command

Observed Behavior

Received error as shown:

An error occurred (ValidationError) when calling the EstimateTemplateCost operation: LaunchConfigurationName missing. It is a mandatory property of AutoScaling Group

Test Cases

Ran the following aws-cli command

aws cloudformation estimate-template-cost \
--template-url "https://cf-templates-<redacted>.s3.eu-west-2.amazonaws.com/<redacted>.yaml" \
--parameters '[{"ParameterKey":"Environment","ParameterValue":"production","UsePreviousValue":false},{"ParameterKey":"Net1VpcId","ParameterValue":"vpc-xxxxxxxxxxx","UsePreviousValue":false},{"ParameterKey":"Net1TgwId","ParameterValue":"tgw-xxxxxxxxxxx","UsePreviousValue":false},{"ParameterKey":"VPCFlowLogBucket","ParameterValue":"arn:aws:s3:::xxxxxxxxxxxxxxx","UsePreviousValue":false}]'

Other Details

No response

yellow-cpu commented 3 months ago

This is still an issue. Can't use the estimation CLI at all on a CDK generated CFN template due to this defect.