ion icon indicating copy to clipboard operation
ion copied to clipboard

Inconsistent provisioned concurrency and publish: true

Open schwjustin opened this issue 9 months ago • 1 comments

I was able to get provisioned concurrency working for my lambda using aws.lambda.ProvisionedConcurrencyConfig, however, it seems to work inconsistently. If I comment out the config and then deploy, it successfully removes the provisioned concurrency for this lambda. Then, if I uncomment it and deploy again, sometimes I get FUNCTION_ERROR_INIT_FAILURE. Also, it seems like when I update my lambda handler, I don't always get a new version published when I deploy. For example, I added a console log at the top of my handler, deployed, and under versions my lambda still had version 3 from 2 hours ago after refreshing my AWS console.

const testRoute = api.route("GET /test", {
    handler: "services/test/handler",
    transform: {
        function: (args) => {
            args.publish = true;
        },
    },
    link: [...keys],
});

const osintURLConcurrency = new aws.lambda.ProvisionedConcurrencyConfig("ProvisionedConcurrencyName", {
    functionName: testRoute.function.name.apply((name) => name),
    qualifier: testRoute.function.nodes.function.version.apply((version) => version),
    provisionedConcurrentExecutions: 1,
});
ProvisionedConcurrencyName aws:lambda:ProvisionedConcurrencyConfig
   creating urn:pulumi:justinschwartz::sst::aws:lambda/provisionedConcurrencyConfig:ProvisionedConcurrencyConfig::ProvisionedConcurrencyName: 1 error occurred:
   
   waiting for Lambda Provisioned Concurrency Config (sst-justinschwartz-APIRoute____HandlerFunction,1) to be ready: status reason: FUNCTION_ERROR_INIT_FAILURE

schwjustin avatar May 05 '24 19:05 schwjustin