-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
82 lines (64 loc) · 2.11 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.20.0"
}
}
}
provider "aws" {
region = var.aws_region
}
locals {
project_name = "saturn5"
}
module "bucket_oai" {
source = "./modules/s3/buckets/oai"
project_name = local.project_name
}
module "bucket_oac" {
source = "./modules/s3/buckets/oac"
project_name = local.project_name
}
module "bucket_presigned_url" {
source = "./modules/s3/buckets/presignedurl"
project_name = local.project_name
}
module "bucket_enforcetls" {
source = "./modules/s3/buckets/enforcetls"
}
module "acm" {
source = "./modules/acm"
domain_name = var.certificate_domain
}
module "cloudfront" {
source = "./modules/cloudfront"
project_name = local.project_name
price_class = var.cloudfront_price_class
oai_bucket_regional_domain_name = module.bucket_oai.bucket_regional_domain_name
oac_bucket_regional_domain_name = module.bucket_oac.bucket_regional_domain_name
signed_vouchers_bucket_regional_domain_name = module.bucket_presigned_url.bucket_regional_domain_name
enforce_tls_bucket_regional_domain_name = module.bucket_enforcetls.bucket_regional_domain_name
acm_arn = module.acm.acm_arn
domain_name = var.certificate_domain
minimum_protocol_version = var.cloudfront_minimum_protocol_version
}
module "s3_permissions" {
source = "./modules/s3/permissions"
# OAI
oai_bucket_id = module.bucket_oai.bucket_id
oai_bucket_arn = module.bucket_oai.bucket_arn
cloudfront_oai_iam_arn = module.cloudfront.oai_iam_arn
# OAC
cloudfront_distribution_arn = module.cloudfront.distribution_arn
# OAC bucket
kms_key_arn = module.bucket_oac.kms_key_arn
oac_bucket_id = module.bucket_oac.bucket_id
oac_bucket_arn = module.bucket_oac.bucket_arn
# Signed URLs bucket
signedurls_bucket_id = module.bucket_presigned_url.bucket_id
signedurls_bucket_arn = module.bucket_presigned_url.bucket_arn
# Enforce TLS
enforce_tls_bucket_id = module.bucket_enforcetls.bucket_id
enforce_tls_bucket_arn = module.bucket_enforcetls.bucket_arn
}