-
Notifications
You must be signed in to change notification settings - Fork 52
/
main.tf
37 lines (30 loc) · 875 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
provider "aws" {
region = "{{ .Config.Infrastructure.AWS.Region }}"
}
resource "aws_s3_bucket" "terraform_remote_state" {
bucket = "{{ .Config.Name }}-${var.environment}-terraform-state"
acl = "private"
versioning {
enabled = true
}
}
resource "aws_s3_bucket_public_access_block" "terraform_remote_state" {
bucket = aws_s3_bucket.terraform_remote_state.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
resource "aws_dynamodb_table" "terraform_state_locks" {
name = "{{ .Config.Name }}-${var.environment}-terraform-state-locks"
read_capacity = 2
write_capacity = 2
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
}
variable "environment" {
description = "The environment (development/staging/production)"
}