You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
790 B
HCL

provider "aws" {
region = "us-west-1"
}
terraform {
backend "s3" {
bucket = "ronnic-tfstate"
key = "global/state/terraform.tfstate"
region = "us-west-1"
dynamodb_table = "nr_tfstate_lock"
encrypt = true
}
}
module "aws_s3_bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
bucket = "ronnic-tfstate"
versioning = {
enabled = true
}
server_side_encryption_configuration = {
rule = {
apply_server_side_encryption_by_default = {
sse_algorithm = "AES256"
}
}
}
}
resource "aws_dynamodb_table" "terraform_locks" {
name = "nr_tfstate_lock"
billing_mode = "PAY_PER_REQUEST"
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
}