File tree Expand file tree Collapse file tree 9 files changed +37
-111
lines changed
infrastructure/applications Expand file tree Collapse file tree 9 files changed +37
-111
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ module "pycon_backend" {
2222 iam_role_arn = module. cluster . iam_role_arn
2323 database_settings = module. database . database_settings
2424 vpc_id = module. vpc . vpc_id
25+ public_1a_subnet_id = module. vpc . public_1a_subnet_id
26+ configuration_set_name = module. emails . configuration_set_name
2527
2628 providers = {
27- aws = aws
2829 aws.us = aws.us
2930 }
3031}
@@ -36,22 +37,12 @@ module "pycon_frontend" {
3637 server_ip = module. cluster . server_ip
3738 cf_domain_name = module. cluster . cf_domain_name
3839 cf_hosted_zone_id = module. cluster . cf_hosted_zone_id
39-
40- providers = {
41- aws = aws
42- aws.us = aws.us
43- }
4440}
4541
4642module "clamav" {
4743 source = " ./clamav"
4844 cluster_id = module. cluster . cluster_id
4945 logs_group_name = module. cluster . logs_group_name
50-
51- providers = {
52- aws = aws
53- aws.us = aws.us
54- }
5546}
5647
5748# Other resources
@@ -66,7 +57,6 @@ module "emails" {
6657 source = " ./emails"
6758
6859 providers = {
69- aws = aws
7060 aws.us = aws.us
7161 }
7262}
@@ -77,7 +67,6 @@ module "cluster" {
7767 public_1a_subnet_id = module. vpc . public_1a_subnet_id
7868
7969 providers = {
80- aws = aws
8170 aws.us = aws.us
8271 }
8372}
Original file line number Diff line number Diff line change 1+ terraform {
2+ required_providers {
3+ aws = {
4+ source = " hashicorp/aws"
5+ configuration_aliases = [aws.us]
6+ }
7+ }
8+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ terraform {
22 required_providers {
33 aws = {
44 source = " hashicorp/aws"
5- version = " 5.70.0 "
5+ version = " 5.82.2 "
66 configuration_aliases = [aws.us]
77 }
88 }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ resource "aws_sesv2_configuration_set" "main" {
77
88 tracking_options {
99 custom_redirect_domain = local. email_tracking_domain
10+ https_policy = " OPTIONAL"
1011 }
1112}
1213
@@ -33,3 +34,7 @@ resource "aws_sesv2_configuration_set_event_destination" "backend" {
3334 ]
3435 }
3536}
37+
38+ output "configuration_set_name" {
39+ value = aws_sesv2_configuration_set. main . configuration_set_name
40+ }
Original file line number Diff line number Diff line change @@ -6,38 +6,8 @@ locals {
66 cdn_url = local. is_prod ? " cdn.pycon.it" : " ${ terraform . workspace } -cdn.pycon.it"
77}
88
9- data "aws_vpc" "default" {
10- filter {
11- name = " tag:Name"
12- values = [" pythonit-vpc" ]
13- }
14- }
15-
16- data "aws_subnets" "private" {
17- filter {
18- name = " vpc-id"
19- values = [data . aws_vpc . default . id ]
20- }
21-
22- tags = {
23- Type = " private"
24- }
25- }
26-
27- data "aws_security_group" "rds" {
28- name = " pythonit-rds-security-group"
29- }
30-
31- data "aws_security_group" "lambda" {
32- name = " pythonit-lambda-security-group"
33- }
34-
359data "aws_acm_certificate" "cert" {
3610 domain = " pycon.it"
3711 statuses = [" ISSUED" ]
3812 provider = aws. us
3913}
40-
41- data "aws_sesv2_configuration_set" "main" {
42- configuration_set_name = " pythonit-${ terraform . workspace } "
43- }
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ variable "logs_group_name" {}
1111variable "iam_role_arn" {}
1212variable "database_settings" {}
1313variable "vpc_id" {}
14+ variable "public_1a_subnet_id" {}
15+ variable "configuration_set_name" {}
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ locals {
171171 {
172172 name = " ECS_NETWORK_CONFIG" ,
173173 value = jsonencode ({
174- subnets = [data.aws_subnet.public_1a.id ],
174+ subnets = [var.public_1a_subnet_id ],
175175 security_groups = [
176176 var.security_group_id
177177 ],
@@ -183,7 +183,7 @@ locals {
183183 },
184184 {
185185 name = " AWS_SES_CONFIGURATION_SET"
186- value = data.aws_sesv2_configuration_set.main .configuration_set_name
186+ value = var .configuration_set_name
187187 },
188188 {
189189 name = " SNS_WEBHOOK_SECRET" ,
@@ -209,34 +209,6 @@ resource "aws_iam_role" "ecs_service" {
209209 })
210210}
211211
212- data "aws_subnet" "private_1a" {
213- vpc_id = data. aws_vpc . default . id
214-
215- filter {
216- name = " tag:Type"
217- values = [" private" ]
218- }
219-
220- filter {
221- name = " tag:AZ"
222- values = [" eu-central-1a" ]
223- }
224- }
225-
226- data "aws_subnet" "public_1a" {
227- vpc_id = data. aws_vpc . default . id
228-
229- filter {
230- name = " tag:Type"
231- values = [" public" ]
232- }
233-
234- filter {
235- name = " tag:AZ"
236- values = [" eu-central-1a" ]
237- }
238- }
239-
240212resource "aws_ecs_task_definition" "worker" {
241213 family = " pythonit-${ terraform . workspace } -worker"
242214
You can’t perform that action at this time.
0 commit comments