8 Terraform Best Practices that will improve your TF workflow immediately

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

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

  • @TechWorldwithNana
    @TechWorldwithNana  3 ปีที่แล้ว +22

    Follow me on Instagram for behind-the-scene content 😊 bit.ly/2F3LXYJ
    If you want to support this channel, please leave a like :)
    ▬▬▬▬▬▬ Learn more about Terraform? 🚀 ▬▬▬▬▬▬
    Terraform explained in 15mins ► th-cam.com/video/l5k1ai_GBDE/w-d-xo.html
    Complete Terraform Course for Beginners ► bit.ly/3OCoCPu
    Terraform in complete DevOps process ► bit.ly/3WtBARg
    ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
    0:00 - Intro
    0:25 - Terraform State & State File - Best Practices around State
    1:18 - BP 1: Manipulate state only through TF commands
    1:46 - BP 2: Remote State
    2:44 - BP 3: State Locking
    3:43 - BP 4: Back up State File
    4:23 - BP 5: Use 1 State per Environment
    5:36 - BP 6: Host TF code in Git repository
    6:56 - BP 7: CI for TF Code
    7:39 - BP 8: Execute TF only in an automated build
    8:28 - Wrap Up & More TF Resources
    ▬▬▬▬▬▬ Useful Links 🔗 ▬▬▬▬▬▬
    ► Remote State: www.terraform.io/docs/language/state/remote.html
    ► State Locking: www.terraform.io/docs/language/state/locking.html

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

      Hey Nana, I searched for your terraform course on Udemy but find it but costly considering in Indian currency. Is there anyway I could get some discount on it?

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

      Hi Nana,
      A very nice video on Terraform. Can you also create one a basic Terraform Tutorial video and share your views on it.
      Thanks

  • @andrewmiko3445
    @andrewmiko3445 3 ปีที่แล้ว +82

    - Use remote state with versioning and locking;
    - Use workspace for multiple environments;
    - Use for_each instead of count if it's possible;
    - Never save TF state files in git, they can contain sensitive information in plain text format;
    - Use modules for code reuse (DIY);
    Thanks for a video :)

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

      For bullet 4 - why? If we're speaking in best practice terms, you shouldn't have sensitive information in plain text anyway. This should mitigate any issues with maintaining state files in git, no?

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

      @@lmind2 It could store auto-generated secrets like service account keys. Also if you already have remote state why do you want it on git? It would be a hassle to maintain the current state across your branches.

  • @envZero
    @envZero 3 ปีที่แล้ว +58

    We are honored to sponsor this great video!

  • @Djsanddy
    @Djsanddy 8 หลายเดือนก่อน +4

    one of the best videos that actually shows how big orgs do it. Thanks

  • @MariuszZalewski
    @MariuszZalewski 3 ปีที่แล้ว +6

    Thank you Nana. This is a handful for Terraform beginner developers.
    What I would add from my experience - creating only one state file for one environment can be an issue if the environment has a lot of resources. A bigger state means a much longer plan and apply (and very often more $$$ if someone uses CI/CD as SaaS), so my suggestion is to divide code into workspaces and use state files for each of them. Keep up to 50 resources per state.

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

      Mariusz, I agree with you, for me the most important thing in Terraform is to avoid the Terralith. Terraform code should be split in multiple dimensions: environments, frequency of updates (of infra components), type of resources, permissions (avoid to run with TF with SuperAdmin SAs), providers. The downside when splitting terraform in multiple dimensions is to keep track of the dependencies. I think IaC is still very early stages and needs more automation.

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

      She have already mentioned this point

  • @niravchotai9721
    @niravchotai9721 3 ปีที่แล้ว +20

    - Use workspaces to better organize state files
    - Use pre-commit hooks to do basic Terraform fmt, linting before commiting changes

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

      Hi Nirav,
      I never have used workspaces in real life, I think that if you can use different state files for different environment it wouldn't be necessary. Could you give any reason to use it? I could be wrong.
      Regards

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

      Thanks for sharing Nirav! 👍

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

      actually using workspaces is a pretty bad practice I feel as differents workspaces are juste subset files of a main state so all your states are hosted within a single remote backend, so it becomes a single point of failure, you wouldnt want you prod state deleted by a mistake made on a temp workspace.
      There is a book called terraform up and running published by Oreilly and if I recall well, it is stated toavoid using workspace if you arent doing it on terraform enterprise.

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

      @@lmart7402 Thanks for your reply.

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

      @@lmart7402 what about terragrunt to manage envs?

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

    I just love the way you present the information in your videos! Best videos out there

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

    Danke!

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

      Danke für die Unterstützung Roberto! 💙

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

      Gern geschehen, Nana, deine Kurse sind wundervoll. Schöne Festtage! @@TechWorldwithNana

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

    Nice video, you can also include -:
    Using of TF modules to follow DRY code practices.
    Use of terraform workflows to deploy similar type is multiple environments.
    Securing sensitive variable to output on console.
    Securing state files wherever kept.

  • @muelladresse10
    @muelladresse10 3 ปีที่แล้ว +18

    Hi Nana, I just wanted to give kudos to you for your Terraform course on Udemy. I finished it some weeks ago and I can use my new knowledge in my daily work.

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

      Thank you Tilo for your feedback! It's really great to hear that my course is helpful for your job 😊👍

  • @professorlamp
    @professorlamp 3 ปีที่แล้ว +6

    One thing worth mentioning regarding tfstate and putting your terraform into version control is that you do not want to version control your .tfstate files. These can potentially contain secrets in plain text. The best thing to do in this case is switch to a remote storage method like s3 even if you're not part of a team, just to be on the safe side.

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

    This env0 for both Terraform and DevOps as a whole looks and sounds so cool! Great information there Ms.Nana. Thank you so much!

  • @VijayKumar-xt7es
    @VijayKumar-xt7es 3 ปีที่แล้ว +3

    Using terrform modules instead of repetative resources and pass the required input arguments to this module, this module can also be versioned and kept in git and use tags (with incremental versions eg: v0.1) to refer in the main code. This enhances our code to become better in terms of readability.
    Also, we have to hide the sensitive content in tf output vars ( if any) and donot hardcode sensitive protected info in tf code, instead handle them through CI ( store them as jenkins credentials ), write jpac to read it and pass it as CLI arg to tf commands as needed.

  • @therealpa3ng
    @therealpa3ng 3 ปีที่แล้ว +14

    Thx for sharing! How about a video on managing terraform modules? Or maybe how to separate out IaC for staging, production, and dev environments :)

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

      +1 about terraform modules, and perhaps outputs

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

      +1 that would be a great one, looking forward to it

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

    Amazing best practices, one to add is to create names or identifiers dynamically for the resources that cannot be deployed multiple times, this way you can deploy IaC for features branches to test your changes before merging to the main branch

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

    Just a quick tip regarding remote state. In my practice I'm using state separation per service as well, not just per env.
    For example, gke cluster or cloud SQL tf modules should store their state files within different folders. It could be easily configured in Terragrunt - backend.tf could be generated automatically with required configuration.
    Finally it will look like: /terraform/state/environment/service.
    Usage of terraform workspaces is not a good idea especially with distributed teams. IMHO.

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

    Love your videos as always, concise, precise and crisp, thank you

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

    Terraform modules also one of the best practice to share other terraform users for quick start/update without reinventing or duplicating the terraform code

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

    Love the content, and I’m happy to report that I’ve been following these best practices for several years now.
    Only thing I’d recommend is to use modules as a best practice. It’s just easier to manage components vs one file with all the resources.

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

    Your videos are few in thousands that I enjoy watching till the end.

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

    Hi Nana, you are awesome.the way you explain things is super easy.
    You know what, I became Devops expert only watching your videos.

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

    Perfect timing!

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

    Hi Nana, Thanks for the video. Terra grunt can be use for DRY your terraform configuration across multiple environments.

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

    Great Best Practices Explanation! Really awesome explanation on how to utilize 1 state per environment and how to organize states!

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

    As a newbie to Terraform this is an excellent video, I wasn't aware as yet of most of these items so I've learnt a lot. I still don't know anything about CI/CD so that's my next visit in your library. Thanks

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

    It is a very good practice to set default_tags on aws infrastructure. And also to create a resource group to group easily all cloud resources by filtering on some tags.

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

    Hello Nana.
    Another best practice it's trying to avoid throwing resources to the main files in all the environments that's has the same deployment. This should live in a separate versioned/tagged module allowing to have a standard way to deploy new environments.

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

    I’m actually interested on how to test IaC code.

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

    Stellar content! Can you discuss environment management strategies for Kubernetes workloads leveraging the GitOps model? 🙏🏽

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

    Great job! Love your presentation style and have enjoyed many of your videos over the past year.

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

    Thank you 🙏. Gonna give env0 a try!

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

    Thanks for this great video.
    I would also add the use of Terraform Workspace to separate different environments as best practice. Thoughts?

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

    Yes I Got Best TH-cam Channel For My DevOps Journey

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

    great video Nana, Love all of these

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

    hey, one question regarding the state file for each environment, since I'm creating a state file for each env, is it best practice for all to be in the same bucket with different directories or different buckets? and regarding the dynamodb, should be one db for the state files?

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

    Great video as always. Can you tell me what application did you use for working on the animations in your video?

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

    Great content, I really appreciate your time. I am just curious, what tool do you use to animate your slides?

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

    Very good explanation now i have good idea about TF State. Thanks

  • @Praveenkumar-vg3pn
    @Praveenkumar-vg3pn 3 ปีที่แล้ว

    Your explanations are concise and to the point. Keep creating these videos it helps a lot.

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

    Thanks for this video Nana. One thing I was expecting in this was to organise terraform code in reusable modules.

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

    Hi Nana, great tutorial. Is there a way to get notify when someone in the team execute a terraform plan?

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

    Always like, and Already Subscribed with opening bell icon 😅

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

    Great video!

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

    It is perhaps obvious, but I think it's worth mentioning that auth tokens etc. should not be stored in variables file, but in terraform.tfvars. And this file should not be included in the source project.

  • @Matt-ct5ks
    @Matt-ct5ks ปีที่แล้ว

    Nice video, if you remake please include more about secrets management and what files you don't want to commit to any public repositories.

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

    Hi Nana, may I ask which software are you using to edit such beautiful and interactive videos? Thanks a lot

  • @thomash.8297
    @thomash.8297 3 ปีที่แล้ว +1

    Perfect Nana!

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

    Hi Nana, could you share your source for the popularity statistic of IaC tools at 0:03? I've been looking for something similar for my Bachelors thesis. Thanks in advance

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

    No, when using Amazon S3 as a backend for state file storage, the default state locking mechanism does not automatically utilize DynamoDB, so your statement at 3:27 is not correct.

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

    Nice video. I'm surprised you didn't mention Terragrunt though.

  • @mothman1988
    @mothman1988 3 ปีที่แล้ว +5

    I'm currently using a tool called atlantis, that should be an alternative to env0

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

      env0 supports atlantis workflow and has more features

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

    Awesome!!! Thank you Nana

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

    Does using a repository to host your terraform code eliminates the need to have a dedicated storage for the state file ?
    Or , we use repository to host only the code and after completing the pipelines the new changes will get the latest state and update it ?
    Thanks in advance ^^

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

    Hello Nana
    Great job as usual 👏
    I think there is a another important point to discuss regarding Secrets in plain text
    Thank you 😊

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

    i love this video, thanks for sharing.

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

    Hi Nana, thank you for the great content you produce, what's your preferred choice for testing IaC (terraform in particular)? Thanks

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

    Hi Nana, how do I upgrade argoCD version from 1.5.5 to 1.6? Looking forward to hearing from you

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

    DBAs at my work decided to remove 2 servers and keep number 3,4,5 only
    This was a problem to do it in TF as we use count and count was 5.
    If you changed count to 3 it would remove servers 4 and 5
    So I had to amend the module we had and also change indexing inside the tfstate to make it work

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

    THANK YOU!

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

    Can You please cover What all topics to study for Hashicorp Terraform : Associate Exam

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

    Hello, Your explanation was simply superb and easy to understand as always. As mentioned in this video 4th best practice -> I am using GCS bucket and storing my terraform state file there after every terraform apply but unfortunately I have deleted GCS Bucket and now i have lost state file...Could you please let me know how can I create or get back the terraform state file. Any solution.

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

      According to best practice 6, it is in Git, so according to best practice 8, let the CD put it back, once you have a new bucket. (I know this is theoretical now...)

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

    Great video thanks. Do you have some recommendation on how do we test terraform code in CI/CD pipeline?

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

      terratest ? Which runs your tf code against a empty cloud environment, then terratest interacts with the cloud, to validate whether the freshly provisioned environment meets expectation.
      There are different alternatives to terratest, my understanding is terratest works best with Azure, as it provides better integration with AAD to access the provisioned resources for validation.

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

      use terraform validate to test terraform code

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

    your youtube tutorials are very high-quality content, I wanted to purchase a course and i did for the terraform course, but for the DevOps course it's very expensive, could you consider please some discounts :)

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

    Very useful information 👌

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

    Would request a tutorial series or bootcamp on MLOPS or AIOPS?

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

    Hi Nana, I am struggling to download the latest builded artifact from artifactory which is a war file basically, I have many artifacts on my artifactory repo and I need to download the latest builded one..can you is there any way to do it?unfortunately I’m not using the artifactory pro version which makes it more complicated to do.please help

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

    4:40 you didn’t say how to have multiple state files. I recommend you do it with work spaces.

  • @user-sz5slm
    @user-sz5slm 3 ปีที่แล้ว +3

    Thank you Nana 😎 Since you are using Git, the development process must follow Gitflow, you must have branches for your dev, test and prod environments, and the state files must match those branches. This can be considered a best practice. But everything is learned in practice in a specific project.

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

    Can anyone tell me how to get a software developer job as I am a fresher. And also learning the Devops bootcamp for further knowledge

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

    Hello Nana, yet another great tutorial 👍 But I was just wondering why we couldn’t use git or another scm tool to store stats ?!? 🤔

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

      We should not store state file in SCM as it contains credentials. You can still store but it is not recommended

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

      @@sagarmamidala5242 thanks for the feedback

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

    What do you use to make these nice presentations?

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

    i don't get the best practise having a terraform state file remotely.
    why not use git for that too in order to have "locking" or versioning and a pipeline to push that against a server?
    i don't see why use git for terraform code, but not for state files.
    maybe i am missing something

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

    Hi Nana! why are these courses not available in Udemy Business? :(

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

    thank you Nanaaaaaaaaaaaa Glory to you

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

    Thank you

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

    @TechWorld with Nana you missed security best practises like storing secrets and also terragrunt.

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

    Can you please upload the video on Terraform vs Terragrunt

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

    Good but if you could make complete TERRAFORM video in which case studies to implement in different platforms of technical perspective

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

      Hi Fahad, I have a complete course, in case you want to check it out. Check the video description :)

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

    Woahhhh .! My org follows all of these…

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

      I'd like to say the same, I watched the video 2 years ago and my org still doesn't. I've applied tf as automation on my own but I'll prepare a presentation with the information @TechWorldwithNana gave us 3 years ago to help my org to impact in a good manner the way we are doing things specifically in the cloud.

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

    Nana, are all these tips integrated with the boot camp?

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

      Hi Shailesh, yes they're integrated. You can check out the curriculum!

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

    Thanks but most are best practices everywhere else too. If anyone has been with the computer in a shared environment they would have used a few already especially the locking mechanism

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

    I don't understand point 4 (backing up/versioning terraform state). Isn't the terraform state just supposed to be tracking the actual state of the deployed resources? If that's the case, and it gets nuked, am I not in the same position as I was in before I ran "terraform apply" or "terraform plan" for the first time? Can't I just run "terraform apply" again? Seems to me it's an easily-recomputable resource - so why back it up? (But maybe I'm missing something?)
    And as for versioning state... again, why? I don't see any use case for rewinding to older state (as you seem to suggest) - again (as I understand it) it's just supposed to be a reflection of the current actual deployed state, so rewinding would just make it inconsistent with reality. If you want to rewind your system state, that's what versioning your actual terraform code is for (and yes of course do that!): check out an old version of _that_ and plan/apply. The only purpose I can think of for versioning state is as a historical record for audit purposes (i.e. attesting that "this changed at this time").
    But maybe I'm missing something...?
    Genuinely asking, as I'm relatively new to terraform. Everything else you're saying makes sense to me, so if there's something I'm missing here I'd love to know about it. Thanks!

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

      1. You created VPC -> subnet -> VMs.
      How on the earth terraform will know if you want recreate subnet with terraform taint without 'state'?
      2. You 120+ servers have names server-random suffix (module random string)
      how terraform will know if 99th server should be replaced?

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

    i'm not sure i understand about restoring previous versions of corrupted state files.
    if the state files represent the cloud resources, then using a previous version would mean it will not be in sync with what actually exists in the cloud?
    in regards to using your own TF repository, i have to say i object to that ,(even though it what we do) because in my opinion, tf code should reside in the SAME repo as the application code that uses it, this is because the commit should contain both the resource creation and the code that uses that resource.
    assume a developer needs to establish an event bridge, SQS, SNS and s3 bucket resources, his code would need to address and use them, which would require creating them in advance, which would require devops to do this process, making the developer wait till they are finished, (same goes for changing said resources ) thus making devops a bottle neck
    (yes i'm aware env0 is meant to solve this, but to me it seems kind of an over kill)
    additionally let's say i'm using a new syntax in terraform (like using dynamic blocks) which may not always work, the constant iteration of a build server deploy would THAT bottle neck as it would start queues on these changes.
    and lastly , i'm wondering, if i can combine localStack into this, buy somehow managing the code to be selectively executed on localstack container, (where i want only certain amount of resources created and override all endpoints to my own.

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

      Probably you don't use ring deployment.
      Probably you don't have multiple DCs and rules.
      Probably you never faced the infrastructure changes not related to the code (mostly it has another lifecycle)..
      Probably you never faced the migration - for example your code is not enough to handle 2x rpm and need to create second EventHub or emergency to recreate a SQS.
      Probably you never faced the shut with a buil of the code when you can't release when it needed for infrastructure changes.

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

      @@ValeriySolovyov shut with a buil?

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

      @@emaayan autocorrection:)
      The problems with Artifactory or dependencies(servers or repo shutdown)- when you cannot release a new version but you have an urgent infra changes.

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

      @@ValeriySolovyov yes, but those could happen any way, i"m talking about a system the has it's tf source code and state committed in each repo that uses the code for it, but the process that launches and coordinates it is in one place using Tf remote to access the actual templates, otherwise, what will happen is that your own code will always fall out of sync with cloud resources. I have no idea how it's being managed these days

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

    Nice video but I think you missed the point with GitOps and Terraform, in order to implement GitOps, a tool like Crossplane instead of Terraform must be used (or at least create your own terraform tool)

  • @Jorres-qx1lu
    @Jorres-qx1lu 3 ปีที่แล้ว

    Hey, could somebody please explain to me one thing? Why is it necessary to store `tfstate` file at all? An alternative: just query the provider about what infrastructure it has and use this response result instead of tfstate on the moment of code execution. It would require to implement a small number of additional API for providers, but it reduces so much complexity for the end users...
    I can see only one possible reason - it is difficult to perform locking, when N people simultaneously execute `terraform apply` without state file. But here comes the punchline - since Terraform does not provide this feature out of the box, you still have to enforce mutual exclusion yourself, this reason must not be the actual reason why was it not done!
    As I see it, querying state explicitly would solve all the complexity of maintaining this state shared between team members, which is a SIGNIFICANT complexity if you did not use static file storage in your project before. Literally, WHY???

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

    We didn’t speak about security of secrets!

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

    Probably it's because of Terraform's approach, or because of some restrictions of targeted infrastructure, but solving parallel editing using locking is ridiculous, especially considering reinvention of the wheel; there is "code" in infrastructure as code, and nowadaysr the best solution to maintain the code is using source control.

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

    Wish to have an email connection ☺️
    Also would like to know more about integrating CIs or env0 into PRs.

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

    I am a beginner and I learn HTML CSS and I want to be a Back End Developer
    ( Node js or Spring BooT )
    Please reply me and Thanks 🥰

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

    Another best practise is to use terraform modules, which will allow you to reuse your terraform across all your environments.

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

    Why not just keep your state file on GitHub? You'd get remote access, versioning, conflict resolution system, locking, support for different environments as well as reviewing, CI/CD out of the box.

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

      Terraform state can contain passwords, secrets, and basically all the stuff you don't want to store anywhere in plaintext. That's why when using remote state it's best practice to actually use encrypted storage.

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

    Hi Nana,
    Good work.. Could you please upload reskill Spring and Spring boot videos. It will help the developer to refresh ourselves.

  • @rajesh-ee3bj
    @rajesh-ee3bj 3 ปีที่แล้ว

    hi..nana ..you can make one video for learners...write terraform script and deploy through ci/cd pipeline...please my request...madam .

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

    What is the difference between a software engineer and programmer, even though they both write code

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

    at the end why just dont use git with those state files?

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

    How about secrets management?

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

    Please make full course

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

      Nana has one here: www.udemy.com/course/complete-terraform-course-beginner-to-advanced/

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

    Why didn't you mention in 1st best practice nothing about terraform import, state list, state rm ?

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

    DRY with terragrunt, modules for reuse.

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

    great