How can I properly populate the readme? I am follo...
# aws
How can I properly populate the readme? I am following (
Copy code
import pulumi
from pulumi_aws_native import s3

# Create an AWS resource (S3 Bucket)
bucket = s3.Bucket("my_bucket")


with open('./') as f:
The readme with contents of:
Copy code
- main bucket ${}
- my_bucket ${my_bucket}
The file is neatly uploaded. However, the ${} reference to the variable is never resolved and empty. What do I need to change to get the variables to resolve?
@billowy-army-68599 here the single direct question
what are you trying to do? put the bucket id into a readme file?
you need to wait for the bucket ID to return from the API and then write to the README file, like this:
Copy code
    # anything that happens inside this apply block happens
    # after the s3 bucket has finished being created
    lambda bucket_id: open("", "w").write(bucket_id)
s but this is looking so much different here. When I have multiple values having such a xxx.apply.write for each sounds fairly complex
@sparse-optician-70334 that is a special
- they operate differently and render in the Pulumi Cloud interface. Notice the README itself looks like this:
Copy code
# Stack README

Full markdown support! Substitute stack outputs dynamically so that links can depend on your infrastructure! Link to dashboards, logs, metrics, and more.

1. Reference a string stack output: ${outputs.strVar}
2. Reference an array stack output: ${outputs.arrVar[1]}
More info on stack readme’s can be found here: You will see those outputs in the cloud console, not in your regular file. If you just want to populate a regular file, you’ll have to do it the way I explained.
understood - indeed I want it in the stack readme. However, also there - the variables are empty and not rendered
can you screenshot the cloud console for me?
and show your readme?
sure. However, I think I could figure it out now thanks to your help: outputs was missing
many thanks
happy to help!
thanks - I hope it is fine that I tried to ping you on one more AWS basics question around Output[T]