https://pulumi.com logo
#general
Title
# general
f

flat-insurance-25294

01/16/2020, 11:33 PM
Is there any approach of getting a stack output based on what stack it is?
Copy code
if (config.isProduction == false) {
    export const rdsPassword = rds.masterPassword
}
Like that wouldn’t work.
h

handsome-actor-1155

01/16/2020, 11:34 PM
pulumi.getStack()
f

flat-insurance-25294

01/16/2020, 11:34 PM
Yeah, I know, that’s how I get wether or not it is production. That’s not the problem
h

handsome-actor-1155

01/16/2020, 11:35 PM
Oh you want to output certain things based on the stack?
f

flat-insurance-25294

01/16/2020, 11:35 PM
Yeah I thought that’s what I wrote.
Sorry for the confusion.
h

handsome-actor-1155

01/16/2020, 11:36 PM
Copy code
export const rdsPassword = pulumi.getStack() === "prod" ? rds.masterPassword : "notapassword"
Something like that?
f

flat-insurance-25294

01/16/2020, 11:36 PM
Oh don’t I feel stupid, yeah I get that’s better.
Thank you!
h

handsome-actor-1155

01/16/2020, 11:36 PM
NP