Ashishkumar Pandey
06/15/2022, 5:54 PMthdxr
06/15/2022, 5:55 PMAshishkumar Pandey
06/15/2022, 6:00 PMAshishkumar Pandey
06/15/2022, 6:03 PMthdxr
06/15/2022, 6:04 PMthdxr
06/15/2022, 6:04 PMthdxr
06/15/2022, 6:04 PMAshishkumar Pandey
06/15/2022, 6:04 PMAshishkumar Pandey
06/15/2022, 6:11 PMconst appStackV2 = new AppStack(app, 'app-stack');
const appStackV3 = new AppStackV3(app, 'app-stack-v3', {
appTable: appStackV2.appTable,
v2Api: appStackV2.appApiV2,
dwaarpaalIssuer: DWAARPAAL_ISSUER,
});
this is an api’s v2 version from AppStack
this.appApiV2 = new sst.Api(this, 'app-api', {
cors: {
allowOrigins: ['*'],
allowMethods: [CorsHttpMethod.GET, <http://CorsHttpMethod.POST|CorsHttpMethod.POST>, CorsHttpMethod.OPTIONS],
},
customDomain: {
domainName: `${stageSubDomain}.${process.env.HOSTED_ZONE_NAME}`,
hostedZone: hostedZone,
path: process.env.API_VERSION,
},
defaultAuthorizationType: sst.ApiAuthorizationType.NONE,
defaultFunctionProps: {
environment: {
stage: scope.stage,
tableName: this.appTable.dynamodbTable.tableName,
},
},
routes: {
'GET /versions/supported': 'src/api/app/versions/supported.handler',
'GET /test-numbers': 'src/api/app/test-auth/get-numbers.handler',
'GET /test-numbers/{testPhoneNumber}/otp': 'src/api/app/test-auth/get-otp-for-number.handler',
'POST /test-numbers': {
function: {
handler: 'src/api/app/test-auth/add-numbers.handler',
},
authorizer: adminApiAuthorizer,
authorizationType: sst.ApiAuthorizationType.JWT,
},
},
});
This is the same api’s v3 extension
this.appApiV3 = new sst.Api(this, 'app-api-v3', {
cors: {
allowOrigins: ['*'],
allowMethods: [CorsHttpMethod.GET, <http://CorsHttpMethod.POST|CorsHttpMethod.POST>, CorsHttpMethod.OPTIONS],
},
customDomain: {
domainName: props?.v2Api.apiGatewayDomain,
path: 'v3',
},
defaultAuthorizationType: sst.ApiAuthorizationType.NONE,
defaultFunctionProps: {
environment: {
stage: scope.stage,
tableName: props.appTable.dynamodbTable.tableName,
},
},
routes: {
'GET /versions/supported': 'src/api/app/versions/supported.handler',
'GET /test-numbers': 'src/api/app/test-auth/get-numbers.handler',
'GET /test-numbers/{testPhoneNumber}/otp': 'src/api/app/test-auth/get-otp-for-number.handler',
'POST /test-numbers': {
function: {
handler: 'src/api/app/test-auth/add-numbers.handler',
},
authorizer: adminApiAuthorizer,
authorizationType: sst.ApiAuthorizationType.JWT,
},
},
});
Now, I need to remove the older version on the api without impacting the latter version, how do I do that?thdxr
06/15/2022, 6:14 PM${stageSubDomain}.${process.env.HOSTED_ZONE_NAME}
thdxr
06/15/2022, 6:14 PMAshishkumar Pandey
06/15/2022, 6:21 PMthdxr
06/15/2022, 6:22 PMthdxr
06/15/2022, 6:22 PMthdxr
06/15/2022, 6:23 PMAshishkumar Pandey
06/15/2022, 6:27 PM