generated from terraform-module/terraform-module-blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
148 lines (123 loc) · 3.29 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
module "ecrs" {
source = "terraform-module/ecr/aws"
ecrs = {
api = {
tags = { Service = "api" }
lifecycle_policy = {
rules = [{
rulePriority = 1
description = "keep last 50 images"
action = {
type = "expire"
}
selection = {
tagStatus = "any"
countType = "imageCountMoreThan"
countNumber = 50
}
}]
}
}
}
}
module "ecs" {
source = "terraform-module/ecs/aws"
version = "1.0.2"
name = "example"
capacity_providers = ["FARGATE_SPOT"]
default_capacity_provider_strategy = [
{
capacity_provider = "FARGATE_SPOT"
}
]
tags = merge({ module = "terraform-module/ecs/aws" })
}
module "enforce-mfa" {
source = "terraform-module/enforce-mfa/aws"
}
module "ecs-bootstrap" {
source = "terraform-module/ecs-bootstrap/aws"
name = "example"
cluster_id = "4f901e4f4ef0"
cluster_name = "dev-cluster"
name_prefix = "ext-"
vpc_id = "vpc-323eb3a0"
subnets = ["sbu-2345k8c"]
lb = {
create = "true"
port = "80"
health_check = {
path = "/healthz"
}
listener_arn = "arn:aws:elasticloadbalancing:eu-west-1:033338980111:listener/app/k8s-internal"
priority = 1
lb_rules = {
host_headers = ["www", "api", "auth", "admin"]
}
}
}
module "ecs-instance-profile" {
source = "terraform-module/ecs-instance-profile/aws"
# insert the 1 required variable here
name = "example"
}
module "lambda" {
source = "terraform-module/lambda/aws"
function_name = "example"
handler = "index.handler"
memory_size = "128"
filename = "lambda.zip"
description = "example"
role_arn = "arn:aws:lambda:us-east-1:123456789012:function:example_lambda"
runtime = "python10"
concurrency = 1
}
module "gitlab-oidc-provider" {
source = "terraform-module/gitlab-oidc-provider/aws"
}
module "github-oidc-provider" {
source = "terraform-module/github-oidc-provider/aws"
}
module "acm" {
source = "terraform-module/acm/aws"
}
module "dns" {
source = "terraform-module/dns/aws"
# insert the 3 required variables here
subdomain = ""
parent_dns_zone_name = ""
parent_dns_zone_id = "42d37a58-f7ad-11ed-a94d-b71410c04d86"
}
module "kms" {
source = "terraform-module/kms/aws"
alias_name = "parameter_store_key"
description = "Key to encrypt and decrypt secrets"
tags = tomap({ "used_by" = "chamber", "created_by" = "terraform" })
}
# HElm provider. Not a great idea to use it. Helm is way better
module "helm-release" {
source = "terraform-module/release/helm"
# insert the 3 required variables here
repository = "https://github.com/terraform-module/docs"
app = {
name = "nginx"
version = "2.2.0"
chart = "nginx"
force_update = true
wait = false
recreate_pods = false
deploy = 1
}
namespace = "default"
}
module "velero" {
source = "terraform-module/velero/kubernetes"
# insert the 5 required variables here
cluster_name = "dev-cluster"
openid_connect_provider_uri = "openid-configuration"
bucket = "backup-s3"
values = [<<EOF
# https://github.com/terraform-module/terraform-kubernetes-velero
EOF
]
}