Skip to content

Commit

Permalink
backend troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbass committed Apr 4, 2024
1 parent 84e48dc commit 27dab0c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependency "vpc" {
mock_outputs_allowed_terraform_commands = ["init", "validate", "plan"]
mock_outputs = {
private_subnets = ["subnet-mocksubnet1234567"]
ecs_execution_role = "mockrolearn"
}
}

Expand Down Expand Up @@ -50,5 +51,6 @@ inputs = {
target_group_arn = dependency.backend-infra.outputs.target_group_arn
security_group = dependency.backend-infra.outputs.security_group_id
ecs_cluster = dependency.backend-infra.outputs.cluster_id
task_execution_role = dependency.vpc.outputs.ecs_execution_role
tags = local.tags
}
4 changes: 4 additions & 0 deletions tofu/modules/network/vpc/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,8 @@ output "secrets_endpoint_security_group" {

output "logs_endpoint_security_group" {
value = aws_security_group.logs_endpoint.id
}

output "ecs_execution_role" {
value = module.ecs_task_execution_role.iam_role_arn
}
2 changes: 1 addition & 1 deletion tofu/modules/services/backend-service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_ecs_service" "backend_service" {

resource "aws_ecs_task_definition" "backend" {
family = "appointment-definition"
execution_role_arn = "arn:aws:iam::768512802988:role/apointments-ci-role"
execution_role_arn = var.task_execution_role
network_mode = "awsvpc"
requires_compatibilities = ["FARGATE"]
cpu = "512"
Expand Down
5 changes: 5 additions & 0 deletions tofu/modules/services/backend-service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@ variable "security_group" {
variable "image" {
description = "Backend Docker image"
type = string
}

variable "task_execution_role" {
description = "ECS task execution role"
type = string
}

0 comments on commit 27dab0c

Please sign in to comment.