forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(apigateway): configure endpoint types on SpecRestApi (aws#9068)
feat(apigateway): adding the ability to set the endpoint configuration for the OpenAPI 3.0 With this change, it will be possible to modify this by providing the endpointTypes as shown here: ``` const api = new apigateway.SpecRestApi(this, 'ExampleRestApi', { apiDefinition: apigateway.ApiDefinition.fromInline(replacedSwagger), endpointTypes: [apigateway.EndpointType.PRIVATE], }); ``` Note: For private endpoints you will still need to provide the `x-amazon-apigateway-endpoint-configuration` and `x-amazon-apigateway-policy` in your openApi file. The following is an example with both settings: ```json { "openapi": "3.0.2", "servers" : [ { "x-amazon-apigateway-endpoint-configuration": { "vpcEndpointIds": [ "vpce-00111a1111a1aa011" ] } } ], "paths": { ... }, "x-amazon-apigateway-policy": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": [ "execute-api:Invoke", "execute-api:GET" ], "Resource": "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:*", "Condition": { "StringEquals": { "aws:sourceVpce": "vpce-00111a1111a1aa011" } } } ] } } ``` Checklist for this PR: 🧪 Testing: adding integration testing for private API gateway. 📄 Docs: Add example in the README documentation about how to create a private API gateway with swagger Fixes aws#9060 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
- Loading branch information
1 parent
09e1fdf
commit 23003f3
Showing
3 changed files
with
76 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters