Git Product home page Git Product logo

terraform-aws-dynamodb-autoscaling-1's Introduction

Release CI License Registry

terraform-aws-dynamodb-autoscaling

A Terraform module for enabling auto-scaling for a target DynamoDB table.

Note: It's important you ignore changes to "READ" and "WRITE" units on your source DynamoDB table resource to prevent Terraform removing the scaling actions.

Usage

To enable auto-scaling on a table simply create the table resource and apply the auto-scaling module to the output table - ensuring that you ignore write & read capacity settings!

resource "aws_dynamodb_table" "snowplow_kcl_table" {
  name           = "my-table-name"
  hash_key       = "leaseKey"
  write_capacity = 1
  read_capacity  = 1

  attribute {
    name = "leaseKey"
    type = "S"
  }

  lifecycle {
    ignore_changes = [write_capacity, read_capacity]
  }
}

module "table_autoscaling" {
  source  = "snowplow-devops/dynamodb-autoscaling/aws"

  table_name = aws_dynamodb_table.snowplow_kcl_table.id
}

Requirements

Name Version
terraform >= 0.15
aws >= 3.25.0

Providers

Name Version
aws >= 3.25.0

Modules

No modules.

Resources

Name Type
aws_appautoscaling_policy.read_policy resource
aws_appautoscaling_policy.write_policy resource
aws_appautoscaling_target.read_target resource
aws_appautoscaling_target.write_target resource

Inputs

Name Description Type Default Required
read_max_capacity The maximum READ capacity for the table number 50 no
read_min_capacity The minimum READ capacity for the table number 1 no
read_scale_in_cooldown The number of seconds before scaling IN can occur after a scaling action number 300 no
read_scale_out_cooldown The number of seconds before scaling OUT can occur after a scaling action number 30 no
read_target_value The target utilization percentage for the table number 85 no
table_name The name of the DynamoDB table to add auto-scaling to string n/a yes
write_max_capacity The maximum WRITE capacity for the table number 50 no
write_min_capacity The minimum WRITE capacity for the table number 1 no
write_scale_in_cooldown The number of seconds before scaling IN can occur after a scaling action number 300 no
write_scale_out_cooldown The number of seconds before scaling OUT can occur after a scaling action number 30 no
write_target_value The target utilization percentage for the table number 85 no

Outputs

Name Description
read_policy_arn ARN of the read policy
write_policy_arn ARN of the write policy

Copyright and license

The Terraform AWS DynamoDB AutoScaling project is Copyright 2021-2021 Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

terraform-aws-dynamodb-autoscaling-1's People

Contributors

jbeemster avatar jparavisini avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.