ancient-nightfall-54764
05/13/2022, 7:47 AMif (stackName === "development") {
import "vpc-development"
} else if (stackName === "staging") {
import vpc-staging
}
stocky-restaurant-98004
05/13/2022, 9:48 PMancient-nightfall-54764
05/14/2022, 4:51 AMstocky-restaurant-98004
05/14/2022, 4:48 PMconst createPeering = config.requireBoolean("vpc-peering");
if (createPeering) {
// etc.
ancient-nightfall-54764
05/17/2022, 1:57 AMconst production = config.requireBoolean("environment-production");
const development = config.requireBoolean("environment-development");
if (production) {
const serverProd = new aws.ec2.instance("serverProd", {
...
})
export const serverIP = serverProd.ip (is not working)
}
if (development) {
const serverDev = new aws.ec2.instance("serverDev", {
...
})
export const serverIP = serverDev.ip (is not working)
}
I can’t sent output of ip public/private from the server, because the export can’t working inside the condition. How I can export the ip to another file/resource? thank youstocky-restaurant-98004
05/17/2022, 3:16 PMconst stackName = pulumi.getStack();
const ec2Args = getEc2Args(stackName); // returns e.g. a t2 micro if stackname == dev, m5g.medium in prod (or whatever)
const server = new aws.ec2.instance("server", ec2Args);
ancient-nightfall-54764
05/18/2022, 2:12 AMstocky-restaurant-98004
05/18/2022, 1:16 PM