37 lines
752 B
HCL
37 lines
752 B
HCL
resource "aws_dynamodb_table" "terraform_locks" {
|
|
name = "${var.bucket_name}-locks"
|
|
billing_mode = "PAY_PER_REQUEST"
|
|
hash_key = "LockID"
|
|
attribute {
|
|
name = "LockID"
|
|
type = "S"
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket" "terraform_state" {
|
|
bucket = var.bucket_name
|
|
|
|
# lifecycle {
|
|
# prevent_destroy = true
|
|
# }
|
|
|
|
force_destroy = true
|
|
}
|
|
|
|
resource "aws_s3_bucket_versioning" "terraform_state" {
|
|
bucket = aws_s3_bucket.terraform_state.id
|
|
versioning_configuration {
|
|
status = "Enabled"
|
|
}
|
|
}
|
|
|
|
resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state" {
|
|
bucket = aws_s3_bucket.terraform_state.bucket
|
|
|
|
rule {
|
|
apply_server_side_encryption_by_default {
|
|
sse_algorithm = "AES256"
|
|
}
|
|
}
|
|
}
|