Skip to content

Commit b6adbdd

Browse files
committed
Reduce DyanmoDB capacity to 2 r/w per second
__Why__ The free tier is limited to 25 r/w per second. We breach that limit with 3 terraform projects each using 20. Furthermore, this is just for statelock and has minimal resource needs.
1 parent 6b322f7 commit b6adbdd

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

main.tf

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
provider "aws" {
33
version = "~> 2.0"
44
region = "us-west-2"
5-
alias = "usw2"
5+
alias = "usw2"
66
}
77

88
provider "aws" {
99
version = "~> 2.0"
1010
region = "eu-west-2"
11-
alias = "euw2"
11+
alias = "euw2"
1212
}
1313

1414
# Bucket initially created using AWS CLI
@@ -54,10 +54,10 @@ resource "aws_s3_bucket" "terraform-remote-state" {
5454

5555
# dynamodb table for locking the state file
5656
resource "aws_dynamodb_table" "terraform-state-lock" {
57-
name = "terraform-state-lock.${data.aws_caller_identity.current.account_id}-${var.region}"
58-
hash_key = "LockID"
59-
read_capacity = 20
60-
write_capacity = 20
57+
name = "terraform-state-lock.${data.aws_caller_identity.current.account_id}-${var.region}"
58+
hash_key = "LockID"
59+
read_capacity = 2
60+
write_capacity = 2
6161

6262
attribute {
6363
name = "LockID"
@@ -74,10 +74,10 @@ data "aws_caller_identity" "current" {}
7474
data "terraform_remote_state" "dynamodb-s3" {
7575
backend = "s3"
7676
config = {
77-
bucket = "ams-terraform-remote-state.${data.aws_caller_identity.current.account_id}-${var.region}"
77+
bucket = "ams-terraform-remote-state.${data.aws_caller_identity.current.account_id}-${var.region}"
7878
dynamodb_table = "terraform-state-lock"
79-
encrypt = true
80-
key = "terraform.tfstate"
81-
region = "${var.region}"
79+
encrypt = true
80+
key = "terraform.tfstate"
81+
region = "${var.region}"
8282
}
8383
}

0 commit comments

Comments
 (0)