Skip to content

Commit 82bd9dd

Browse files
committed
feat: creates s3 and dynamodb table for state locking
1 parent ef2531a commit 82bd9dd

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module "dynamodb_tf_state_lock" {
2+
source = "./modules/dynamodb_table"
3+
name = var.dynamodb_table_name
4+
read_capacity = var.dynamodb_read_capacity
5+
write_capacity = var.dynamodb_write_capacity
6+
tags = var.dynamodb_table_tags
7+
}
8+
9+
module "tf_state_s3_bucket" {
10+
source = "./modules/s3"
11+
name = var.s3_bucket_name
12+
tags = var.s3_bucket_tags
13+
}

variables.tf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
variable "s3_bucket_name" {
2+
description = "Name of the bucket. If omitted, Terraform will assign a random, unique name."
3+
type = string
4+
}
5+
6+
variable "dynamodb_table_name" {
7+
description = "(Required) Unique Table name within a region name of the table"
8+
type = string
9+
}
10+
11+
variable "dynamodb_read_capacity" {
12+
description = "(Optional) Number of read units for this table."
13+
type = number
14+
default = 20
15+
}
16+
17+
variable "dynamodb_write_capacity" {
18+
description = "(Optional) Number of write units for this table."
19+
type = number
20+
default = 20
21+
}
22+
23+
variable "dynamodb_table_tags" {
24+
description = "(Optional) A map of tags to populate on the created table."
25+
type = map(string)
26+
default = {}
27+
}
28+
29+
variable "s3_bucket_tags" {
30+
description = "(Optional) Map of tags to assign to the bucket."
31+
type = map(string)
32+
default = {}
33+
}

versions.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
terraform {
2+
required_version = ">= 1.4.6"
3+
4+
required_providers {
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 4.65.0"
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)