I'm converting some AWS CDK code to Pulumi. One o...
# aws
d
I'm converting some AWS CDK code to Pulumi. One of the things I do is conditionally modify the environment variables for a Lambda, like so:
Copy code
node.addEnvironment('ENDPOINT_API', `https://${loadbalancerDomain}/api`);
What's the equivalent in Pulumi ? The
node
object is an instance of a Lambda Function
p
i do something like this too, i basically create a dictionary of my environment variables, and then pass them in to my lambda like this:
Copy code
environment: {
        variables: {
         SHARED_VAR_1: value1,
         SHARED_VAR_2: value2,
         ...lambdaSpecificDictionary,
        },
      },
d
The issue with that is that there's lots of logic that's grouped together, some of which depends on the Lambda Function object being instantiated -- so I would need to split the code within the conditional block up, which is inelegant because I'm repeating the condition