Update the API Gateway Resource Policy
This commit is contained in:
+11
-1
@@ -93,12 +93,22 @@ export class MccAPIInfraStack extends Stack {
|
|||||||
effect: Effect.ALLOW,
|
effect: Effect.ALLOW,
|
||||||
principals: [new AnyPrincipal()],
|
principals: [new AnyPrincipal()],
|
||||||
actions: ['execute-api:Invoke'],
|
actions: ['execute-api:Invoke'],
|
||||||
resources: ['execute-api:/*'],
|
resources: ['execute-api:/*/*/*'],
|
||||||
// Optionally, restrict by source VPC or VPC endpoint
|
// Optionally, restrict by source VPC or VPC endpoint
|
||||||
conditions: {
|
conditions: {
|
||||||
StringEquals: { 'aws:SourceVpce': executeApiVpcEndpoint.vpcEndpointId }
|
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 }
|
||||||
|
}
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user