-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
47 lines (36 loc) · 1.8 KB
/
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
38
39
40
41
42
43
44
45
46
47
module "s3_bucket" {
source = "./modules/s3_bucket"
name_prefix = "${var.identifier}"
acl = "${var.acl}"
policy = "${var.policy}"
force_destroy = "${var.force_destroy}"
versioning = "${var.versioning}"
logging = "${var.logging}"
region = "${var.region}"
replication_configuration = "${var.replication_configuration}"
server_side_encryption_configuration = "${var.server_side_encryption_configuration}"
create_backend_policy = "${var.create_backend_policy}"
principal = "${var.principal}"
tags = "${var.tags}"
}
module "dynamodb_table" {
source = "./modules/dynamodb_table"
create = "${var.create_dynamodb_table}"
name_prefix = "${var.identifier}"
hash_key = "${var.hash_key}"
write_capacity = "${var.write_capacity}"
read_capacity = "${var.read_capacity}"
attribute = "${var.attribute}"
server_side_encryption = "${var.server_side_encryption}"
point_in_time_recovery = "${var.point_in_time_recovery}"
tags = "${var.tags}"
}
resource "null_resource" "this" {
triggers = {
s3_backend = "${module.s3_bucket.this_s3_bucket_arn}"
dynamodb_backend = "${module.dynamodb_table.this_dynamodb_table_arn}"
}
provisioner "local-exec" {
command = "${path.module}/terraform-backend-deployment.sh ${var.identifier} ${path.module}/state"
}
}