CI/CD on AWS with CodePipeline and Terraform

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

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

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

    With a few updates I was able to use your framework with a Terraform:1.4.4 docker image. I was able to build IaC on AWS using your work. Very helpful indeed. Massive thank you!

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

      Hi there, can you please drop a link to the code or a link to your github repo?
      Thanks

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

    Massive thanks for providing this video; helped me create my first AWS pipeline and being able to relate to Jenkins and GitHub Actions!

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

      Hello budy, how are you? I'm brazilian so my english is from a translator! OK?
      how do i use github secrets inside terraform script? I think I need this mechanism to be able to run my terraform inside the pipeline and its container.
      tnks!!

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

    Thanks for making this video. I was able to configure complete terraform pipeline by watching your video.

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

      Did the same code that Dave posted work for you?

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

    Thank you for this video, It helped me a lot to understand the pipeline.

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

    Thank you for making this. Please continue to make more videos.

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

    good job! just a qq question, if you have different projects in your repo, so different codepipeline and codebuild projects (i.e. for backing ami with Packer), since you are using the branch main, how can you avoid to fire all pipelines in your account? I hope I was clear : ) thanks for sharing this video!

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

    Very good demo. Thank you!

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

    Thanks mate. Keep it up, your doing great!

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

    Thanks for such a clear video

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

    Thanks for the video. It is very informative.

  • @Salman-io9sc
    @Salman-io9sc 3 ปีที่แล้ว

    CAN'T THINK ENOUGH ❤️❤️🌨️

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

    Thank you for this straightforward tutorial! I have followed this tutorial and am able to make the pipeline run but the only issue I'm facing is it doesn't trigger automatically whenever I push new changes to my repo. I checked the latest code isn't synced either unless I press 'Release Change'. Which part exactly is triggering the pipeline? I've seen an example on AWS DevOps blog where they use a CloudWatch event to trigger the pipeline run. But I'm unclear on this tutorial of precisely what event is the trigger here. Can anyone help plz?

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

    Great work, really helpful!!. How would I change this from a single account, to a multi account pipeline?

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

    How do we do a terraform destroy with this implementation ?

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

    can anybody help me? how do i inform my access and secret keys for the pipeline?
    i mean, in the buildspec.yaml file i can tell how variables? could any friend help me with this?
    I can run my terraform from my PC normally, but the aws cli with the credentials is installed on it, I believe it is necessary to inform the code pipeline and I imagine it is through my yaml file...
    i am brazilian and i used the translator to try your help.

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

    How will you destroy those resources that were created during the plan phase ?. I would like to destroy all the resources that were created during the different phases at the end of the last phase. Not sure how can you get the reference to those resources that were created within the docker image

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

    at the very beginnig when I am running terraform init i face the following error
    error configuring S3 Backend: no valid credential sources for S3 Backend found.
    can someone please guide me, why I am seeing this and where should I store the credentials?

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

      aws configure

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

      generate the user credentials in IAM and authenticate using "aws configure" in the CMD.

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

    Outstanding

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

    @Davo'clock any reason why we needed to create the s3 bucket outside the codebuild. `lets say what i am trying to acieve is bringup my whole infrastructure using codebuild. so i firest created the code build resource on aws. .Then i create my s3 and dynomo i.e tf-backend-state first using codebuild. then i later create the other resources pointing all of them to my tf-backend-state. with this will i still need to bring up an s3 first. its like bringing up jenkins CICD in my case and then using it to spin up terraform instance

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

      You could create a one time codebuild job that all it does is create an S3 bucket and a dynamodb table. You can then feed those names into your terraform project. This doesn't really buy you much unless you wanted to do this for many accounts/regions at once.
      When you define the backend information for s3, terraform won't let you use variables for bucket name, so you gotta hardcode that value, which makes it isolated from your terraform project right off the bat. Additionally, if you create your codebuild terraform project manually, that removes the ability from managing the pipeline/build project from terraform itself, unless you were to import it, but that's basically doing the same work twice.

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

    Our requirement is tag based trigger. I find this is not possible with aws ci/cd tool ? Any thoughts

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

      Tag updates trigger cloudwatch events, and as you may know, you can do just about anything with events. Here's a paper on the big picture:
      aws.amazon.com/blogs/mt/monitor-tag-changes-on-aws-resources-with-serverless-workflows-and-amazon-cloudwatch-events/
      You can have a lambda function triggered by a tag change (you can specify which tag under what service), which evaluates the tag value, and triggers a pipeline/codebuild/codedeploy action.

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

    in azure I can have plan and apply as tasks in a pipeline,and choose wherever or not to run an apply,is there a way to do that with the setup you've shown here?

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

      Yes, you can either add a manual approval stage before apply, and not approve after plan (so it doesn't apply), or you can disable the plan->apply transition from the pipeline screen

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

      @@davoclock4379 Thank you , will look for how to do that!

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

    what is the version of powershell did you used ?

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

      PS C:\> Get-Host | Select-Object Version
      Version
      -------
      5.1.19041.610

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

    Hero 🏅

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

    Does this code really work? I tried it so many times to no avail. it always fails on codebuild plan phase. Has anyone came across the same issue?

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

      @Rajat ghosh i have fixed it but this code as it is is incorrect.

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

      @@timsamanchi3004
      please can you input i have a fail at the build stage
      After storing my dockerhub credentials on secrets manager still have the same error message
      and i also when forward and generated a secret token on dockerhub, stored it on secret manager and used the private arn still have the same error message.
      Initializing the backend...
      Successfully configured the backend "s3"! Terraform will automatically
      use this backend unless the backend configuration changes.
      Error refreshing state: AccessDenied: Access Denied
      status code: 403, request id: JDMP5M5HVR6WPB2X, host id: /aksGRqbvyfGe8P70kojfn+pzDsVAkC3RbLcusfeqS4ojEi8KNgyW9m4Iukd2lKle/SRgMpz/Qg=
      [Container] 2022/06/10 14:48:11 Command did not exit successfully terraform init exit status 1
      [Container] 2022/06/10 14:48:11 Phase complete: PRE_BUILD State: FAILED
      [Container] 2022/06/10 14:48:11 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: terraform init. Reason: exit status 1

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

      @Rajat ghosh
      After storing my dockerhub credentials on secrets manager still have the same error message
      and i also when forward and generated a secret token on dockerhub, stored it on secret manager and used the private arn still have the same error message.
      Initializing the backend...
      Successfully configured the backend "s3"! Terraform will automatically
      use this backend unless the backend configuration changes.
      Error refreshing state: AccessDenied: Access Denied
      status code: 403, request id: JDMP5M5HVR6WPB2X, host id: /aksGRqbvyfGe8P70kojfn+pzDsVAkC3RbLcusfeqS4ojEi8KNgyW9m4Iukd2lKle/SRgMpz/Qg=
      [Container] 2022/06/10 14:48:11 Command did not exit successfully terraform init exit status 1
      [Container] 2022/06/10 14:48:11 Phase complete: PRE_BUILD State: FAILED
      [Container] 2022/06/10 14:48:11 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: terraform init. Reason: exit status 1

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

      @@timsamanchi3004 hey, I have the same issue within the plan phase but haven't been able to fix it. The only alert is that there is a deprecated syntaxis but that is. Not getting more crucial errors/ Please, let me know. Appreciate

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

      @@timsamanchi3004 pls how did you fix it

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

    The skillful feeling simultaneously man because otter finally exercise inside a shocking earthquake. spotted, wicked music