Skip to content

s3 frontend and backend in copilot for the pipeline #3703

Answered by efekarakus
rxmatch asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @rxmatch !

That's a really cool use case that totally makes sense.

Mitigation

This isn't an ideal solution, but please let me know what you think. Is it possible to leverage the test_commands to potentially upload the React app to the s3 bucket?

stages:
- name: testing
  deployemnts:
     api:
  test_commands:
     - aws s3 cp webapp/ s3://mybucket/ --recursive # Option 1.
     - copilot task run  --dockerfile ./s3uploader/Dockerfile --task-role <some role with access to s3>  # Option 2.

The main downside of Option 1 that I can think of is that you'll have to modify the BuildProjectPolicy outside of Copilot to give permission to upload artifacts to the s3 bucket:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rxmatch
Comment options

Answer selected by rxmatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants