hundreds-receptionist-31352
02/10/2021, 1:47 PMclass Vpc {
....
cidr = getCidr() // get a cidr from database
...
const vpc = pulumi.all([cidr]).apply(cidr)=>
{
return new vpcConfig('vpc',{cidr})
}
....
this.vpc=vpc
}
I need to return only type <vpc> ( I could do it without using pulumi.all inside of this class), otherwide I have to use another pulumi.all when using it
const vpc = new Vpc(.....)
pulumi.all([vpc]).apply(vpc) =>
{
new eks.cluster('.....', vpc)
}
is there any way to avoid using too much pulumi.all and get only the object type that I need( <vpc> in this case ) ?
thanks in advancewitty-candle-66007
02/10/2021, 2:21 PM.apply()
such as follows:
cidr.apply(cidr => return new vpcConfig(vpc,{cidr})
The .all
is really only needed if there are multiple values you need to resolve.
import { baseTags, projectName, stackName, } from “./config”;witty-candle-66007
02/10/2021, 2:24 PMnew eks cluster()
only needs the ID, or reference vpc.id
in the new eks.cluster()
part which I think will lift the value so an apply is not needed.