2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CloudFormationでDynamoDBのオートスケーリングを設定する

Posted at

テンプレート

AWSTemplateFormatVersion: 2010-09-09
Resources:
  sampleScalableTarget:
    Type: "AWS::ApplicationAutoScaling::ScalableTarget"
    Properties:
      MaxCapacity: 100 # 最大キャパシティー
      MinCapacity: 1 # 最小キャパシティー
      ResourceId: !Sub table/sample-table # テーブル名を指定する「table/」の後にテーブル名を指定する
      RoleARN: !GetAtt ScalingRole.Arn
      ScalableDimension: "dynamodb:table:ReadCapacityUnits" # 書き込みキャパシティーユニットの場合は、「dynamodb:table:WriteCapacityUnits」
      ServiceNamespace: dynamodb
  sampleScalingPolicy:
    Type: "AWS::ApplicationAutoScaling::ScalingPolicy"
    Properties:
      PolicyName: sampleAutoScalingPolicy
      PolicyType: TargetTrackingScaling
      ScalingTargetId:
        Ref: sampleScalableTarget
      TargetTrackingScalingPolicyConfiguration:
        TargetValue: 70 # ターゲット使用率
        ScaleInCooldown: 30 # スケールインが起きて次のスケールインするまでの時間(秒)
        ScaleOutCooldown: 30 # スケールアウトが起きて次のスケールアウトするまでの時間(秒) 
        PredefinedMetricSpecification:
          PredefinedMetricType: DynamoDBReadCapacityUtilization

参考にしたページ

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?