3
AWS針對DynamoDB發佈auto scaling。我想知道如何通過Cloudformation創建自動縮放表。DynamoDB使用Cloudformation自動縮放
AWS針對DynamoDB發佈auto scaling。我想知道如何通過Cloudformation創建自動縮放表。DynamoDB使用Cloudformation自動縮放
以下是ClodFormation自動縮放策略適用於DynamoDB表。希望它給你一些關於如何形成策略腳本的想法。
{
"Type" : "AWS::ApplicationAutoScaling::ScalingPolicy",
"Properties" : {
"PolicyName" : "MyScalingPolicy",
"PolicyType" : "TargetTrackingScaling",
"ResourceId" : "arn:aws:dynamodb:us-east-1:123456789012:table/books_table",
"ScalableDimension" : "dynamodb:table:WriteCapacityUnits",
"ServiceNamespace" : "dynamodb",
"TargetTrackingScalingPolicyConfiguration" : {
"PredefinedMetricSpecification": {
"PredefinedMetricType": "DynamoDBWriteCapacityUtilization"
},
"ScaleOutCooldown": 60,
"ScaleInCooldown": 60,
"TargetValue": 50.0
}
}
}
參考: -
CloudFormaction auto-scaling policy
AWS CLI command for auto scaling
AWS CLI命令: -
aws application-autoscaling put-scaling-policy \
--service-namespace dynamodb \
--resource-id "table/TestTable" \
--scalable-dimension "dynamodb:table:WriteCapacityUnits" \
--policy-name "MyScalingPolicy" \
--policy-type "TargetTrackingScaling" \
--target-tracking-scaling-policy-configuration file://scaling-policy.json
scaling-policy.json: -
{
"PredefinedMetricSpecification": {
"PredefinedMetricType": "DynamoDBWriteCapacityUtilization"
},
"ScaleOutCooldown": 60,
"ScaleInCooldown": 60,
"TargetValue": 50.0
}
謝謝,它的工作!我創建了一個ScalingPolicy,ScalingTarget和一個角色 –
好東西... – notionquest
如何將多個表(資源)添加到可伸縮目標? – eddyrokr