to differentiate the functionality on environment ...
# python
f
to differentiate the functionality on environment values
p
if you want to read env variable, simply call
os.environ.get("AWS_PROFILE")
howerver, I think it’d be better to rely on different pulumi stacks to differentiate that
f
👍
name = os.environ.get("AWS_PROFILE") print("env===", name) But i am getting value None
awsprofile dev, i added in config
in pulumi stack
m
In TypeScript, it would look something like:
Copy code
const awsConfig = new pulumi.Config("aws");
const profile = awsConfig.require("profile");
so... untested Python:
Copy code
aws_config = pulumi.Config("aws")
profile = aws_config.require("profile")
p
if you declare this in stack yaml file, snippet written by @millions-furniture-75402 is gonna work