-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(apigateway): move url property to RestApiBase (#27742)
Moved the url property from RestApi class to the RestApiBase to have the url property on all derived class. This will fix the problem mentioned in the issue where SpecRestApi does not work with the RestApiOrigin construct. PS. I could not perform the integration tests as the free tier on my personal account expired. Closes #27501. ---- *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
766ff8b
commit b23ee1b
Showing
12 changed files
with
936 additions
and
50 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
.../aws-cloudfront-origins/test/integ.spec-rest-api-origin-custom-origin.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...api-origin-custom-origin.js.snapshot/integ-spec-rest-api-origin-custom-origin.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
202 changes: 202 additions & 0 deletions
202
...i-origin-custom-origin.js.snapshot/integ-spec-rest-api-origin-custom-origin.template.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,202 @@ | ||
{ | ||
"Resources": { | ||
"RestApi0C43BF4B": { | ||
"Type": "AWS::ApiGateway::RestApi", | ||
"Properties": { | ||
"Body": { | ||
"openapi": "3.0.2", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Test API for CDK" | ||
}, | ||
"paths": { | ||
"/pets": { | ||
"get": { | ||
"summary": "Test Method", | ||
"operationId": "testMethod", | ||
"responses": { | ||
"200": { | ||
"description": "A paged array of pets", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Empty" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"x-amazon-apigateway-integration": { | ||
"responses": { | ||
"default": { | ||
"statusCode": "200" | ||
} | ||
}, | ||
"requestTemplates": { | ||
"application/json": "{\"statusCode\": 200}" | ||
}, | ||
"passthroughBehavior": "when_no_match", | ||
"type": "mock" | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Empty": { | ||
"title": "Empty Schema", | ||
"type": "object" | ||
} | ||
} | ||
} | ||
}, | ||
"Name": "RestApi" | ||
} | ||
}, | ||
"RestApiDeployment180EC503edd77c5c8fffabb2e523387cd087d12f": { | ||
"Type": "AWS::ApiGateway::Deployment", | ||
"Properties": { | ||
"Description": "Automatically created by the RestApi construct", | ||
"RestApiId": { | ||
"Ref": "RestApi0C43BF4B" | ||
} | ||
} | ||
}, | ||
"RestApiDeploymentStageprod3855DE66": { | ||
"Type": "AWS::ApiGateway::Stage", | ||
"Properties": { | ||
"DeploymentId": { | ||
"Ref": "RestApiDeployment180EC503edd77c5c8fffabb2e523387cd087d12f" | ||
}, | ||
"RestApiId": { | ||
"Ref": "RestApi0C43BF4B" | ||
}, | ||
"StageName": "prod" | ||
} | ||
}, | ||
"Distribution830FAC52": { | ||
"Type": "AWS::CloudFront::Distribution", | ||
"Properties": { | ||
"DistributionConfig": { | ||
"DefaultCacheBehavior": { | ||
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6", | ||
"Compress": true, | ||
"TargetOriginId": "integspecrestapiorigincustomoriginDistributionOrigin1C1368952", | ||
"ViewerProtocolPolicy": "allow-all" | ||
}, | ||
"Enabled": true, | ||
"HttpVersion": "http2", | ||
"IPV6Enabled": true, | ||
"Origins": [ | ||
{ | ||
"CustomOriginConfig": { | ||
"OriginProtocolPolicy": "https-only", | ||
"OriginSSLProtocols": [ | ||
"TLSv1.2" | ||
] | ||
}, | ||
"DomainName": { | ||
"Fn::Select": [ | ||
2, | ||
{ | ||
"Fn::Split": [ | ||
"/", | ||
{ | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"https://", | ||
{ | ||
"Ref": "RestApi0C43BF4B" | ||
}, | ||
".execute-api.", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
".", | ||
{ | ||
"Ref": "AWS::URLSuffix" | ||
}, | ||
"/", | ||
{ | ||
"Ref": "RestApiDeploymentStageprod3855DE66" | ||
}, | ||
"/" | ||
] | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"Id": "integspecrestapiorigincustomoriginDistributionOrigin1C1368952", | ||
"OriginPath": "" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"RestApiEndpoint0551178A": { | ||
"Value": { | ||
"Fn::Join": [ | ||
"", | ||
[ | ||
"https://", | ||
{ | ||
"Ref": "RestApi0C43BF4B" | ||
}, | ||
".execute-api.", | ||
{ | ||
"Ref": "AWS::Region" | ||
}, | ||
".", | ||
{ | ||
"Ref": "AWS::URLSuffix" | ||
}, | ||
"/", | ||
{ | ||
"Ref": "RestApiDeploymentStageprod3855DE66" | ||
}, | ||
"/" | ||
] | ||
] | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...s-cloudfront-origins/test/integ.spec-rest-api-origin-custom-origin.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
137 changes: 137 additions & 0 deletions
137
...loudfront-origins/test/integ.spec-rest-api-origin-custom-origin.js.snapshot/manifest.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.