AWS AWSCloudFormation documentation change
Summary
Reformatted JSON/YAML examples to use compact syntax without changing functionality
Security assessment
Changes are purely formatting/whitespace adjustments to CloudFormation examples. No security-related parameters, configurations or warnings were added/modified. Security group references (InstanceSecurityGroup) and monitoring settings remain unchanged from previous examples.
Diff
diff --git a/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md b/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md index 3594bee01..9d578ea98 100644 --- a//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md +++ b//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md @@ -294,25 +294,5 @@ The following template snippet shows a predictive scaling policy configuration t - { - "AWSTemplateFormatVersion":"2010-09-09", - "Resources":{ - "myPredictiveScalingPolicy":{ - "Type":"AWS::AutoScaling::ScalingPolicy", - "Properties":{ - "AutoScalingGroupName":{ - "Ref":"myASG" - }, - "PolicyType":"PredictiveScaling", - "PredictiveScalingConfiguration":{ - "MetricSpecifications":[ - { - "TargetValue":70, - "PredefinedMetricPairSpecification":{ - "PredefinedMetricType":"ASGCPUUtilization" - } - } - ], - "Mode":"ForecastOnly" - } - } - } - } - } + { "AWSTemplateFormatVersion":"2010-09-09", "Resources":{ "myPredictiveScalingPolicy":{ + "Type":"AWS::AutoScaling::ScalingPolicy", "Properties":{ "AutoScalingGroupName":{ "Ref":"myASG" }, + "PolicyType":"PredictiveScaling", "PredictiveScalingConfiguration":{ "MetricSpecifications":[ { "TargetValue":70, + "PredefinedMetricPairSpecification":{ "PredefinedMetricType":"ASGCPUUtilization" } } ], "Mode":"ForecastOnly" } } } + } } @@ -323,13 +303,4 @@ The following template snippet shows a predictive scaling policy configuration t - AWSTemplateFormatVersion: 2010-09-09 - Resources: - myPredictiveScalingPolicy: - Type: 'AWS::AutoScaling::ScalingPolicy' - Properties: - AutoScalingGroupName: !Ref myASG - PolicyType: PredictiveScaling - PredictiveScalingConfiguration: - MetricSpecifications: - - TargetValue: '70' - PredefinedMetricPairSpecification: - PredefinedMetricType: ASGCPUUtilization - Mode: ForecastOnly + AWSTemplateFormatVersion: 2010-09-09 Resources: myPredictiveScalingPolicy: Type: + 'AWS::AutoScaling::ScalingPolicy' Properties: AutoScalingGroupName: !Ref myASG PolicyType: PredictiveScaling + PredictiveScalingConfiguration: MetricSpecifications: - TargetValue: '70' PredefinedMetricPairSpecification: + PredefinedMetricType: ASGCPUUtilization Mode: ForecastOnly @@ -350,147 +321,28 @@ To create a scaling policy for the `ALBRequestCountPerTarget` metric and the loa - { - "AWSTemplateFormatVersion":"2010-09-09", - "Parameters":{ - "AmiId":{ - "Type":"String" - }, - "Subnets":{ - "Type": "List<AWS::EC2::Subnet::Id>", - "Description": "At least two public subnets in different Availability Zones in the selected VPC" - }, - "VPC":{ - "Type": "AWS::EC2::VPC::Id", - "Description": "A VPC that allows the load balancer access to the Internet" - }, - "InstanceSecurityGroup":{ - "Type": "List<AWS::EC2::SecurityGroup::Id>", - "Description": "A security group in the selected VPC that allows HTTP access on the inbound port" - }, - "CPUPolicyTargetValue":{ - "Type":"String", - "Description": "The target utilization for the CPU metric" - }, - "ALBRequestCountTargetValue":{ - "Type":"String", - "Description": "The optimal average request count per instance during any one-minute interval" - } - }, - "Resources":{ - "myLoadBalancer":{ - "Type":"AWS::ElasticLoadBalancingV2::LoadBalancer", - "Properties":{ - "Subnets":{ - "Ref":"Subnets" - } - } - }, - "myLoadBalancerListener":{ - "Type":"AWS::ElasticLoadBalancingV2::Listener", - "Properties":{ - "DefaultActions":[ - { - "TargetGroupArn":{ - "Ref":"myTargetGroup" - }, - "Type":"forward" - } - ], - "LoadBalancerArn":{ - "Ref":"myLoadBalancer" - }, - "Port":80, - "Protocol":"HTTP" - } - }, - "myTargetGroup":{ - "Type":"AWS::ElasticLoadBalancingV2::TargetGroup", - "Properties":{ - "Name":"myTargetGroup", - "Port":80, - "Protocol":"HTTP", - "VpcId":{ - "Ref":"VPC" - } - } - }, - "myLaunchTemplate": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateName": { "Fn::Sub": "${AWS::StackName}-launch-template" }, - "LaunchTemplateData": { - "ImageId": { "Ref": "AmiId" }, - "InstanceType": "t3.micro", - "SecurityGroupIds": [ { "Ref":"InstanceSecurityGroup" } ], - "Monitoring": { "Enabled": true } - } - } - }, - "myASG":{ - "Type":"AWS::AutoScaling::AutoScalingGroup", - "Properties":{ - "LaunchTemplate": { - "LaunchTemplateId": { "Ref": "myLaunchTemplate" }, - "Version": { "Fn::GetAtt": [ "myLaunchTemplate", "LatestVersionNumber" ] } - }, - "MaxSize":"2", - "MinSize":"1", - "DefaultInstanceWarmup": 30, - "VPCZoneIdentifier": { "Ref":"Subnets" }, - "TargetGroupARNs":[ { "Ref":"myTargetGroup" } ] - } - }, - "myCPUPolicy":{ - "Type":"AWS::AutoScaling::ScalingPolicy", - "Properties":{ - "AutoScalingGroupName":{ - "Ref":"myASG" - }, - "PolicyType":"TargetTrackingScaling", - "TargetTrackingConfiguration":{ - "PredefinedMetricSpecification":{ - "PredefinedMetricType":"ASGAverageCPUUtilization" - }, - "TargetValue":{ - "Ref":"CPUPolicyTargetValue" - } - } - } - }, - "myALBRequestCountPolicy":{ - "Type":"AWS::AutoScaling::ScalingPolicy", - "DependsOn" : "myLoadBalancerListener", - "Properties":{ - "AutoScalingGroupName":{ - "Ref":"myASG" - }, - "PolicyType":"TargetTrackingScaling", - "TargetTrackingConfiguration":{ - "PredefinedMetricSpecification":{ - "PredefinedMetricType":"ALBRequestCountPerTarget", - "ResourceLabel":{ - "Fn::Join":[ - "/", - [ - { - "Fn::GetAtt":[ - "myLoadBalancer", - "LoadBalancerFullName" - ] - }, - { - "Fn::GetAtt":[ - "myTargetGroup", - "TargetGroupFullName" - ] - } - ] - ] - } - }, - "TargetValue":{ - "Ref":"ALBRequestCountTargetValue" - } - } - } - } - }