File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
infrastructure/terraform/components/acct Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ resource "aws_api_gateway_account" "global" {
2+ cloudwatch_role_arn = aws_iam_role. apigateway_logging . arn
3+ }
Original file line number Diff line number Diff line change 1+ resource "aws_iam_role" "apigateway_logging" {
2+ name = " ${ local . csi } -logging"
3+ description = " Role used by API Gateway to write logs"
4+ assume_role_policy = data. aws_iam_policy_document . apigateway_assumerole . json
5+ }
6+
7+ data "aws_iam_policy_document" "apigateway_assumerole" {
8+ statement {
9+ sid = " ApigAssumeRole"
10+ effect = " Allow"
11+
12+ actions = [
13+ " sts:AssumeRole" ,
14+ ]
15+
16+ principals {
17+ type = " Service"
18+
19+ identifiers = [
20+ " apigateway.amazonaws.com"
21+ ]
22+ }
23+ }
24+ }
25+
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"
29+ }
You can’t perform that action at this time.
0 commit comments