Skip to content

Commit 7d24a20

Browse files
authored
Merge pull request #17 from buildrun-tech/diario/dia-23
Diario/dia 23
2 parents 9c78767 + 6df066e commit 7d24a20

File tree

11 files changed

+682
-258
lines changed

11 files changed

+682
-258
lines changed

.$solution.drawio.dtmp

Lines changed: 670 additions & 0 deletions
Large diffs are not rendered by default.

solution.drawio

Lines changed: 5 additions & 19 deletions
Large diffs are not rendered by default.

terraform/environments/dev.tfvars

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,14 @@
22

33
# Core Configuration
44
environment = "dev"
5-
aws_region = "us-east-1"
5+
aws_region = "us-east-2"
66

77
# Networking Configuration (using existing VPC)
88
# Replace these with your actual VPC and subnet IDs
9-
vpc_id = "vpc-xxxxxxxxx" # Replace with your VPC ID
10-
public_subnet_ids = [
11-
"subnet-xxxxxxxxx", # Replace with your public subnet IDs
12-
"subnet-yyyyyyyyy"
13-
]
14-
private_subnet_ids = [
15-
"subnet-zzzzzzzzz", # Replace with your private subnet IDs
16-
"subnet-aaaaaaaaa"
17-
]
9+
vpc_id = "vpc-088d5d306dd51edda" # Replace with your VPC ID
1810

1911
# ECR Configuration
20-
ecr_repository_name = "ticketmaster-app"
21-
ecr_image_tag_mutability = "MUTABLE"
12+
ecr_repository_url = "311141562939.dkr.ecr.us-east-2.amazonaws.com/ticketmaster-dev"
2213

2314
# ECS Configuration
2415
ecs_cluster_name = "ticketmaster-dev-cluster"

terraform/main.tf

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,6 @@ module "networking" {
6262
db_port = var.db_port
6363
}
6464

65-
# ECR Module
66-
# module "ecr" {
67-
# source = "./modules/ecr"
68-
69-
# name_prefix = local.name_prefix
70-
# common_tags = local.common_tags
71-
# repository_name = var.ecr_repository_name
72-
# image_tag_mutability = var.ecr_image_tag_mutability
73-
# lifecycle_policy = var.ecr_lifecycle_policy
74-
# aws_account_id = data.aws_caller_identity.current.account_id
75-
# }
7665

7766
# RDS Module
7867
module "rds" {
@@ -113,7 +102,7 @@ module "ecs" {
113102
task_memory = var.ecs_task_memory
114103
desired_count = var.ecs_desired_count
115104
container_port = var.container_port
116-
ecr_repository_url = module.ecr.repository_url
105+
ecr_repository_url = var.ecr_repository_url
117106
db_endpoint = module.rds.endpoint
118107
db_name = var.db_name
119108
db_username = var.db_username

terraform/modules/ecr/main.tf

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

terraform/modules/ecr/outputs.tf

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

terraform/modules/ecr/variables.tf

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

terraform/modules/networking/main.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,6 @@ data "aws_vpc" "existing" {
55
id = var.vpc_id
66
}
77

8-
data "aws_subnets" "public" {
9-
filter {
10-
name = "vpc-id"
11-
values = [var.vpc_id]
12-
}
13-
14-
filter {
15-
name = "subnet-id"
16-
values = var.public_subnet_ids
17-
}
18-
}
19-
20-
data "aws_subnets" "private" {
21-
filter {
22-
name = "vpc-id"
23-
values = [var.vpc_id]
24-
}
25-
26-
filter {
27-
name = "subnet-id"
28-
values = var.private_subnet_ids
29-
}
30-
}
31-
328
# Security Group for Application Load Balancer
339
resource "aws_security_group" "alb" {
3410
name_prefix = "${var.name_prefix}-alb-"

terraform/modules/networking/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ variable "vpc_id" {
1616
type = string
1717
}
1818

19-
variable "public_subnet_ids" {
20-
description = "List of existing public subnet IDs"
21-
type = list(string)
22-
}
23-
24-
variable "private_subnet_ids" {
25-
description = "List of existing private subnet IDs"
26-
type = list(string)
27-
}
28-
2919
variable "allowed_cidr_blocks" {
3020
description = "CIDR blocks allowed to access the load balancer"
3121
type = list(string)

terraform/variables.tf

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,58 +23,12 @@ variable "aws_region" {
2323
}
2424

2525
# ECR Configuration
26-
variable "ecr_repository_name" {
27-
description = "Name of the ECR repository"
26+
variable "ecr_repository_url" {
27+
description = "URL of the ECR repository"
2828
type = string
2929
default = "ticketmaster-app"
3030
}
3131

32-
variable "ecr_image_tag_mutability" {
33-
description = "Image tag mutability setting for ECR repository"
34-
type = string
35-
default = "MUTABLE"
36-
validation {
37-
condition = contains(["MUTABLE", "IMMUTABLE"], var.ecr_image_tag_mutability)
38-
error_message = "ECR image tag mutability must be either 'MUTABLE' or 'IMMUTABLE'."
39-
}
40-
}
41-
42-
variable "ecr_lifecycle_policy" {
43-
description = "Lifecycle policy for ECR repository"
44-
type = string
45-
default = <<EOF
46-
{
47-
"rules": [
48-
{
49-
"rulePriority": 1,
50-
"description": "Keep last 10 images",
51-
"selection": {
52-
"tagStatus": "tagged",
53-
"countType": "imageCountMoreThan",
54-
"countNumber": 10
55-
},
56-
"action": {
57-
"type": "expire"
58-
}
59-
},
60-
{
61-
"rulePriority": 2,
62-
"description": "Delete untagged images older than 1 day",
63-
"selection": {
64-
"tagStatus": "untagged",
65-
"countType": "sinceImagePushed",
66-
"countUnit": "days",
67-
"countNumber": 1
68-
},
69-
"action": {
70-
"type": "expire"
71-
}
72-
}
73-
]
74-
}
75-
EOF
76-
}
77-
7832
# ECS Configuration
7933
variable "ecs_cluster_name" {
8034
description = "Name of the ECS cluster"

0 commit comments

Comments
 (0)