AWS Auto Scaling Scaling Plan
This page shows how to write Terraform and CloudFormation for AWS Auto Scaling Scaling Plan and write them securely.
aws_autoscalingplans_scaling_plan (Terraform)
The Scaling Plan in AWS Auto Scaling can be configured in Terraform with the resource name aws_autoscalingplans_scaling_plan
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_autoscalingplans_scaling_plan" "main" {
name = "example-dynamic-cost-optimization"
application_source {
tag_filter {
key = "application"
resource "aws_autoscalingplans_scaling_plan" "example" {
name = "example-dynamic-cost-optimization"
application_source {
tag_filter {
key = "application"
resource "aws_autoscalingplans_scaling_plan" "RHEL_Scaling_Plan" {
name = "RHEL_Scaling_Plan"
application_source {
tag_filter {
key = "name"
Parameters
-
id
optional computed - string -
name
required - string -
scaling_plan_version
optional computed - number -
application_source
list block-
cloudformation_stack_arn
optional - string -
tag_filter
set block
-
-
scaling_instruction
set block-
disable_dynamic_scaling
optional - bool -
max_capacity
required - number -
min_capacity
required - number -
predictive_scaling_max_capacity_behavior
optional - string -
predictive_scaling_max_capacity_buffer
optional - number -
predictive_scaling_mode
optional - string -
resource_id
required - string -
scalable_dimension
required - string -
scaling_policy_update_behavior
optional - string -
scheduled_action_buffer_time
optional - number -
service_namespace
required - string -
customized_load_metric_specification
list block-
dimensions
optional - map from string to string -
metric_name
required - string -
namespace
required - string -
statistic
required - string -
unit
optional - string
-
-
predefined_load_metric_specification
list block-
predefined_load_metric_type
required - string -
resource_label
optional - string
-
-
target_tracking_configuration
set block-
disable_scale_in
optional - bool -
estimated_instance_warmup
optional - number -
scale_in_cooldown
optional - number -
scale_out_cooldown
optional - number -
target_value
required - number -
customized_scaling_metric_specification
list block-
dimensions
optional - map from string to string -
metric_name
required - string -
namespace
required - string -
statistic
required - string -
unit
optional - string
-
-
predefined_scaling_metric_specification
list block-
predefined_scaling_metric_type
required - string -
resource_label
optional - string
-
-
-
Explanation in Terraform Registry
Manages an AWS Auto Scaling scaling plan. More information can be found in the AWS Auto Scaling User Guide.
NOTE: The AWS Auto Scaling service uses an AWS IAM service-linked role to manage predictive scaling of Amazon EC2 Auto Scaling groups. The service attempts to automatically create this role the first time a scaling plan with predictive scaling enabled is created. An
aws_iam_service_linked_role
resource can be used to manually manage this role. See the AWS documentation for more details.
AWS::AutoScalingPlans::ScalingPlan (CloudFormation)
The ScalingPlan in AutoScalingPlans can be configured in CloudFormation with the resource name AWS::AutoScalingPlans::ScalingPlan
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
ApplicationSource
required - ApplicationSource -
ScalingInstructions
required - List of ScalingInstruction
Explanation in CloudFormation Registry
The
AWS::AutoScalingPlans::ScalingPlan
resource defines an AWS Auto Scaling scaling plan. A scaling plan is used to scale application resources to size them appropriately to ensure that enough resource is available in the application at peak times and to reduce allocated resource during periods of low utilization. The following resources can be added to a scaling plan:+ Amazon EC2 Auto Scaling groups+ Amazon EC2 Spot Fleet requests+ Amazon ECS services+ Amazon DynamoDB tables and global secondary indexes+ Amazon Aurora ReplicasFor more information, see the AWS Auto Scaling User Guide.
Frequently asked questions
What is AWS Auto Scaling Scaling Plan?
AWS Auto Scaling Scaling Plan is a resource for Auto Scaling of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Auto Scaling Scaling Plan?
For Terraform, the Aliakbarkh/Terraform-CI-CD, mhmd-deniafendi/terraform-live and darnele868410/COALFIREASSESMENT source code examples are useful. See the Terraform Example section for further details.