https://pulumi.com logo
#typescript
Title
# typescript
r

ripe-cat-40820

01/03/2023, 3:47 PM
hi, I'm all new to
pulumi
and I have a question about javascript usage:
Copy code
// 1.
const image = new docker.Image(...) // promise ?

// 2.
const service = new gcp.cloudrun.Service(, { // promise too
  ...
  image: image.imageName,
  ...
})
I guess 1.
new docker.Image
returns a promise, but how 2.
await
for it ?
b

billowy-army-68599

01/03/2023, 3:51 PM
it’s not really a promise, it’s an
Output
which is promise like Why do you want to await it?
r

ripe-cat-40820

01/03/2023, 3:58 PM
no I'm just trying to figure out the flow of instructions
v

victorious-church-57397

01/03/2023, 5:23 PM
you should just be able to pass image.name through to the service args, as inputs/outputs are interchangeable as far as i understand it
r

ripe-cat-40820

01/04/2023, 12:15 AM
I guess this is the answer to my "flow" question:
Pulumi automatically captures dependencies when you pass an output from one resource as an input to another resource.
https://www.pulumi.com/docs/intro/concepts/inputs-outputs/#:~:text=pulumi%20automatically%20captures%20dependencies%20when%20you%20pass%20an%20output%20from%20one%20resource%20as%20an%20input%20to%20another%20resource.
I'm sure there are reasons for this, but I would have really preferred avoiding this type of magic, and handle this with classical promises/await
b

billowy-army-68599

01/04/2023, 4:29 AM
@ripe-cat-40820 the reason for this is that primises are not a thing in our other supported languages
and we support more languages than javascript
a lot of the semantics are the same, but it’s declarative