Skip to content

Commit f40d0da

Browse files
committed
cleanup
1 parent ce26a4a commit f40d0da

File tree

9 files changed

+37
-111
lines changed

9 files changed

+37
-111
lines changed

infrastructure/applications/.terraform.lock.hcl

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infrastructure/applications/applications.tf

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff 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

4642
module "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
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
configuration_aliases = [aws.us]
6+
}
7+
}
8+
}

infrastructure/applications/cluster/vpc.tf

Lines changed: 0 additions & 20 deletions
This file was deleted.

infrastructure/applications/config.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

infrastructure/applications/emails/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

infrastructure/applications/pycon_backend/main.tf

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff 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-
359
data "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-
}

infrastructure/applications/pycon_backend/variables.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ variable "logs_group_name" {}
1111
variable "iam_role_arn" {}
1212
variable "database_settings" {}
1313
variable "vpc_id" {}
14+
variable "public_1a_subnet_id" {}
15+
variable "configuration_set_name" {}

infrastructure/applications/pycon_backend/worker.tf

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff 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-
240212
resource "aws_ecs_task_definition" "worker" {
241213
family = "pythonit-${terraform.workspace}-worker"
242214

0 commit comments

Comments
 (0)