Ross Coundon
04/25/2022, 8:32 PMStage already exists (Service: AmazonApiGatewayV2; Status Code: 409; Error Code: ConflictException; Request ID: d4d312c4-82e8-44a2-9b16-97c4f9f7b7b7; Proxy: null)
console.js:6
I’ve switched to
const api = new sst.Api(this, 'Api', {
cdk: {
httpApi: {
createDefaultStage: false,
},
httpStages: [{
stageName: this.stage,
autoDeploy: true,
}]
},
...
from the previous separate definition
const apiStage = new HttpStage(this, 'Stage', {
httpApi: api.httpApi,
stageName: this.stage,
autoDeploy: true,
});
Have I done something wrong here?Ross Coundon
04/26/2022, 8:44 PMFrank
Ross Coundon
04/27/2022, 8:07 PMFrank
new HttpStage(this, 'Stage', ...) the CDK scope for the stage is this, which was the Stack.Frank
sst.Api construct, because it’s being created inside the Api.Frank
Frank
Frank
Ross Coundon
04/27/2022, 8:18 PMFrank
const apiStage = new HttpStage(this, 'Stage', {
httpApi: api.cdk.httpApi,
stageName: this.stage,
autoDeploy: true,
});Frank
api.httpApi => api.cdk.httpApiRoss Coundon
04/27/2022, 8:28 PM