https://pulumi.com logo
#python
Title
# python
s

shy-gold-87158

01/19/2023, 7:58 PM
Hi all, I'm looking for some guidance on an item being returned in state from provider in the pulumi python boilerplate at => https://github.com/pulumi/pulumi-component-provider-py-boilerplate/blob/main/provider/cmd/pulumi-resource-xyz/xyz_provider/staticpage.py. Specifically, the bucket. In schema.json for this example they designate it is an aws bucket resource but in the index.ts none of those properties are accessible so I'm curious what is point of returning the resource like this. The bucket is outputting an id but I would have expected it to be an object with the properties of aws bucket. Thanks 😃
w

white-balloon-205

01/19/2023, 8:14 PM
What do you mean when you say that none of those properties are available? It should be the case that you see a Bucket object returned from: export const bucket = page.bucket;
s

shy-gold-87158

01/19/2023, 8:27 PM
for example
export const arn = page.bucket.arn
will say arn doesn't exist on output instance and if I use apply
page.bucket.apply(bucket => bucket.arn)
arn is empty....for me the only way it works is if I do
export const bucketId = page.bucket
bucketId ends up being just a string
I was returning a load balancer resource to my client code and hoping I could just do lb.dns_name which set me down this path of trying to understand more. I could return the dns_name as a string and access from my construct but returning a resource like they did in the example just doesn't yield what I expect so figured my expectation must be wrong.
w

white-balloon-205

01/19/2023, 8:39 PM
That would indicate something is not working correctly. You should get a Bucket instance here. Is it possible you are running into the same thing mentioned at https://github.com/pulumi/pulumi-awsx/issues/972#issuecomment-1376033119? The steps suggested there might help your case as well?
s

shy-gold-87158

01/19/2023, 8:41 PM
That does look awfully similar. Let me try it out. Awesome.
Hi @white-balloon-205, so that didn't work for me and I have been exploring more. Noticed someone posted, https://github.com/pulumi/pulumi-component-provider-ts-boilerplate/issues/34 , the same in boilerplate-ts thought you may have some ideas. I was trying with different versions of clients and ts/python to see if behavior was ever different but so far that bucket is always a string specifically the id. Thank you again for help.