https://pulumi.com logo
Title
s

swift-agency-29333

04/02/2021, 9:50 PM
Is there a way to create a resource separately and link it to existing stack?
b

brave-angle-33257

04/02/2021, 10:21 PM
s

swift-agency-29333

04/02/2021, 11:45 PM
@brave-angle-33257 they are created in pulumi as well. I am thinking to use two codes one will create a stack and some resources in it. Then later on if user access that specific feature, then I’ll run the second code which should create new resource but instead of creating new stack, it should link it to the one created in first code.
b

billowy-army-68599

04/02/2021, 11:50 PM
you can do this with config values
const my_resource = new aws.ec2.Instance()
const enable_feature = config.requireBoolean("enable")

if (enable_feature) {
  // add your new resource here
}
👍 1