Skip to content

Commit bee845d

Browse files
Fix TFsec
1 parent 5d09295 commit bee845d

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

infrastructure/terraform/components/acct/iam_role_apigateway_logging.tf

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,7 @@ data "aws_iam_policy_document" "apigateway_assumerole" {
2323
}
2424
}
2525

26-
resource "aws_iam_role_policy" "apigateway_logging" {
27-
role = aws_iam_role.apigateway_logging.name
28-
name = "${local.csi}-logging"
29-
policy = data.aws_iam_policy_document.apigateway_logging.json
26+
resource "aws_iam_role_policy_attachment" "apigateway_logging" {
27+
role = aws_iam_role.apigateway_logging.name
28+
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs"
3029
}
31-
32-
data "aws_iam_policy_document" "apigateway_logging" {
33-
statement {
34-
sid = "AllowLogs"
35-
effect = "Allow"
36-
37-
actions = [
38-
"logs:CreateLogGroup",
39-
"logs:CreateLogStream",
40-
"logs:DescribeLogGroups",
41-
"logs:DescribeLogStreams",
42-
"logs:PutLogEvents",
43-
"logs:GetLogEvents",
44-
"logs:FilterLogEvents",
45-
]
46-
47-
resources = ["*"]
48-
}
49-
}
50-

0 commit comments

Comments
 (0)