-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
79 lines (64 loc) · 1.91 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
terraform {
backend "s3" {
bucket = "ricardomarq-hobby-terraform-state"
encrypt = true
key = "terraform.tfstate"
region = "eu-west-2"
profile = "hobby-projects"
}
}
module "global" {
source = "./global"
account_id = var.account_id
availability_zone = var.availability_zone
region = var.region
ecs_key_pair_name = var.ecs_key_pair_name
container_definitions = [
module.nginx.container_definition,
module.personal-website.container_definition,
module.sotd.container_definition
]
secrets_arns = concat(
module.nginx.secrets_arns,
module.personal-website.secrets_arns,
module.sotd.secrets_arns
)
static_website_files = {
"${module.solar.target_name}" = {
build_path = module.solar.build_path
files = module.solar.static_files
},
"${module.webasm.target_name}" = {
build_path = module.webasm.build_path
files = module.webasm.static_files
}
}
}
module "nginx" {
source = "./nginx/aws"
region = var.region
}
# Below are my app modules. If you use different apps they should be defined here instead.
module "personal-website" {
source = "git@github.com:rjmarques/personal-website//terraform/aws"
region = var.region
recaptcha_secret = var.recaptcha_secret
smtp_host = var.smtp_host
smtp_user = var.smtp_user
smtp_password = var.smtp_password
contact_email = var.contact_email
}
module "sotd" {
source = "git@github.com:rjmarques/something-of-the-day//terraform/aws"
region = var.region
twitter_client_id = var.twitter_client_id
twitter_client_secret = var.twitter_client_secret
postgres_url = var.postgres_url
}
# These modules are static websites that need to be uploaded to S3
module "solar" {
source = "git@github.com:rjmarques/SolarSystem"
}
module "webasm" {
source = "git@github.com:rjmarques/webasm-mandelbrot"
}