forked from aws/serverless-application-model
-
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.
fix: Support both 'VPCEndpointIds' and 'VpcEndpointIds' (aws#3315)
- Loading branch information
Showing
7 changed files
with
320 additions
and
2 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
20 changes: 20 additions & 0 deletions
20
tests/translator/input/api_endpoint_configuration_with_both_vpcendpoint.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Resources: | ||
ExplicitApiWithVpcEndpointIds: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json | ||
EndpointConfiguration: | ||
Type: PRIVATE | ||
VpcEndpointIds: | ||
- vpc-1 | ||
|
||
ExplicitApiWithVPCEndpointIds: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json | ||
EndpointConfiguration: | ||
Type: PRIVATE | ||
VPCEndpointIds: | ||
- vpc-2 |
14 changes: 14 additions & 0 deletions
14
tests/translator/input/error_api_invalid_endpoint_configuration_with_vpc.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Resources: | ||
ExplicitApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: Prod | ||
DefinitionUri: s3://sam-demo-bucket/webpage_swagger.json | ||
EndpointConfiguration: | ||
Type: PRIVATE | ||
VPCEndpointIds: | ||
- vpc-1 | ||
- vpc-2 | ||
VpcEndpointIds: | ||
- vpc-3 | ||
- vpc-4 |
88 changes: 88 additions & 0 deletions
88
tests/translator/output/api_endpoint_configuration_with_both_vpcendpoint.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Resources": { | ||
"ExplicitApiWithVPCEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-2" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
}, | ||
"ExplicitApiWithVpcEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-1" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
} | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
tests/translator/output/aws-cn/api_endpoint_configuration_with_both_vpcendpoint.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Resources": { | ||
"ExplicitApiWithVPCEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-2" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
}, | ||
"ExplicitApiWithVpcEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-1" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
} | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
tests/translator/output/aws-us-gov/api_endpoint_configuration_with_both_vpcendpoint.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"Resources": { | ||
"ExplicitApiWithVPCEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-2" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVPCEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVPCEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
}, | ||
"ExplicitApiWithVpcEndpointIds": { | ||
"Properties": { | ||
"BodyS3Location": { | ||
"Bucket": "sam-demo-bucket", | ||
"Key": "webpage_swagger.json" | ||
}, | ||
"EndpointConfiguration": { | ||
"Types": [ | ||
"PRIVATE" | ||
], | ||
"VpcEndpointIds": [ | ||
"vpc-1" | ||
] | ||
}, | ||
"Parameters": { | ||
"endpointConfigurationTypes": "PRIVATE" | ||
} | ||
}, | ||
"Type": "AWS::ApiGateway::RestApi" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7": { | ||
"Properties": { | ||
"Description": "RestApi deployment id: f117c932f75cfa87d23dfed64e9430d0081ef289", | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Stage" | ||
}, | ||
"Type": "AWS::ApiGateway::Deployment" | ||
}, | ||
"ExplicitApiWithVpcEndpointIdsProdStage": { | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIdsDeploymentf117c932f7" | ||
}, | ||
"RestApiId": { | ||
"Ref": "ExplicitApiWithVpcEndpointIds" | ||
}, | ||
"StageName": "Prod" | ||
}, | ||
"Type": "AWS::ApiGateway::Stage" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/translator/output/error_api_invalid_endpoint_configuration_with_vpc.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"_autoGeneratedBreakdownErrorMessage": [ | ||
"Invalid Serverless Application Specification document. ", | ||
"Number of errors found: 1. ", | ||
"Resource with id [ExplicitApi] is invalid. ", | ||
"'VPCEndpointIds' and 'VpcEndpointIds' cannot be used together in EndpointConfiguration." | ||
], | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. Resource with id [ExplicitApi] is invalid. 'VPCEndpointIds' and 'VpcEndpointIds' cannot be used together in EndpointConfiguration." | ||
} |