You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Fixesaws#9060
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
0 commit comments