examples icon indicating copy to clipboard operation
examples copied to clipboard

[Tutorial][AWS] Request for example on building and uploading static web apps

Open Lepozepo opened this issue 5 years ago • 4 comments

Problem description

It would be great to have a tutorial on how to upload static web apps on that require some form of build phase that requires environment variables from pulumi.Outputs before uploading files to the host. Specifically with AWS S3 would be great.

Affected product version(s)

Suggestions for a fix

Lepozepo avatar Dec 02 '19 21:12 Lepozepo

@Lepozepo Is this something you still feel would be useful? If so, can you provide a few more details?

scottslowe avatar Nov 03 '22 17:11 scottslowe

Ah yeah! @scottslowe This is old now but I think an example could be pretty useful regardless. This is what I ended up building back then which internally uses this construct. You can see in the construct that there is a build command with environment variables being passed to the project before uploading the build to S3. I believe the better path now is to use local.Command instead with triggers to have it run every single time though unless you believe there is a better way.

Lepozepo avatar Nov 03 '22 19:11 Lepozepo

@Lepozepo Thanks for responding! OK, I'll keep this in our backlog, although something like this may be better suited to go into a blog post or similar instead as an example in this repository.

scottslowe avatar Nov 03 '22 20:11 scottslowe

Yes! This might also be a good "next steps" add-on to our existing static-website template pages, given how common it is.

Indeed, for the serverless templates, I needed something kind like this myself -- some way to tell the UI what the computed serverless API endpoint was. I ended up building a JSON config file for it, and then fetching that file from the UI, but an example of how to bake output values right into a front-end build process would be great. Thanks for suggesting it. (And FWIW, I do think an example could also be a good fit for this.)

cnunciato avatar Nov 03 '22 21:11 cnunciato