i.e. dev.infra.happy-service and prod.infra.happy-...
# getting-started
b
i.e. dev.infra.happy-service and prod.infra.happy-service are two separate stacks on the same project 🙂 I use different projects for different purposes - i.e. i have another project to manage kubernetes on top of those stacks, so those stacks would be dev.k8s.happy-service etc in the kuberenetes project
c
i.e. dev.infra.happy-service and prod.infra.happy-service are two separate stacks on the same project
Thanks for you reply. I have two projects for dev and prod and I don’t want to manage into one project.
I use Typescript and there will be too many
Copy code
if (pulumi.getStack() === "dev") {
    dev configuration
}
Am I doing it correctly?
w
@cool-policeman-37867 You don’t need to check the stack, that happens automatically when using
Config()
in your code. See: https://www.pulumi.com/docs/intro/concepts/config/ So for a given project, if you have a “dev” and a “prod” stack, you’ll have a
Pulumi.dev.yaml
and a
Pulumi.prod.yaml
that captures the configurations for the two different stacks. Then in your code when you access
pulumi.Config()
it will use the stack config that matches the stack you are doing the
pulumi up
for.
c
But let’s say, I only have a lambda in dev.
i need to check the stack and define my resource in my typescript code, right?
w
So for a given project, are you saying that when you deploy the "prod" stack, you want to deploy, say, a lambda and a dynamoDb, but when you deploy the "dev" stack you only want to deploy a lambda?