Skip to content

Commit 93b6d40

Browse files
committed
changes
1 parent 1ffc74a commit 93b6d40

File tree

18 files changed

+254
-227
lines changed

18 files changed

+254
-227
lines changed

backend/pdm.lock

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

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ dependencies = [
9494
"cryptography>=43.0.0",
9595
"openai>=1.52.0",
9696
"pydantic>=2.9.2",
97+
"gunicorn>=23.0.0",
9798
]
9899
name = "backend"
99100
version = "0.1.0"

infrastructure/applications/applications.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ module "pretix" {
1919
module "pycon_backend" {
2020
source = "./pycon_backend"
2121
ecs_arm_ami = local.ecs_arm_ami
22+
cluster_id = module.cluster.cluster_id
23+
service_connect_namespace = module.cluster.service_connect_namespace
24+
security_group_id = module.cluster.security_group_id
25+
server_ip = module.cluster.server_ip
2226

2327
providers = {
2428
aws = aws
@@ -43,6 +47,7 @@ module "emails" {
4347

4448
module "cluster" {
4549
source = "./cluster"
50+
ecs_arm_ami = local.ecs_arm_ami
4651

4752
providers = {
4853
aws = aws

infrastructure/applications/cluster/auto_scaling.tf

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

infrastructure/applications/cluster/launch_template.tf

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

infrastructure/applications/cluster/load_balancer.tf

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

infrastructure/applications/cluster/load_balancer_iam.tf

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

infrastructure/applications/cluster/load_balancer_security.tf

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

infrastructure/applications/cluster/task_traefik.tf renamed to infrastructure/applications/cluster/load_balancer_task.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
resource "aws_ecs_task_definition" "traefik" {
22
family = "pythonit-${terraform.workspace}-traefik"
3+
34
container_definitions = jsonencode([
45
{
56
name = "traefik"
@@ -81,9 +82,4 @@ resource "aws_ecs_service" "traefik" {
8182
capacity_provider_strategy
8283
]
8384
}
84-
85-
# placement_constraints {
86-
# type = "memberOf"
87-
# expression = "attribute:role == load_balancer"
88-
# }
8985
}

infrastructure/applications/cluster/main.tf

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,20 @@ resource "aws_ecs_cluster" "cluster" {
22
name = "pythonit-${terraform.workspace}"
33
}
44

5-
resource "aws_ecs_capacity_provider" "ec2" {
6-
name = "pythonit-${terraform.workspace}-ec2"
7-
8-
auto_scaling_group_provider {
9-
auto_scaling_group_arn = aws_autoscaling_group.server.arn
10-
managed_termination_protection = "ENABLED"
5+
output "cluster_id" {
6+
value = aws_ecs_cluster.cluster.id
7+
}
118

12-
managed_scaling {
13-
maximum_scaling_step_size = 2
14-
minimum_scaling_step_size = 1
15-
status = "ENABLED"
16-
target_capacity = 1
17-
instance_warmup_period = 60
18-
}
19-
}
9+
resource "aws_service_discovery_http_namespace" "cluster" {
10+
name = "pythonit-${terraform.workspace}"
11+
description = "pythonit-${terraform.workspace} service discovery namespace"
2012
}
2113

22-
resource "aws_ecs_cluster_capacity_providers" "server" {
23-
cluster_name = aws_ecs_cluster.cluster.name
24-
capacity_providers = [
25-
aws_ecs_capacity_provider.ec2.name,
26-
]
14+
output "service_connect_namespace" {
15+
value = aws_service_discovery_http_namespace.cluster.arn
16+
}
2717

28-
default_capacity_provider_strategy {
29-
base = 1
30-
weight = 100
31-
capacity_provider = aws_ecs_capacity_provider.ec2.name
32-
}
18+
resource "aws_ecs_account_setting_default" "trunking" {
19+
name = "awsvpcTrunking"
20+
value = "enabled"
3321
}

0 commit comments

Comments
 (0)