Help needed to create and then overwrite a S3 BucketObject in the same session #7309
-
I am piloting with Pulumi and need some help with the following use case. Suppose I create a S3 bucket and loads all the files from a local folder. When that is done, I proceed to overwrite one of the file uploaded with a deployment time value. Pulumi will give me a "Duplicate resource URN" error. Is there any way this can be done. I've added some demo code below. As part of local file upload, the following bucket object is created.
After a deployment value is available, I try to overwrite the object content with code below.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi @GeXiaoguo I don't quite understand the flow here - are you manually changing that value between Pulumi runs or as part of the same configuration? Paul |
Beta Was this translation helpful? Give feedback.
-
I am changing the value as part of the same configuration. To add some context, I am piloting a infrastructure as code solution with Pulumi. I've documented my steps here: https://github.com/GeXiaoguo/pulumi-s3-static-web/blob/master/readme-consuming-pulumi-output.md
All 3 steps are in the same Pulumi run where I've got the |
Beta Was this translation helpful? Give feedback.
-
B.t.w If overwriting object is possible in the same Pulumi run, I believe it could also be used as a workaround for this issue, which I am also facing at the moment. For a typical Serverless Web APP, the following dependencies are very common.
|
Beta Was this translation helpful? Give feedback.
-
GitHub discussions doesn't let you mark a subthread as the answer, so commenting to say @tenwit is correct with the answer in this reply! |
Beta Was this translation helpful? Give feedback.
I am changing the value as part of the same configuration.
To add some context, I am piloting a infrastructure as code solution with Pulumi. I've documented my steps here: https://github.com/GeXiaoguo/pulumi-s3-static-web/blob/master/readme-consuming-pulumi-output.md
To summarize, I am deploying the following resources
where runtime-config.js is a file from a local folder and has the content below