<@UB8C33JJG> Hi team, I’m trying to understand how...
# general
d
@echoing-match-29901 Hi team, I’m trying to understand how dynamic stack config works with Pulumi Cloud. I have a monorepo setup with separate env folders (like
stage/
), each containing its own
Pulumi.yaml
and
index.ts
. Project name is
infra
. In GitHub Actions, I build/push ECS images and run:
Copy code
pulumi config set api2ImageTag <image-tag>
pulumi up
In my Pulumi code:
Copy code
const config = new pulumi.Config();
const imageTag = config.get("api2ImageTag") || "latest";
I can see
infra:api2ImageTag
in Pulumi Cloud UI after deployment, but when I run:
Copy code
pulumi config
locally, it only shows the vars already defined in my local
Pulumi.yaml
files and does not fetch
api2ImageTag
from Pulumi Cloud. Because of that,
config.get("api2ImageTag")
returns undefined and preview tries to revert the ECS image back to
latest
. Is there a way to make
pulumi config
/
new pulumi.Config().get()
fetch these dynamically added config values directly from Pulumi Cloud ?
e
I think your looking for
pulumi config refresh
which fetches the config values used from the last deployment and updates the local file with them.
d
I tried this command. It creates a new
pulumi.env.yaml
file and does not add it to existing
Pulumi.yaml
file. Also, how do I achieve the same outcome when I run deployments from pulumi cloud
e
config is generally 'per-stack' not 'per-project' so that's expected
same outcome when I run deployments from pulumi cloud
Generally by setting the config and commiting it so it's in the source code that deployments pulls down to run
d
Okay, thank you for your help
l
I have a monorepo setup with separate env folders (like stage/), each containing its own Pulumi.yaml and index.ts. Project name is infra.
This sounds like the source of the problem. If you have one Pulumi project, then you have one Pulumi.yaml file. If the folders contain different index.ts files, then you have different projects.