Static Website Using Cloudfront with S3 Bucket [Terraform]

Поділитися
Вставка
  • Опубліковано 9 січ 2025

КОМЕНТАРІ • 22

  • @mikingarg801
    @mikingarg801 9 місяців тому +1

    Thanks a lot for this Valuable Content. Really Kick started me to start with terraform and successfully deployed the cf +s3 using terraform.

  • @bryanmendoza3919
    @bryanmendoza3919 5 місяців тому +1

    thanks, for the s3 bucket policy i need to update the extension to json, after all no error, thanks for the tutorial

  • @jhoanpalomino9446
    @jhoanpalomino9446 Рік тому +2

    Brother, you helped me a lot! I understood everything and it worked perfectly! Thank you so much.
    I just needed to modify the line policy = data.aws_iam_policy_document.site_origin.json and add the .json at the end because it was expecting an String

    • @openwalnut
      @openwalnut  Рік тому

      glad to hear :) thank you for positive feedback

  • @TamaraHovhannisyan-pl2lu
    @TamaraHovhannisyan-pl2lu 7 місяців тому +1

    Thank You very much.

    • @openwalnut
      @openwalnut  7 місяців тому

      Glad you found it useful :)

  • @kratigupta419
    @kratigupta419 8 місяців тому +2

    Please zoom in a little so that your content is visible..it’s very difficult to watch the video this way

    • @openwalnut
      @openwalnut  8 місяців тому

      will do, thank you for the suggestion :)

  • @theicelandicfamily
    @theicelandicfamily 11 місяців тому +1

    What autocompletion extension are you using? Thanks.

    • @openwalnut
      @openwalnut  11 місяців тому +1

      ohmyzsh for zsh shell

  • @elvincheah6412
    @elvincheah6412 Рік тому

    Hey! Thanks for the tutorial, it was really helpful. But I'm confused because I thought OAC couldn't be used with an s3 static website? According to AWS it says "Before you create and set up origin access control (OAC), you must have a CloudFront distribution with an Amazon S3 bucket origin. This origin must be a regular S3 bucket, not a bucket configured as a website endpoint. "
    Also, could you advise the best way to put multiple files or all files in a folder inside a bucket? I couldn't find anything inside the terraform document that helps with it.

    • @openwalnut
      @openwalnut  Рік тому +1

      hello, glad you have enjoyed the tutorial. yes, OAC cannot be used if you setup S3 as a website endpoint.
      Ref: docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteEndpoints.html
      However, here we do not configure s3 itself as a website endpoint. Cloudfront is the one that is serving the content by grabbing files from the S3 rather than the user directly accessing s3 itself. Check out the reference link for the structure of website endpoint.
      I believe one way to do it would be by using fileset function along with for_each. Look into that :)

  • @clintonamadi6426
    @clintonamadi6426 Рік тому +1

    hey, what extensions are you using for terraform

  • @gokulmahendiran2477
    @gokulmahendiran2477 Рік тому +1

    kindly share the code with me.

    • @openwalnut
      @openwalnut  Рік тому

      coming shortly :) will make into a module and upload to github. Will share the link here after

  • @RuinMind1282
    @RuinMind1282 11 місяців тому

    Source code? plz

    • @openwalnut
      @openwalnut  11 місяців тому

      For sure, github.com/openwalnut/terraform_modules/tree/main/aws_cf_s3_module

  • @DirtySouth33T
    @DirtySouth33T Рік тому +1

    hi thanks for sharing! good video, for some reason in the aws_s3_bucket_policy I actually had to add .json to the end of the policy. how are you able to not use it and I have to use it?
    I was getting this error and it thought it was a string for some reason
    │ 299: policy = data.aws_iam_policy_document.site_origin
    │ ├────────────────
    │ │ data.aws_iam_policy_document.site_origin is object with 7 attributes

    │ Inappropriate value for attribute "policy": string required
    resource "aws_s3_bucket_policy" "site_origin" {
    depends_on = [
    aws_s3_bucket.site_origin
    ]
    bucket = aws_s3_bucket.site_origin.id
    policy = data.aws_iam_policy_document.site_origin.json # had to add .json here
    }

    • @openwalnut
      @openwalnut  Рік тому +1

      hmmm that is a good point, i must have a typo because .json is actually the proper way. i must've fixed the typo but did not record the fix. my apologies :) i will pay more attention in the next video and will add this into description