https://pulumi.com logo
#aws
Title
# aws
s

swift-fireman-31153

09/08/2022, 6:07 PM
So I am getting an error
Active stages pointing to this deployment must be moved or deleted
the stage and deployment are in the same index.ts file but for some reason after initial deployment
pulumi up
fails with an update.
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
3 Views