AWS AWSCloudFormation documentation change
Summary
Updated simple scaling policy example with expanded syntax
Security assessment
Formatting changes to documentation examples without any modifications to security-related parameters or vulnerability disclosures.
Diff
diff --git a/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md b/AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md index 9d578ea98..3594bee01 100644 --- a//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md +++ b//AWSCloudFormation/latest/TemplateReference/aws-resource-autoscaling-scalingpolicy.md @@ -294,5 +294,25 @@ 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" + } + } + } + } + } @@ -303,4 +323,13 @@ 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 @@ -321,28 +350,147 @@ 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" } } } } } } + { + "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":{