lively-crayon-44649
08/18/2022, 9:25 AMclass MyResource extends pulumi.ComponentResource {
static create(name, args, opts): MyResource {
const foo = new aws.Foo(...)
const bar = new aws.Bar(...)
return new this(foo, bar)
}
static fromExisting(fooId, barId) {
const foo = aws.Foo.getFoo(fooId)
const bar = aws.Bar.getBar(barId)
return new this(foo, bar)
}
private constructor(foo, bar) {
this.foo = foo
this.bar = bar
}
toOutputs() {
return {
fooId: this.foo.id,
barId: this.bar.id,
}
}
}
swift-ambulance-7102
08/18/2022, 5:54 PMlively-crayon-44649
08/19/2022, 12:52 PM