Skip to content

Commit

Permalink
Address SonarCloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronaldo Macapobre committed Nov 15, 2024
1 parent 3deed24 commit 51dc948
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 2 additions & 3 deletions infrastructure/cloud/modules/APIGateway/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ resource "aws_api_gateway_rest_api_policy" "apigw_rest_api_policy" {
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
#Principal = var.ecs_execution_role_arn
Principal = "*"
Effect = "Allow"
Principal = var.ecs_execution_role_arn
Action = "execute-api:Invoke"
Resource = "arn:aws:execute-api:${var.region}:${var.account_id}:${aws_api_gateway_rest_api.apigw.id}/*"
}
Expand Down
9 changes: 7 additions & 2 deletions infrastructure/cloud/modules/IAM/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@ resource "aws_iam_policy" "lambda_role_policy" {
"ecs:DescribeServices",
"ecs:ListServices"
],
"Resource" : "*"
"Resource" : [
"arn:aws:ecs:*:*:cluster/${var.app_name}-app-cluster-${var.environment}",
"arn:aws:ecs:*:*:service/${var.app_name}-app-cluster-${var.environment}/${var.app_name}-*-ecs-service-${var.environment}"
]
},
{
"Effect" : "Allow",
Expand All @@ -299,7 +302,9 @@ resource "aws_iam_policy" "lambda_role_policy" {
"ecr:BatchGetImage",
"ecr:BatchCheckLayerAvailability"
],
"Resource" : "*"
"Resource" : [
"arn:aws:ecr:*:*:repository/${var.app_name}-*-repo-${var.environment}"
]
}
]
})
Expand Down

0 comments on commit 51dc948

Please sign in to comment.