diff --git a/src/main/java/io/github/hectorvent/floci/services/iam/AwsManagedPolicies.java b/src/main/java/io/github/hectorvent/floci/services/iam/AwsManagedPolicies.java index d65067fba6..79bf611ffa 100644 --- a/src/main/java/io/github/hectorvent/floci/services/iam/AwsManagedPolicies.java +++ b/src/main/java/io/github/hectorvent/floci/services/iam/AwsManagedPolicies.java @@ -127,6 +127,10 @@ final class AwsManagedPolicies { new ManagedPolicyDef("CloudWatchLambdaApplicationSignalsExecutionRolePolicy", "/", "Provides write access to X-Ray and CloudWatch Application Signals log group."), + // API Gateway execution role policy + new ManagedPolicyDef("AmazonAPIGatewayPushToCloudWatchLogs", "/service-role/", + "Allows API Gateway to push logs to CloudWatch Logs."), + // Config execution role policy new ManagedPolicyDef("AWSConfigRulesExecutionRole", "/service-role/", "Allows AWS Config Rules Lambda functions to call AWS services and read the configuration of AWS resources."), diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamIntegrationTest.java index 3aab7d378e..1afb7123d6 100644 --- a/src/test/java/io/github/hectorvent/floci/services/iam/IamIntegrationTest.java +++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamIntegrationTest.java @@ -254,6 +254,25 @@ class IamIntegrationTest { equalTo("arn:aws:iam::aws:policy/service-role/AmazonRDSEnhancedMonitoringRole")); } + @Test + @Order(18) + void getApiGatewayPushToCloudWatchLogsPolicy() { + given() + .formParam("Action", "GetPolicy") + .formParam("PolicyArn", + "arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs") + .header("Authorization", + "AWS4-HMAC-SHA256 Credential=test/20260227/us-east-1/iam/aws4_request") + .when() + .post("/") + .then() + .statusCode(200) + .body("GetPolicyResponse.GetPolicyResult.Policy.PolicyName", + equalTo("AmazonAPIGatewayPushToCloudWatchLogs")) + .body("GetPolicyResponse.GetPolicyResult.Policy.Arn", + equalTo("arn:aws:iam::aws:policy/service-role/AmazonAPIGatewayPushToCloudWatchLogs")); + } + @Test @Order(9) void stsGetCallerIdentityFallsBackForUnseededFlociAccessKey() {