sparse-intern-71089
09/08/2022, 6:07 PMswift-fireman-31153
09/08/2022, 6:08 PM// Configure apigateway stage deployment triggers
const apiDeployment = new aws.apigateway.Deployment("openAPI Deployment", {
restApi: openAPI.id,
triggers: {
redeployment: pulumi.all([
rootMethodOptions.id,
integrationOptions.id,
]).apply(([
rootMethodGetId,
rootMethodOptionsid,
]) => JSON.stringify([
rootMethodGetId,
rootMethodOptionsid,
])).apply(toJSON => crypto.createHash('sha1').update(toJSON).digest('hex')),
},
});
// Configure deployment stages for the API Gateway REST API.
const stage = new aws.apigateway.Stage("stage", {
deployment: apiDeployment.id,
restApi: openAPI.id,
stageName: env,
},
{
dependsOn: [openApiLogGroup, apiDeployment],
});
// enable logging for the stage
const methodSettings = new aws.apigateway.MethodSettings("methodSettings", {
restApi: openAPI.id,
stageName: stage.stageName,
methodPath: "*/*",
settings: {
metricsEnabled: true,
loggingLevel: "INFO",
},
}, {
dependsOn: [stage, apiDeployment],
});
swift-fireman-31153
09/08/2022, 6:13 PMswift-fireman-31153
09/08/2022, 7:37 PM