Skip to content

Commit

Permalink
Update integ test and stage name description
Browse files Browse the repository at this point in the history
  • Loading branch information
gracelu0 committed Mar 15, 2024
1 parent bade9dc commit 00306b6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 154 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,6 @@
"Name": "my-api"
}
},
"myapiDeployment92F2CB4972a890db5063ec679071ba7eefc76f2a": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"Description": "Automatically created by the RestApi construct",
"RestApiId": {
"Ref": "myapi4C7BF186"
}
},
"DependsOn": [
"myapiGETF990CE3C"
]
},
"myapiDeploymentStagedevB1704B15": {
"Type": "AWS::ApiGateway::Stage",
"Properties": {
"DeploymentId": {
"Ref": "myapiDeployment92F2CB4972a890db5063ec679071ba7eefc76f2a"
},
"RestApiId": {
"Ref": "myapi4C7BF186"
},
"StageName": "dev"
}
},
"myapiGETF990CE3C": {
"Type": "AWS::ApiGateway::Method",
"Properties": {
Expand All @@ -49,46 +25,19 @@
}
}
},
"MyDeployment74F2406B6f3141cef1e8fea8ab3b3b8bc90df36d": {
"MyManualDeployment92F2175C6f3141cef1e8fea8ab3b3b8bc90df36d": {
"Type": "AWS::ApiGateway::Deployment",
"Properties": {
"RestApiId": {
"Ref": "myapi4C7BF186"
}
},
"StageName": "myStage"
},
"DependsOn": [
"myapiGETF990CE3C"
]
}
},
"Outputs": {
"myapiEndpoint3628AFE3": {
"Value": {
"Fn::Join": [
"",
[
"https://",
{
"Ref": "myapi4C7BF186"
},
".execute-api.",
{
"Ref": "AWS::Region"
},
".",
{
"Ref": "AWS::URLSuffix"
},
"/",
{
"Ref": "myapiDeploymentStagedevB1704B15"
},
"/"
]
]
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ const app = new cdk.App();
const stack = new cdk.Stack(app, 'integtest-restapi-import-deployment-stage');

const api = new apigateway.RestApi(stack, 'my-api', {
deployOptions: {
stageName: 'dev',
},
deploy: false,
});
api.root.addMethod('GET');

// Create a new deployment that uses existing stage
new apigateway.Deployment(stack, 'MyDeployment', {
new apigateway.Deployment(stack, 'MyManualDeployment', {
api: api,
stageName: 'dev',
stageName: 'myStage',
});

new integ.IntegTest(app, 'restapi-import-deployment-stage', {
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-apigateway/lib/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export interface DeploymentProps {
readonly retainDeployments?: boolean;

/**
* The stage of the API Gateway deployment.
* The name of the stage the API Gateway deployment deploys to.
*
* @default - If `stageName` is not specified, a "prod" stage will be automatically created for the API Gateway deployment.
* @default - No stage name.
*/
readonly stageName?: string;
}
Expand Down

0 comments on commit 00306b6

Please sign in to comment.