Open badmintoncryer opened 1 month ago
I was thinking maybe we should implement a grantInvoke()
method which returns an iam.Grant and addToPrincipalOrResource() with the vpc endpoint so the experience would be like
declare const interfaceVpcEndpoint: ec2.InterfaceVpcEndpoint;
const api = new apigateway.RestApi(this, 'PrivateRestApi', {
endpointTypes: [apigateway.EndpointType.PRIVATE],
})
api.grantInvoke(interfaceVpcEndpoint);
wdyt?
I am requesting more input from the maintainers as well. Thank you for your attention to this matter.
@pahud It sounds really nice! I will try to implement it later😁
Describe the feature
Add a method to easily attach a resource policy for creating a Private API Gateway.
Use Case
To create a Private API Gateway, you need to attach a resource policy that allows access only from specific Interface VPC Endpoints, as shown below.
Proposed Solution
My idea is to implement a
addVpcEndpointAccessPolicy
method like below.Is there any good ideas?
Other Information
No response
Acknowledgements
CDK version used
2.160.0
Environment details (OS name and version, etc.)
irrelevant