Update the API Gateway Resource Policy

This commit is contained in:
Anup Raj Gopinathan
2025-06-25 15:03:42 +02:00
parent 57b6d5eb75
commit ffff5c0869
+11 -1
View File
@@ -93,12 +93,22 @@ export class MccAPIInfraStack extends Stack {
effect: Effect.ALLOW,
principals: [new AnyPrincipal()],
actions: ['execute-api:Invoke'],
resources: ['execute-api:/*'],
resources: ['execute-api:/*/*/*'],
// Optionally, restrict by source VPC or VPC endpoint
conditions: {
StringEquals: { 'aws:SourceVpce': executeApiVpcEndpoint.vpcEndpointId }
}
}),
new PolicyStatement({
effect: Effect.DENY,
principals: [new AnyPrincipal()],
actions: ['execute-api:Invoke'],
resources: ['execute-api:/*/*/*'],
// Optionally, restrict by source VPC or VPC endpoint
conditions: {
StringNotEquals: { 'aws:SourceVpce': executeApiVpcEndpoint.vpcEndpointId }
}
}),
],
}),
});