Terraform Remote Backend with AWS S3

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 พ.ย. 2024

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

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

    This tutorial saved me lots of pain. Many thanks for sharing

  • @rorycawley
    @rorycawley 3 ปีที่แล้ว

    This is a clear, simple and fast explanation. well done and thank you Sanjeev.

  • @phuletravinh4912
    @phuletravinh4912 2 ปีที่แล้ว

    very clear, simple and I really love your accent

  • @MathoAvito
    @MathoAvito 2 ปีที่แล้ว

    Nice tutorial! Thank you.
    A few words about storage resources, like S3 Bucket, ECR, etc.
    Terraform is not handling very well with resources like that and resources that already exist because of the idea behind it- to create and destroy the resources quickly and efficiently (among other purposes of course).
    With ECR for example, we don't always want to destroy it but if you created it with Terraform, it would try to.
    The best way, in my opinion, of doing that is to create manually (sad, I know) those storage resources and then attach them to Terraform.
    Other ways are pretty messy and could cause a lot of errors and headaches.

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

    Awesome! Please show in a demo project in real life scenario.. Thank You

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

    for my people who are confused why you get an Error 403 when trying to do this (even when you've given the TF provider for AWS credentials) it's because you need the AWS CLI to be configured too. So go and install the cli and then run `aws configure` enter the same credentials (or other ones up to you) and then try again

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

    Thanks sanjeev .This is a good tutorial. How to do the same thing when am deploying the same script to multiple AWS accounts ? Because initially the statefile is stored in s3 bucket in account A, but when I try to deploy the same script in account B ,it fails to refresh the state owing to the user in account B not having access to bucket in account A.

  • @zvirtual1724
    @zvirtual1724 3 ปีที่แล้ว

    Sanjeev thanks for this video. It seems like this would only be used if you wanted to share code with a team, and not for CI/CD environments as you would have to pop in and out of local / remote backend to destroy infra.

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

    Hi Sanjeev, great video! Not sure if I missed this but could you explain why you set the key as global/s3/terraform.tfstate ?

    • @senthildkumar
      @senthildkumar 3 ปีที่แล้ว +4

      we are specific which folder to store the terraform state file. we can use single S3 bucket for multiple projects with different folders.

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

    Awesome tutorial. Works like a charm.

  • @tomiserra8432
    @tomiserra8432 2 ปีที่แล้ว

    Super clear Sanjeev! Thanks

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

    How to setup an s3 backend for multi account setup? The state is not getting updated in the s3 residing in base account after creating resources in target account. Used ec2 with assume role auth for deployment. It initializes the backend and creates the resources but fails to update state and gives access denied error. Please help

  • @andherium
    @andherium 2 หลายเดือนก่อน

    Is it safe to make the bucket name public?

  • @practicaldeen5333
    @practicaldeen5333 3 ปีที่แล้ว

    Thanks again...I have gone through your terraform 2 hr class and it was really helpful...but it cuts short in the end. I wanted to upload a few files into an S3 bucket and I am having issues with the etag setup, filemd5. Can you upload the remaining portion of the class. Also can you create and upload an intermediate to master Terraform class? Thanks.

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

    Phenemenal

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

    Great explanation!

  • @balamuruganchinnasamy9557
    @balamuruganchinnasamy9557 2 ปีที่แล้ว

    Sajeev we need more help on Terraform modules not explained clearly in other videos

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

    Great tutorial! However, the way terraform creates backend-related resources (S3 Bucket, DynamoDB Table) directly is likely to get messed up later. They must be created manually in advance and only referenced in Terraform scripts.

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

    Clean and clear

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

    How to get the deleted services manually from aws console?

  • @markomilosavljevic1123
    @markomilosavljevic1123 3 ปีที่แล้ว

    Thank you very much for the explonantion. However I have a question, what if i have a single terraform configuration for creating S3 bucket, but then reuse the code with everything stay same only i change the AWS region. Because i creating TF configuration to create something, and then i want to recreate same this but in different region , so what i did is creating variable for AWS region and run the TF and created correctly. After that i run it again and then i input different variable for region and get an error that the bucket doesn't exist in new region. I mean i can create 3 copies of same configuration, but if we have 10 developer teams and each team needs to copy configuration from other teams but run in different regions we will have like 100 files in our github repo. Any ideas ? Thanks

  • @koyote265
    @koyote265 4 ปีที่แล้ว

    nice lection mr. could you tell wich tf vscode extention do you use ?

    • @SanjeevThiyagarajan
      @SanjeevThiyagarajan  4 ปีที่แล้ว

      I used marketplace.visualstudio.com/items?itemName=HashiCorp.terraform

  • @flakes57
    @flakes57 4 ปีที่แล้ว

    Where or how do you specify the provider credentials for this scenario?

  • @benjaminshtark5977
    @benjaminshtark5977 2 ปีที่แล้ว

    I use s3 backend with conjunction of terraform workspaces and its really amazing,
    basicly for each backend (statefile) i've got seperate S3 statefile so to delete specific workspace (environment) i just do this
    ## to delete environment
    terraform workspace select
    terraform destroy
    ## to delete workspace after that, so no stale tfstate file left on S3
    terraform workspace select default ## needed becouse you cant delete currently selected workspace
    terraform workspace delete ## will delete Tfstate file on S3

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

    very useful

  • @mertcancam
    @mertcancam 3 ปีที่แล้ว

    Thank you! Great job!

  • @tatemo_labs
    @tatemo_labs 3 ปีที่แล้ว

    nice demo

  • @taranathrakesh
    @taranathrakesh 3 ปีที่แล้ว

    How are the AWS credentials being passed here?

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

      I believe I had aws cli setup. Terraform can pull cetedentials from your aws cli config

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

      But you can pass in credentials anyway u want. U cna use env variables as well

  • @SantiagoFraire
    @SantiagoFraire 3 ปีที่แล้ว

    Where can I download the code? thanks

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

    Error: error configuring S3 Backend: no valid credential sources for S3 Backend found. I am getting this can anyone help

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

    what about dynamo DB config, how is it going to be used by terraform??