This message was deleted.
# aws
s
This message was deleted.
s
Copy code
// 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],
});
I also have a WAF pointing to this stage