Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify configuration of DynamoDB Global Table Autoscaling #13208

Closed
GREsau opened this issue May 7, 2020 · 2 comments
Closed

Simplify configuration of DynamoDB Global Table Autoscaling #13208

GREsau opened this issue May 7, 2020 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/dynamodb Issues and PRs that pertain to the dynamodb service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@GREsau
Copy link

GREsau commented May 7, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Thanks to #12342, it's now extremely easy to manage DynamoDB Global Tables through terraform. However, it gets much more complicated when you want to enable autoscaling on these tables. Currently, you need to specify an aws_appautoscaling_policy and an aws_appautoscaling_target for each table and index for each replica. Because each replica will be in a different region, you'll also need to do this using multiple AWS providers, which can be difficult due to terraform restrictions on dynamically configuring providers/aliases.

Fortunately, DynamoDB surfaces some APIs (DescribeTableReplicaAutoScaling + UpdateTableReplicaAutoScaling) that allow configuring a table's autoscaling across all replicas/regions at once. If a terraform resource used that API, it would make autoscaling configuration much easier.

New or Affected Resource(s)

  • new resource e.g. aws_dynamodb_table_replica_autoscaling

Potential Terraform Configuration

resource "aws_dynamodb_table_replica_autoscaling" "dynamodb-autoscaling" {
  table_name = "GameScores"
  
  write_capacity {
    policy_name = "optional autoscaling policy name"
    role_arn    = "optional autoscaling policy role ARN"

    min_units = 10
    max_units = 100

    target_value       = 50
    disable_scale_in   = false
    scale_in_cooldown  = 60
    scale_out_cooldown = 60
  }
  
  # this block can be specified multiple times for tables with multiple GSIs
  global_secondary_index {
    index_name = "GameTitleIndex"

    write_capacity {
      # same format as earlier write_capacity block...
    }
  }

  replica {
    region_name = "us-west-2"

    read_capacity {
      # same format as earlier write_capacity blocks...
    }

    global_secondary_index {
      index_name = "GameTitleIndex"

      read_capacity {
        # same format as earlier read_capacity/write_capacity blocks...
      }
    }
  }

  replica {
    region_name = "us-east-2"

    # etc...
  }
}

References

@GREsau GREsau added the enhancement Requests to existing resources that expand the functionality or scope. label May 7, 2020
@ghost ghost added the service/dynamodb Issues and PRs that pertain to the dynamodb service. label May 7, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 7, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 21, 2021
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Jun 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2024
Copy link

github-actions bot commented Sep 4, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/dynamodb Issues and PRs that pertain to the dynamodb service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants