question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda environment change isn't picked up

See original GitHub issue

Run pulumi up on the following program:

import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";

const role = new aws.iam.Role("mylambda-role", {
    assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({ Service: "lambda.amazonaws.com" }),
});

const lambda = new aws.lambda.Function("mylambda", {
    runtime: aws.lambda.DotnetCore2d1Runtime,
    code: new pulumi.asset.AssetArchive({
        ".": new pulumi.asset.FileArchive("./app/bin/Debug/netcoreapp2.1/publish"),
    }),
    timeout: 300,
    handler: "app::app.Functions::GetAsync",
    role: role.arn,
    environment: {
        variables: {
            FOO: "bar",
        },
    },
});

after the deployment succeeds, change environment to

    environment: {
        variables: {
            BUZZ: "fizz",
        },
    },

Expected: pulumi up overrides environment. Current result: preview has no changes and up deploys nothing.

Note: the env variable name has to be in UPPERCASE (may also contain _). Lowercase changes are detected.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
barakbaron12commented, Jun 1, 2021

@pgavlin was this issue resolved in python pulumi-aws libraries? I’m seeing the same issue using pulumi-aws 3.33.0 and pulumi 2.23.1

0reactions
giladgurvichcommented, Jul 4, 2022

@pgavlin we still have this issue 😦 Pulumi doesn’t update env vars. We see it in the diff but it does not reflect the changes in AWS. We are using pulumi-aws 4.15.0 (Python) with CLI 2.25.2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change value of environment variable while invoking Lambda ...
Change value of environment variable while invoking Lambda function · Option 1: AWS Console. You can go to the AWS console, open the...
Read more >
Configure Lambda environment variables - Amazon AWS
To change the environment variables of a published Lambda function version, you must first change the current, unpublished function version ($ ...
Read more >
Using and Securing Environment Variables with AWS Lambda ...
Open the functions page on the Lambda console and choose a function. If one isn't available, create a new one with the default...
Read more >
AWS Lambda Java Tutorial: Best Practices to Lower Cold Starts
But if you find that your 128mb lambda function is taking too long to start up and execute, you can change it to...
Read more >
AWS Lambda Container Lifetime and Config Refresh - LinkedIn
This brings us to the Config Refresh issue: initialisation typically means loading and parsing some configuration, e.g. from an S3 bucket, and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found