Deploy React App to CloudFront with HTTPS Custom Domain

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ค. 2024
  • Learn how to deploy a react app, or any static website, to a Cloud Front distribution custom domain name and SSL Certificate.
    Chapters:
    0:00​ Intro
    0:59 Building the react app
    1:35 Create an S3 bucket
    2:37 Create CloudFront Distribution
    4:16 Custom Domain Name
    5:19 SSL Certificate
    7:08 DNS Record in Route 53
    8:26 Custom Error Page for React
    10:46 Updating the Website
    12:05 CloudFront Invalidate Files
    13:06 AWS CLI
    aws s3 sync directory-path "s3://your-bucket-name/"
    aws cloudfront create-invalidation --distribution-id your-distribution-id --paths '/*'
    🔗Route 53 Domain Name
    • AWS Route 53 Domain Name
    🔗 AWS CLI
    • Setting Up The AWS CLI
    🔗S3 Static Website AWS CLI
    sammeechward.com/aws-cli-s3-s...
    🔗Moar Links
    My Website: www.sammeechward.com
    Instagram: / meech_ward
    Github: github.com/orgs/Sam-Meech-Ward
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 50

  • @PurelyDef
    @PurelyDef ปีที่แล้ว +8

    Thank you for this video. For anyone following along, as of 3/24/23 they've replaced "Origin Access Identity" with "Origin access control settings (recommended)". The steps are roughly the same, but you have to copy the bucket policy, then go into your s3 bucket and paste it in yourself, because of course aws can't just leave things the way they are for longer than a few months

    • @brunoaustin9756
      @brunoaustin9756 ปีที่แล้ว

      do i really need an ssl certificate? because its taking too long to be issued. plus i want the url to be custom

    • @mikefdorst
      @mikefdorst 11 หลายเดือนก่อน

      @@brunoaustin9756 If you don't have an SSL certificate, when people go to your website it will notify them that it's not secure. So it's nice to have it. It shouldn't take longer than 3 days to get issued.

  • @jackmu3603
    @jackmu3603 5 หลายเดือนก่อน

    Thanks Sam, this video was a great help. Love how you explain all of the steps

  • @morph442
    @morph442 11 หลายเดือนก่อน

    Awesome tutorial, very hands-on. Thanks a lot! No open questions

  • @nicholasfray9193
    @nicholasfray9193 ปีที่แล้ว

    Helped out a ton, and learned a lot. Thanks my dude.

  • @GauravSingh-747
    @GauravSingh-747 ปีที่แล้ว

    Thankyou so much for this video it really helps me to deploy my company project on AWS…thank you once again

  • @maksymchumak6583
    @maksymchumak6583 2 ปีที่แล้ว +3

    Great tutorial, very helpful!

  • @totachava6235
    @totachava6235 2 ปีที่แล้ว +2

    U have the best real world tutorials,thank you very much :)

  • @manfung6333
    @manfung6333 ปีที่แล้ว

    Really thanks to what you did! it really helps!

  • @austinejose1516
    @austinejose1516 9 หลายเดือนก่อน

    Very well explainer, Thank you!

  • @user-pb3nv7id8g
    @user-pb3nv7id8g 9 หลายเดือนก่อน +2

    @6:40 I had to change the "Default root object" to index.html instead of /index.html else you may get an "Access denied" error. Awesome explanation of course!

    • @user-yo2xq1rq3u
      @user-yo2xq1rq3u 8 หลายเดือนก่อน

      I still get the "Access denied" error after removing the "/". By the way, the previous domains work well the `/index.html`.

    • @monkeque911
      @monkeque911 20 วันที่ผ่านมา

      Thank you very much! I spent literraly the whole day figuring it out why I'm still getting 403 ...

  • @EddieMao
    @EddieMao 4 หลายเดือนก่อน

    Great great video, thanks a lot, subscribed!

  • @excelpowerg9559
    @excelpowerg9559 ปีที่แล้ว

    Gracias, video helped me fixed two issues i was having. One with Route 53, couldn't find my CloudFront resource after i created my simple policy record, which was a by product of the second issue, i failed to assign CloudFront my SSL certificate within the distribution settings. After doing those two things everything else was smooth.

  • @renao_
    @renao_ 4 หลายเดือนก่อน

    awesome video, thank you

  • @user-wd4cq4mp9o
    @user-wd4cq4mp9o ปีที่แล้ว

    so thanks of u bro it's very helpful

  • @javv1748
    @javv1748 3 หลายเดือนก่อน

    Excelente video

  • @lukagamulin9496
    @lukagamulin9496 ปีที่แล้ว

    this was awesome!

  • @SushilSharma-vp8cx
    @SushilSharma-vp8cx 11 หลายเดือนก่อน

    Good work mate. I saw configure it through legacy OAI option is there any other way to implement cloudfront for you buckets ?

  • @ellmango
    @ellmango ปีที่แล้ว

    i got it working thank you. only thing i dont have working is that www doesnt direct to the cloudfront distribution

    • @fiddler-dv4or
      @fiddler-dv4or ปีที่แล้ว

      Yeah. I'm having the same problem too. Did you get this working, Corkpop?

  • @ashishwaykar2838
    @ashishwaykar2838 7 หลายเดือนก่อน

    at 11:49 the reaction for quote with se* noticable 😂😂

  • @cdialpha
    @cdialpha ปีที่แล้ว

    Not sure if this matters, should you use a lower S3 storage class (e.g. Standard-IA, One Zone-IA) for the build files? Assuming that (1) you're relying on free teir and (2) it's for a personal site, you might not update them that frequently ?

    • @SamMeechWard
      @SamMeechWard  ปีที่แล้ว

      I guess it really depends on each use case. If you know how your data will be accessed and you have specific needs, then a different storage class would be good. So if your personal site was rarely accessed by anyone Standard-IA might be good. But i've never tested these out thoroughly so I can't make any good recommendations.

  • @fullViewJay
    @fullViewJay ปีที่แล้ว

    I tried this process but I am getting a 405 error. I built a full-stack app with mongoDb as the backend

  • @matthewigbinehi1610
    @matthewigbinehi1610 4 หลายเดือนก่อน

    For the problem of stressful update, is it not more efficient to use Amplify instead of S3 bucket? Then continuous deployment is possible using Github as connection to Amplify

  • @kyoukai9379
    @kyoukai9379 6 หลายเดือนก่อน

    does the domain name has to be from route53 or any domain name from any provider would be fine ?
    also what would be the cost of all that excluded the s3

  • @pelaoinfo
    @pelaoinfo ปีที่แล้ว +2

    it doesn't work when I refresh the page any suggestions?

  • @wonderkiev
    @wonderkiev ปีที่แล้ว

    Any ideas how add www redirect? Thanks

  • @babytoystv1909
    @babytoystv1909 4 หลายเดือนก่อน

    what happens if the server is restarted, how can i do it? my website is not showing up after restarted

  • @marcosmli
    @marcosmli 9 หลายเดือนก่อน

    How do you invalidate browser cache?

  • @sitefleek
    @sitefleek ปีที่แล้ว +1

    I am getting served this error when i try to access my domain: This XML file does not appear to have any style information associated with it. The document tree is shown below.
    AccessDenied
    Access Denied
    PH0W267ETFMT2Y4H
    ckUFCC1qH8/wYNJR5HmrKV7bCkHLjkMto7ov7mVnhufdIdKFLMI1aETc0d09S9scmlVwRKsquC0=

    • @krish420
      @krish420 ปีที่แล้ว

      same, have you found any fix?

    • @sitefleek
      @sitefleek ปีที่แล้ว

      @@krish420 yes, I had to change the permissions to the s3 bucket. For some reason if i only allowed cloudfront the access to my bucket, it gave this error. when I allowed open to all access to the s3 bucket, the error went away.

    • @krish420
      @krish420 ปีที่แล้ว

      @@sitefleek I also have some env elements do you know how to implement them?

  • @marcosmli
    @marcosmli 9 หลายเดือนก่อน

    Dumb question, why two Route53 records?

  • @dmitrymatio
    @dmitrymatio 2 ปีที่แล้ว +1

    All for me

    • @SamMeechWard
      @SamMeechWard  2 ปีที่แล้ว +2

      Look at that nice community badge thing

  • @ursnj
    @ursnj ปีที่แล้ว

    Getting 403 access denied, anything im missing ???

    • @bwanamaina
      @bwanamaina ปีที่แล้ว +1

      go to cloudfront settings, add custom error messages, add error 403 , redirect it to /index.html with status code 200 ok. This should fix your issue.

    • @thanosavg9273
      @thanosavg9273 ปีที่แล้ว +2

      Update the bucket policy provided by CloudFront after creating the distribution

    • @quentinepitech
      @quentinepitech ปีที่แล้ว

      @@thanosavg9273 even after this i still have the forbiden... any ideas ??

    • @andrewd.1118
      @andrewd.1118 ปีที่แล้ว

      @@quentinepitech th-cam.com/video/-ZiirF7ap5U/w-d-xo.html

    • @prerakhere
      @prerakhere 7 หลายเดือนก่อน

      @@bwanamaina worst advice ever.

  • @hash510
    @hash510 9 หลายเดือนก่อน

    today , aws cloudfront has other options to create distribution... It's useless

  • @Juan88888
    @Juan88888 2 วันที่ผ่านมา

    thanks so much