Defining AutoScaling for Aurora DB Cluster in CloudFormation template











up vote
1
down vote

favorite












I need to add AutoScaling for my AWS Aurora DB Cluster, and I found this nice article about how to do it with the web console. But I couldn't find how to define it using CloudFormation template of the AWS::RDS::DBCluster resource.



Can someone direct me on how to define Auto Scaling Policies to my DB cluster using CloudFormation?










share|improve this question


























    up vote
    1
    down vote

    favorite












    I need to add AutoScaling for my AWS Aurora DB Cluster, and I found this nice article about how to do it with the web console. But I couldn't find how to define it using CloudFormation template of the AWS::RDS::DBCluster resource.



    Can someone direct me on how to define Auto Scaling Policies to my DB cluster using CloudFormation?










    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I need to add AutoScaling for my AWS Aurora DB Cluster, and I found this nice article about how to do it with the web console. But I couldn't find how to define it using CloudFormation template of the AWS::RDS::DBCluster resource.



      Can someone direct me on how to define Auto Scaling Policies to my DB cluster using CloudFormation?










      share|improve this question













      I need to add AutoScaling for my AWS Aurora DB Cluster, and I found this nice article about how to do it with the web console. But I couldn't find how to define it using CloudFormation template of the AWS::RDS::DBCluster resource.



      Can someone direct me on how to define Auto Scaling Policies to my DB cluster using CloudFormation?







      amazon-web-services amazon-cloudformation autoscaling amazon-rds-aurora






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 15 at 16:07









      Praneeth Peiris

      1,079725




      1,079725
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You'll need to use the Application Autoscaling service. Below is an example CFN script but note that I haven't created any instances - only the cluster and the scaling policy.



          AWSTemplateFormatVersion: 2010-09-09
          Resources:
          MyDatabase:
          Type: AWS::RDS::DBCluster
          Properties:
          Engine: aurora
          EngineVersion: 5.6.10a
          MasterUsername: example
          MasterUserPassword: examplepassword

          AutoScalerTarget:
          Type: AWS::ApplicationAutoScaling::ScalableTarget
          Properties:
          MinCapacity: 1
          MaxCapacity: 8
          ResourceId: !Sub "cluster:${MyDatabase}"
          ScalableDimension: rds:cluster:ReadReplicaCount
          ServiceNamespace: rds
          RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster"

          AutoScaler:
          Type: AWS::ApplicationAutoScaling::ScalingPolicy
          Properties:
          ScalingTargetId: !Ref AutoScalerTarget
          ServiceNamespace: rds
          PolicyName: Example
          PolicyType: TargetTrackingScaling
          ScalableDimension: rds:cluster:ReadReplicaCount
          TargetTrackingScalingPolicyConfiguration:
          PredefinedMetricSpecification:
          PredefinedMetricType: RDSReaderAverageCPUUtilization
          TargetValue: 50.0
          ScaleOutCooldown: 300
          ScaleInCooldown: 300
          DisableScaleIn: False


          Also, take a look at aurora serverless.






          share|improve this answer





















          • This will do the job. Thanks! :)
            – Praneeth Peiris
            Nov 22 at 16:48










          • How do you configure the instance type in this setup (like db.t2.small) ?
            – Christophe Blin
            yesterday










          • In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
            – Christophe Blin
            17 hours ago











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323469%2fdefining-autoscaling-for-aurora-db-cluster-in-cloudformation-template%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote



          accepted










          You'll need to use the Application Autoscaling service. Below is an example CFN script but note that I haven't created any instances - only the cluster and the scaling policy.



          AWSTemplateFormatVersion: 2010-09-09
          Resources:
          MyDatabase:
          Type: AWS::RDS::DBCluster
          Properties:
          Engine: aurora
          EngineVersion: 5.6.10a
          MasterUsername: example
          MasterUserPassword: examplepassword

          AutoScalerTarget:
          Type: AWS::ApplicationAutoScaling::ScalableTarget
          Properties:
          MinCapacity: 1
          MaxCapacity: 8
          ResourceId: !Sub "cluster:${MyDatabase}"
          ScalableDimension: rds:cluster:ReadReplicaCount
          ServiceNamespace: rds
          RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster"

          AutoScaler:
          Type: AWS::ApplicationAutoScaling::ScalingPolicy
          Properties:
          ScalingTargetId: !Ref AutoScalerTarget
          ServiceNamespace: rds
          PolicyName: Example
          PolicyType: TargetTrackingScaling
          ScalableDimension: rds:cluster:ReadReplicaCount
          TargetTrackingScalingPolicyConfiguration:
          PredefinedMetricSpecification:
          PredefinedMetricType: RDSReaderAverageCPUUtilization
          TargetValue: 50.0
          ScaleOutCooldown: 300
          ScaleInCooldown: 300
          DisableScaleIn: False


          Also, take a look at aurora serverless.






          share|improve this answer





















          • This will do the job. Thanks! :)
            – Praneeth Peiris
            Nov 22 at 16:48










          • How do you configure the instance type in this setup (like db.t2.small) ?
            – Christophe Blin
            yesterday










          • In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
            – Christophe Blin
            17 hours ago















          up vote
          3
          down vote



          accepted










          You'll need to use the Application Autoscaling service. Below is an example CFN script but note that I haven't created any instances - only the cluster and the scaling policy.



          AWSTemplateFormatVersion: 2010-09-09
          Resources:
          MyDatabase:
          Type: AWS::RDS::DBCluster
          Properties:
          Engine: aurora
          EngineVersion: 5.6.10a
          MasterUsername: example
          MasterUserPassword: examplepassword

          AutoScalerTarget:
          Type: AWS::ApplicationAutoScaling::ScalableTarget
          Properties:
          MinCapacity: 1
          MaxCapacity: 8
          ResourceId: !Sub "cluster:${MyDatabase}"
          ScalableDimension: rds:cluster:ReadReplicaCount
          ServiceNamespace: rds
          RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster"

          AutoScaler:
          Type: AWS::ApplicationAutoScaling::ScalingPolicy
          Properties:
          ScalingTargetId: !Ref AutoScalerTarget
          ServiceNamespace: rds
          PolicyName: Example
          PolicyType: TargetTrackingScaling
          ScalableDimension: rds:cluster:ReadReplicaCount
          TargetTrackingScalingPolicyConfiguration:
          PredefinedMetricSpecification:
          PredefinedMetricType: RDSReaderAverageCPUUtilization
          TargetValue: 50.0
          ScaleOutCooldown: 300
          ScaleInCooldown: 300
          DisableScaleIn: False


          Also, take a look at aurora serverless.






          share|improve this answer





















          • This will do the job. Thanks! :)
            – Praneeth Peiris
            Nov 22 at 16:48










          • How do you configure the instance type in this setup (like db.t2.small) ?
            – Christophe Blin
            yesterday










          • In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
            – Christophe Blin
            17 hours ago













          up vote
          3
          down vote



          accepted







          up vote
          3
          down vote



          accepted






          You'll need to use the Application Autoscaling service. Below is an example CFN script but note that I haven't created any instances - only the cluster and the scaling policy.



          AWSTemplateFormatVersion: 2010-09-09
          Resources:
          MyDatabase:
          Type: AWS::RDS::DBCluster
          Properties:
          Engine: aurora
          EngineVersion: 5.6.10a
          MasterUsername: example
          MasterUserPassword: examplepassword

          AutoScalerTarget:
          Type: AWS::ApplicationAutoScaling::ScalableTarget
          Properties:
          MinCapacity: 1
          MaxCapacity: 8
          ResourceId: !Sub "cluster:${MyDatabase}"
          ScalableDimension: rds:cluster:ReadReplicaCount
          ServiceNamespace: rds
          RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster"

          AutoScaler:
          Type: AWS::ApplicationAutoScaling::ScalingPolicy
          Properties:
          ScalingTargetId: !Ref AutoScalerTarget
          ServiceNamespace: rds
          PolicyName: Example
          PolicyType: TargetTrackingScaling
          ScalableDimension: rds:cluster:ReadReplicaCount
          TargetTrackingScalingPolicyConfiguration:
          PredefinedMetricSpecification:
          PredefinedMetricType: RDSReaderAverageCPUUtilization
          TargetValue: 50.0
          ScaleOutCooldown: 300
          ScaleInCooldown: 300
          DisableScaleIn: False


          Also, take a look at aurora serverless.






          share|improve this answer












          You'll need to use the Application Autoscaling service. Below is an example CFN script but note that I haven't created any instances - only the cluster and the scaling policy.



          AWSTemplateFormatVersion: 2010-09-09
          Resources:
          MyDatabase:
          Type: AWS::RDS::DBCluster
          Properties:
          Engine: aurora
          EngineVersion: 5.6.10a
          MasterUsername: example
          MasterUserPassword: examplepassword

          AutoScalerTarget:
          Type: AWS::ApplicationAutoScaling::ScalableTarget
          Properties:
          MinCapacity: 1
          MaxCapacity: 8
          ResourceId: !Sub "cluster:${MyDatabase}"
          ScalableDimension: rds:cluster:ReadReplicaCount
          ServiceNamespace: rds
          RoleARN: !Sub "arn:aws:iam::${AWS::AccountId}:role/aws-service-role/rds.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_RDSCluster"

          AutoScaler:
          Type: AWS::ApplicationAutoScaling::ScalingPolicy
          Properties:
          ScalingTargetId: !Ref AutoScalerTarget
          ServiceNamespace: rds
          PolicyName: Example
          PolicyType: TargetTrackingScaling
          ScalableDimension: rds:cluster:ReadReplicaCount
          TargetTrackingScalingPolicyConfiguration:
          PredefinedMetricSpecification:
          PredefinedMetricType: RDSReaderAverageCPUUtilization
          TargetValue: 50.0
          ScaleOutCooldown: 300
          ScaleInCooldown: 300
          DisableScaleIn: False


          Also, take a look at aurora serverless.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 at 18:44









          Randall Hunt

          6,86442334




          6,86442334












          • This will do the job. Thanks! :)
            – Praneeth Peiris
            Nov 22 at 16:48










          • How do you configure the instance type in this setup (like db.t2.small) ?
            – Christophe Blin
            yesterday










          • In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
            – Christophe Blin
            17 hours ago


















          • This will do the job. Thanks! :)
            – Praneeth Peiris
            Nov 22 at 16:48










          • How do you configure the instance type in this setup (like db.t2.small) ?
            – Christophe Blin
            yesterday










          • In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
            – Christophe Blin
            17 hours ago
















          This will do the job. Thanks! :)
          – Praneeth Peiris
          Nov 22 at 16:48




          This will do the job. Thanks! :)
          – Praneeth Peiris
          Nov 22 at 16:48












          How do you configure the instance type in this setup (like db.t2.small) ?
          – Christophe Blin
          yesterday




          How do you configure the instance type in this setup (like db.t2.small) ?
          – Christophe Blin
          yesterday












          In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
          – Christophe Blin
          17 hours ago




          In fact, this approach does not seem to work anymore. As the docs says : "Before you can use Aurora Auto Scaling with an Aurora DB cluster, you must first create an Aurora DB cluster with a primary instance and at least one Aurora Replica."
          – Christophe Blin
          17 hours ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323469%2fdefining-autoscaling-for-aurora-db-cluster-in-cloudformation-template%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Can I use Tabulator js library in my java Spring + Thymeleaf project?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents