DevOps Project - Automate deploying to AWS using Terraform with GitLab CICD pipeline

Поделиться
HTML-код
  • Опубликовано: 2 июл 2024
  • Terraform Pipeline | Gitlab ci cd pipeline AWS | Terraform Project | AWS Terraform
    In this Devops project you will learn how to set up a Terraform ci cd pipeline using gitlab to automatically deploy infrastructure on AWS cloud.
    Throughout this terraform project you will learn all devops best practices used in the industry to learn and Practice Hands on.
    Find the code in GitLab Repository: gitlab.com/N4si/cicdtf
    #devops #aws #terraform
    Connect with me on LinkedIn: / nasiullha-chaudhari
    Helpful resources -
    Terraform tutorial : • Master Terraform in 60...
    CICD explained : • What is CICD Pipeline?...
    Gitlab CICD tutorial : • Learn Complete GitLab ...
    Terraform Official documentation: developer.hashicorp.com/terra...
    Timestamps
    🕒 Intro 0:00
    📝 What is this project 0:04
    🔧 Prerequisites for this DevOps project 0:32
    🛠️ Part 1 of the project (Terraform Code) 03:44
    📂 S3 state backend setup 23:55
    🔧 Part 2 (Gitlab cicd pipeline) 26:02
    🔗 Create Gitlab repository 26:35
    📥 Push the Terraform code to Gitlab 27:37
    🔄 Gitlab CICD pipeline script 29:53
    🔢 Define variable 38:56
    🏃 Pipeline running 45:00
    🎬 Conclusion 49:50
    Also checkout other DevOps projects:
    Devsecops project: • DevSecOps Pipeline Pro...
    Microservices project: • DevOps Project: Video ...
    Simple Terraform Project: • Simple DevOps Project ...
    Kubernetes Project: • Kubernetes Live Projec...
    This terraform pipeline project will teach you how to properly create infrastructure on cloud like aws or azure using cicd tools like gitlab, jenkins or github.
    Setting up cicd pipeline for Terraform is very common best practice followed in devops industry to provision infrastructure.
    Feel free to comment your doubts if you have any :)
    Support my work : www.buymeacoffee.com/cloudchamp
  • РазвлеченияРазвлечения

Комментарии • 109

  • @soumyadipchatterjee2267
    @soumyadipchatterjee2267 4 месяца назад +2

    Mind-blowing & Hat's off to you to showcase this project step by step especially how Gitlab & Terraform hand to hand works in Production 😀❤. I have successfully created the same .

  • @cloudchamp
    @cloudchamp  4 месяца назад +9

    Let's see who can complete this first..... 👀
    Please Like & share :)

  • @oc4618
    @oc4618 3 месяца назад +2

    I love your tutorials. Simpe, clear and straight foward. One of the best tutorial for devops on the net. Please keep them coming

    • @cloudchamp
      @cloudchamp  3 месяца назад

      Thanks! Means a lot!!

  • @kevinjessid
    @kevinjessid 11 дней назад

    parce, como diriamos en Colombia, usted es una chimba! gracias por tus videos! 👍

  • @nnamdizobeashia7320
    @nnamdizobeashia7320 9 дней назад

    men.. i am so amazed at your skill set you need to do a bootcamp.. thank you so much for knowledge shared.

  • @karthickmuthiah7241
    @karthickmuthiah7241 6 дней назад

    Thanks for the wonderful session and project use case. I have implemented it in my home lab.

  • @ahmadqayyum7505
    @ahmadqayyum7505 12 дней назад

    this guy deserves the highest award ever in the field of devops. simplifying such complicated concepts.

    • @cloudchamp
      @cloudchamp  12 дней назад

      🤝🤝

    • @ahmadqayyum7505
      @ahmadqayyum7505 12 дней назад

      @@cloudchamp any problem that I run into regarding my projects and it's like you already know the problem and when I come to RUclips for research the solution is there. I am starting to love DevOps because of you.

    • @cloudchamp
      @cloudchamp  11 дней назад

      @@ahmadqayyum7505 This comment is the reason i create content for!

    • @ahmadqayyum7505
      @ahmadqayyum7505 11 дней назад

      @@cloudchamp thank you so much.

    • @ahmadqayyum7505
      @ahmadqayyum7505 11 дней назад

      @@cloudchamp also can you make a playlist on Kubernetes for beginners, if you haven't made one already???

  • @mhenterprises1873
    @mhenterprises1873 4 месяца назад +1

    Thanks for this devops project 👍

  • @gamingchamp3070
    @gamingchamp3070 4 месяца назад

    Thank you for everything you do

  • @rajvirkaur4411
    @rajvirkaur4411 3 месяца назад +1

    great tutorial. everything is explained in so detail. thank you so much

    • @cloudchamp
      @cloudchamp  3 месяца назад

      You're very welcome!

  • @inthecloud1043
    @inthecloud1043 4 месяца назад +3

    You explain it so perfectly bro 👍

  • @rahulsawant485
    @rahulsawant485 4 месяца назад +2

    Great tutorial, thanks

  • @pinakimukherjee2084
    @pinakimukherjee2084 7 дней назад

    Excellent project. Thank you, bro.

  • @smartengineer4484
    @smartengineer4484 4 месяца назад +2

    This is very much needed project brother 👍

  • @user-pg9yy1un1s
    @user-pg9yy1un1s 2 месяца назад

    Appreciate it, nice work.

  • @ankitkumargupta9753
    @ankitkumargupta9753 2 месяца назад +2

    Crisp, Clear, Amazing, Mind-Blowing
    What a tutorial, Loved It ❤

    • @cloudchamp
      @cloudchamp  2 месяца назад +1

      Glad you liked it

    • @cloudchamp
      @cloudchamp  2 месяца назад +1

      Make sure to share & subscribe 👍🏻

  • @amarnathnachimuthu83
    @amarnathnachimuthu83 4 месяца назад

    Great one! Keep up the good work bro.

  • @RZOLTANM
    @RZOLTANM 3 месяца назад

    Good explanation....really concise and articulate....gets to the point and also explains prerequisite videos and concepts to understand... enjoyed it! Will watch all from the all others... just subscribed!

    • @cloudchamp
      @cloudchamp  3 месяца назад

      Thanks man!
      Happy to help 😀

  • @bouksy
    @bouksy 3 месяца назад

    very interesting video . Gives very good key concepts in a very clear way. I'll put these in practise pretty soon, Thanks!

    • @cloudchamp
      @cloudchamp  3 месяца назад +1

      Let me know how it goes 👍🏻

  • @Djsanddy
    @Djsanddy Месяц назад

    Amazing tutorial brother. Keep up the good work.

  • @AkshaiReddy183
    @AkshaiReddy183 4 месяца назад +1

    Great job bhai 🎉

  • @yogendrahj9365
    @yogendrahj9365 3 месяца назад

    Crisp & Clear. Thanks mate.
    And please dont take me wrong your talking speed has really reduced to good level compared to initial videos and this helps learners like us to understand thoroughly.
    Being in the industry for 6+ years have hardly found good live projects. Please keep them coming!
    Thank you! All the best!

    • @cloudchamp
      @cloudchamp  3 месяца назад

      Thanks for this helpful feedback 😀

  • @mariocortes2670
    @mariocortes2670 4 месяца назад

    Great explanation!

  • @ragavraghu8700
    @ragavraghu8700 Месяц назад

    thank you!

  • @PortgueseProBF3
    @PortgueseProBF3 2 месяца назад

    This is amazing and exactly what I needed except I'm trying to use gitlab it self as backend!

    • @cloudchamp
      @cloudchamp  2 месяца назад

      Glad it was helpful!

  • @techyreport7992
    @techyreport7992 4 месяца назад

    Thank you 🙏

    • @cloudchamp
      @cloudchamp  4 месяца назад

      You’re welcome 😊

  • @chipTuanDuc
    @chipTuanDuc 4 месяца назад +1

    Thanks❤❤❤❤❤

    • @cloudchamp
      @cloudchamp  4 месяца назад

      You are welcome 🤗
      Lmk if you need help or you complete the project 👍🏻

  • @gamingchamp2834
    @gamingchamp2834 4 месяца назад +1

    I will try this project today bro

  • @user-pg9yy1un1s
    @user-pg9yy1un1s 2 месяца назад

    only one Thala @ Abhishek Vermalla

  • @vamshikittu8635
    @vamshikittu8635 4 месяца назад

    Awesome 👌 content bhai and funny thing is when the destroy was running the bgm was perfect sync 😂
    And yes today itself I'll do this project and definitely tag you nasi bhai ❤

  • @mabashadudekula367
    @mabashadudekula367 8 дней назад

    Clear cut explanation do more videos

  • @kauapozzi8629
    @kauapozzi8629 3 месяца назад

    Just took my SAA-003 certification. Watching your videos to conquer my first IT job and portfolio

    • @cloudchamp
      @cloudchamp  3 месяца назад +1

      Best of luck to you brother

    • @kauapozzi8629
      @kauapozzi8629 3 месяца назад

      @@cloudchamp tks bro!

  • @dharshansrsr976
    @dharshansrsr976 4 месяца назад

    19:30 waiting for the second part to create keys as per the flow 😊

  • @ragavand4678
    @ragavand4678 3 месяца назад

    Thank you very much brother.it really helps me to understand how terraform works...

    • @cloudchamp
      @cloudchamp  3 месяца назад

      You are most welcome

  • @kykel4948
    @kykel4948 2 месяца назад

    Fantastic tutorial! Thank you! This really helped. Yours was the most comprehensive explanation I've seen so far and just you breaking down the code of the gitlab-ci file line by line in your review was incredibly helpful. So many tutorials I've watched skim over the important details and skip steps or just fail to elaborate on what their code is doing, which contributes to the confusion. My only confusion and question is about your destroy job.
    How did your destroy job run without a state declared? When I tried to run mine, it would "succeed" but only as a false positive. The destroy job wasn't finding the terraform state from the previous jobs and thinking there were 0 things to destroy. I had to troubleshoot and eventually added the state as an artifact in the apply job which resolved my issues.
    Liked, Subscribed and even bookmarked this particular tutorial!

    • @karthickmuthiah7241
      @karthickmuthiah7241 6 дней назад

      Hi, can you please share the steps of how you added the state as an artifact in yaml file

    • @kykel4948
      @kykel4948 5 дней назад

      @@karthickmuthiah7241 When you write your stages out you need to simply add an artifact path. Each stage of your CI/CD pipeline is going to stand up a new runner container so the runner in your apply stage and destroy stage won't have the terraform state file from the plan stage unless you declare it as an artifact to pass to the next stage.
      Like this:
      stages:
      - validate #simply validate that terraform is available
      - plan #create your plan file and state
      - apply #run your terraform apply
      - destroy #tear down your state build
      Example code:
      plan:
      stage: plan
      script:
      - terraform plan -state=$STATE -out="planfile"
      artifacts:
      paths:
      - planfile
      - state # This artifacts path variable will pass $STATE created in the script command to the next (apply) stage.
      Each stage will need to continue to pass the artifact. So, if you create a state in the plan stage you'll need to declare it as an artifact for apply to have access to it. If you have additional stages (such as destroy used here) then you would also have to declare it as an artifact in your apply stage to ensure that it continues to pass on into your destroy stage. Otherwise, your destroy won't be able to tear down the build from the apply stage as it no longer has that state file. Hope this helps.

  • @tech_channel110
    @tech_channel110 4 месяца назад +1

    Sir give me fyp idea using devops and cloud
    Eg . Cloud infrastructure

  • @harshshah4477
    @harshshah4477 4 месяца назад

    It is a good project to automate the IAC though how can we configure the automation of the BE & FE codebase as well? So that whenever I commit any changes in my code base automation directly updates the code in EC2.

  • @Djsanddy
    @Djsanddy Месяц назад

    can you please do a similar one for github CICD. Thanks a ton

  • @BrandanKing
    @BrandanKing 21 день назад

    Great tutorial! If I am using Windows where do I find where my binaries and dependencies are when defining them (entrypoint) in the gitlab.ci.yml file?

  • @user-ux2hc4zw7x
    @user-ux2hc4zw7x 4 месяца назад

    Bro which tool you used for project documentation in ubuntu 22.04?.

  • @zikou6405
    @zikou6405 4 месяца назад

    apply:
    stage: apply
    script:
    - terraform apply -input=false "planfile"
    dependencies:
    - plan
    the dependencies is not needed since apply and plan are in different stage so if plan stage failed the following stages will fail too
    if we put the plan and apply in the same stage then we need to add the dependecies line

  • @oc4618
    @oc4618 3 месяца назад

    can you explain the 'entry point' value on the gitlab yml. I got a bit lost and wasn't sure how you got that value

  • @OnCloudNine-wv9kv
    @OnCloudNine-wv9kv 3 месяца назад

    While creating the pipeline. 31.53 timestamps. how did you get the image name and the path? i tried looking that in your previous video but coudnt find it. i'd appreciate if you help me here.

  • @user-ux2hc4zw7x
    @user-ux2hc4zw7x 4 месяца назад

    Bro which tool used for documenting in ubuntu!!?.

  • @sjokkz
    @sjokkz 4 месяца назад

    how can i reuse the same pipeline to deploy multiple environments with the same resources?

  • @OnCloudNine-wv9kv
    @OnCloudNine-wv9kv 3 месяца назад

    Did you create s3 and dynamoDB manually or via terraform code?

    • @cloudchamp
      @cloudchamp  3 месяца назад +1

      Manually in this video but also have another terraform backend video where it’s done in terraform 👍🏻

  • @wassellaouini
    @wassellaouini 24 дня назад

    nice video man, i have a question, why didnt you define any triggers? or is the gitlab CI runs automatically when you push on the main branch by default?

  • @guibhai8578
    @guibhai8578 4 месяца назад

    nasi can you share some resource to learn golang

  • @sparshkhandelwal816
    @sparshkhandelwal816 3 месяца назад

    15:09

  • @khaledziraoui5246
    @khaledziraoui5246 3 месяца назад

    Do u have any videos ro learn terraform please for a beginner ,appreciate it

    • @cloudchamp
      @cloudchamp  3 месяца назад

      Absolutely I do, check out the playlist or a 60 mins video

    • @khaledziraoui5246
      @khaledziraoui5246 3 месяца назад

      @cloudchamp Thank you very much ,i will start watching them videos , ,is it possible to learn that in one month for a beginner

  • @jac9886
    @jac9886 Месяц назад

    Excellent video Nasi, it helped me a lot! I just have one question left, in your repository there's a variable TF_VAR_gitlab_token: ${GITLAB_ACCESS_TOKEN} which I was particularly interested in seeing its configuration, but you didn't mention it in the video. Is there another video about it or could you explain it to me here? Thank you very much!

  • @faizanmomin4417
    @faizanmomin4417 4 месяца назад

    Hey, Brother!
    I am also DevOps engineer, Could you please tell me which terminal are you using, It's Looking Good Though!

    • @cloudchamp
      @cloudchamp  4 месяца назад +1

      I am using inbuilt terminal . I have Ubuntu 22 in my local

  • @yogendrahj9365
    @yogendrahj9365 3 месяца назад

    Hi Nasi, i am almost there. But getting state lock error in the destroy stage. Not very sure how i can pass -lock=false for this stage manually. This work fine manually i can run this. Now im running the full pipeline and it started failing in the plan job itself saying state lock. Any leads please?

    • @cloudchamp
      @cloudchamp  3 месяца назад

      You can manually release the lock using terraform force-unlock command with the lock Id.
      -lock=false is not recommended in production environments where you have multiple people working together
      Let me know if still facing issue.

    • @yogendrahj9365
      @yogendrahj9365 3 месяца назад

      @@cloudchamp yes force-unlock is my first choice but silly thing is i am unable to find the lockid either in the error or state file. Below is the error i get if i run plan and cant see lock id. "Error: Error acquiring the state lock

      │ Error message: 2 errors occurred:
      │ * ResourceNotFoundException: Requested resource not found
      │ * ResourceNotFoundException: Requested resource not found



      │ Terraform acquires a state lock to protect the state from being written
      │ by multiple users at the same time. Please resolve the issue above and try
      │ again. For most commands, you can disable locking with the "-lock=false"
      │ flag, but this is not recommended."

    • @yogendrahj9365
      @yogendrahj9365 3 месяца назад

      something silly im missing.

  • @peace___maker
    @peace___maker 3 месяца назад

    Can I do this project in windows 11

  • @heisenberg7049
    @heisenberg7049 3 месяца назад

    Hey bro ur discord link expired can u update it

  • @CHARAN_REDDY18
    @CHARAN_REDDY18 3 месяца назад

    bruh were did you learn devops course

  • @santhoshkumarsg9339
    @santhoshkumarsg9339 13 дней назад

    Instead of calling the child module vpc (source=./vpc) inside web/mani.tf, why did you call source=./vpc inside main.tf (CICDTF/main.tf)
    Kindly explain me this brother..

  • @suresh.beats___
    @suresh.beats___ 4 месяца назад +2

    bro why dont u explain in super putty

    • @cloudchamp
      @cloudchamp  4 месяца назад

      It’s the same when you do it in Linux machine mine is Ubuntu 20

  • @gopalkrishnav2946
    @gopalkrishnav2946 Месяц назад

    You are too fast bro