millions-pharmacist-626
01/31/2023, 10:49 AMgetting
an existing resource, for example:
• one can use the function: aws.service.get_resource()
• or the static method: aws.service.Resource.get()
E.g., to get an existing S3 bucket, one can do: aws.s3.get_bucket(bucket='myBucket')
or aws.s3.Bucket.get(resource_name='myBucket', id=123456)
.
What's the difference between the 2? Is there any caveat of using one over the other that I'm not aware of?great-sunset-355
01/31/2023, 10:54 AMresouce.get
- https://www.pulumi.com/docs/intro/concepts/resources/get/
get_resource()
- https://www.pulumi.com/docs/intro/concepts/resources/functions/millions-pharmacist-626
01/31/2023, 10:55 AMgreat-sunset-355
01/31/2023, 10:56 AMresource.get
because in past it had some weird consequences (I do not remember now, sorry) and use get_resource
or rather get_resource_output
which works as expectedmillions-pharmacist-626
01/31/2023, 10:57 AMget_resource_output
over get_resource
? The whole input / output thing is still a bit esoteric to me. I find that whenever I need a resource value (e.g. the ID), most times I have to apply()
to use it.little-cartoon-10569
01/31/2023, 9:13 PM