Skip to content

Commit

Permalink
Added ECS Web Task ARN to policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronaldo Macapobre committed Jul 29, 2024
1 parent 1ca481b commit 4aca9a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 5 additions & 5 deletions infrastructure/cloud/environments/sandbox/webapp.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module "security" {
source = "../../modules/security"
environment = var.environment
app_name = var.app_name
kms_key_name = var.kms_key_name

source = "../../modules/security"
environment = var.environment
app_name = var.app_name
kms_key_name = var.kms_key_name
ecs_web_task_definition_arn = module.container.ecs_web_task_definition_arn
}

module "storage" {
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/cloud/modules/container/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
output "ecr_url" {
value = try(aws_ecr_repository.ecr_repository.repository_url, "")
}

output "ecs_web_task_definition_arn" {
value = aws_ecs_task_definition.ecs_web_task_definition.arn
}
1 change: 1 addition & 0 deletions infrastructure/cloud/modules/security/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ resource "aws_iam_role_policy" "ecs_web_task_execution_policy" {
"ecr:GetDownloadUrlForLayer",
"ecr:GetAuthorizationToken"
]
Resource = var.ecs_web_task_definition_arn
}
]
})
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/cloud/modules/security/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ variable "kms_key_name" {
description = "The name of the KMS key to create"
default = "jasper-kms-key"
}

variable "ecs_web_task_definition_arn" {
type = string
description = "The ECS Web Task Execution ARN"
}

0 comments on commit 4aca9a3

Please sign in to comment.