This message was deleted.
# general
s
This message was deleted.
b
you can use
pulumi.Config()
and then wrap any resources in an if statement. Example in typescript
Copy code
const config = new pulumi.Config()
const doStuff = config.require_boolean("doStuff")

if doStuff {
  // my resource here
}
you'd then set that value in your stack config
pulumi config set doStuff true
you could also examine the stack name
Copy code
stack = pulumi.getStack()

if stack == "dev" {
  // do something
}
r
Thanks! Do component resources help here? Perhaps encapsulating these check(s)?
b
they can! I wouldn't recommend having
getStack
or
config
calls in your component resource though, making them options on the resource itself is a good idea though
👍 1