Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 2.1. prepare repo for course, manually upload to s3, create cloudfront distribution and invalidation #1

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

Guria
Copy link
Owner

@Guria Guria commented Sep 29, 2022

Forked repo has some tasks already done, so I decided to revert it first.
Also upgraded dependencies to modern versions and added initial queries hydration to work in static build.

  • upgrades dependencies removes serverless
  • implementation since it is expected to be done in following tasks
  • adds hydration for initial queries until to work in static builds

* upgrades dependencies
removes serverless
* implementation since it is expected to be done in following tasks
* adds hydration for initial queries until to work in static builds
@Guria Guria merged commit 1dbe390 into main Sep 29, 2022
@Guria
Copy link
Owner Author

Guria commented Sep 29, 2022

dist folder content is manually uploaded to s3 bucket with static website hosting configured:
http://aleksei-gurianov-aws-practitioner-public-s3.s3-website-us-east-1.amazonaws.com/
image

@Guria
Copy link
Owner Author

Guria commented Sep 29, 2022

Created distribution:
https://d3seyqim2dycgp.cloudfront.net
image

Original S3 not more public anymore:
image

@Guria
Copy link
Owner Author

Guria commented Sep 29, 2022

Made visible changes and updated s3 bucket from aws cli

$  npm run build

> [email protected] build
> tsc && vite build

vite v3.1.4 building for production...
✓ 1760 modules transformed.
dist/index.html                      0.53 KiB
dist/assets/dehydrated.2e689d50.js   1.55 KiB / gzip: 0.44 KiB
dist/assets/libs.b35d0422.js         107.82 KiB / gzip: 35.44 KiB
dist/assets/index.a7196b63.js        215.17 KiB / gzip: 65.31 KiB
dist/assets/react.fbb230d2.js        197.86 KiB / gzip: 60.38 KiB

$ aws s3 sync --delete ./dist s3://aleksei-gurianov-aws-practitioner-public-s3/
upload: dist/assets/dehydrated.2e689d50.js to s3://aleksei-gurianov-aws-practitioner-public-s3/assets/dehydrated.2e689d50.js
delete: s3://aleksei-gurianov-aws-practitioner-public-s3/assets/index.862cdd5d.js
upload: dist/mockServiceWorker.js to s3://aleksei-gurianov-aws-practitioner-public-s3/mockServiceWorker.js
upload: dist/index.html to s3://aleksei-gurianov-aws-practitioner-public-s3/index.html
upload: dist/assets/libs.b35d0422.js to s3://aleksei-gurianov-aws-practitioner-public-s3/assets/libs.b35d0422.js
upload: dist/assets/index.a7196b63.js to s3://aleksei-gurianov-aws-practitioner-public-s3/assets/index.a7196b63.js
upload: dist/assets/react.fbb230d2.js to s3://aleksei-gurianov-aws-practitioner-public-s3/assets/react.fbb230d2.js

Created invalidation to get fresh content:
image

@Guria Guria linked an issue Oct 3, 2022 that may be closed by this pull request
@Guria Guria linked an issue Oct 18, 2022 that may be closed by this pull request
@Guria Guria linked an issue Oct 31, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task 2. Serve SPA in AWS S3 and Cloudfront Services
1 participant