terragrunt | thin wrapper for Terraform that provides extra tools | Infrastructure Automation library

 by   gruntwork-io Go Version: v0.47.0 License: MIT

kandi X-RAY | terragrunt Summary

kandi X-RAY | terragrunt Summary

terragrunt is a Go library typically used in Devops, Infrastructure Automation, Terraform applications. terragrunt has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Terragrunt is a thin wrapper for Terraform that provides extra tools for keeping your Terraform configurations DRY, working with multiple Terraform modules, and managing remote state.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              terragrunt has a medium active ecosystem.
              It has 6862 star(s) with 873 fork(s). There are 123 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 550 open issues and 1241 have been closed. On average issues are closed in 64 days. There are 52 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of terragrunt is v0.47.0

            kandi-Quality Quality

              terragrunt has 0 bugs and 0 code smells.

            kandi-Security Security

              terragrunt has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              terragrunt code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              terragrunt is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              terragrunt releases are available to install and integrate.
              It has 38640 lines of code, 1175 functions and 441 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of terragrunt
            Get all kandi verified functions for this library.

            terragrunt Key Features

            No Key Features are available at this moment for terragrunt.

            terragrunt Examples and Code Snippets

            No Code Snippets are available at this moment for terragrunt.

            Community Discussions

            QUESTION

            Terraform: Mutliple providers, each with its own statefile
            Asked 2022-Feb-21 at 16:01

            I know it's possible to combine multiple providers in a single Terraform project.

            Would it be possible though, to declare different statefile per provider? In our use-case we will be deploying infrastructure with its part in the client's cloud provider account and other part within our cloud provider account.

            We'd like to keep the statefiles separated (client's TF state vs our TF state), in order to allow smoother future migrations of either our part of the infra or client's part of the infra.

            We also know that this can be achieved using Terragrunt on top of Terraform, but for the moment we'd prefer to avoid introducing a new tool into our stack. Hence looking for a TF-only solution (if such exists).

            ...

            ANSWER

            Answered 2022-Feb-21 at 16:01

            The simplest solution would be to use separate folders for your and your client's infrastructure.

            Is there a specific reason why you would want to keep them in one folder? Even if you need to share some values, you can easily read them by using terraform_remote_state

            Source https://stackoverflow.com/questions/71209215

            QUESTION

            How to run checkov scan on terraform plan
            Asked 2022-Feb-18 at 12:17

            I would like to have checkov scan terraform plan output but I am not getting any success with that.Below is my code in terragrunt.hcl,GitHub Actions workflow and the message I got when my workflow completed.I have tried few methods to have it work but I am still unable to configure it correctly so that checkov can analyse the Json output of terraform plan.I would appreciate any help that I can get on this.Thank you for your assistance inadvance

            ...

            ANSWER

            Answered 2022-Feb-18 at 12:17

            I guess it doesn't support however you can try this

            Source https://stackoverflow.com/questions/70601192

            QUESTION

            Terragrunt provider.tf generation not generating files
            Asked 2022-Feb-04 at 02:23

            The expectation is that when running a terragrunt run-all apply from the root directory, a provider.tf file will be created in the sub directories. I've verified my backend is able to talk to my azure storage account and it will create a terraform.tfstate file there. I expect a provider.tf file to appear under each "service#" folder. I'm extremely new to terragrunt. This is my first exercise with it. I am not actually trying to deploy any terraform resources. Just have the provider.tf file created in my sub directories. TF version is 1.1.5. Terragrunt version is 0.36.1.

            my folder structure

            ...

            ANSWER

            Answered 2022-Feb-04 at 02:23

            I got it to work, but the terragrunt run-all apply command doesn't work at all. Instead, at the root I have to run terragrunt apply. If you don't at the root, then all sub folders get grouped together rather than in a dev/prod sub folder. Then I have to go to every sub folder and run this again. It's the only way i've gotten it to work.

            Source https://stackoverflow.com/questions/70966214

            QUESTION

            Terraform - Append a string to an object in a for_each
            Asked 2022-Jan-26 at 22:25

            How do I go about appending the /* to the end of an object using for_each? The goal is to have Terraform to go through the list of resource_arns and add /* to the end. However, I'm currently getting the error, "invalid template interpolation value".

            If I have resources = each.value.resource_arns, then Terraform is able to create the resource, but it would just be without /*, which is not desired.

            The desired outcome would be to have the resource created as:

            ...

            ANSWER

            Answered 2022-Jan-26 at 22:24

            You have to iterate over resource_arns:

            Source https://stackoverflow.com/questions/70870881

            QUESTION

            Terragrunt - variables declarations
            Asked 2021-Dec-30 at 18:17

            I have a two directories: in first one I'm keeping modules (basically terraform template configurations) in the second one I'm keeping terragrunt modules implementations. In the second one there is a terragrunt hcl file with inputs inside (one for every particular project). So far I declared variables in modules directory (in variables.tf) but I don't like that as variables change depending on the implementation (project). So keeping all variables (for all projects) in the modules dir seems to be not the best idea.

            My question is: how can I declare those variables on the terragrunt (aka implementations) level? Is a generate function way to go?

            ...

            ANSWER

            Answered 2021-Dec-30 at 18:17

            You can use HCL files to store you variables on Terragrunt level. For instance, keep you project level variables in config.hcl:

            Source https://stackoverflow.com/questions/69810202

            QUESTION

            How to do user input in Jenkisfile to carry on with terraform apply?
            Asked 2021-Dec-30 at 14:14

            I'm running a Jenkins pipeline job using Jenkinsfile. The primary purpose is to run terraform , based on the choice parameter to select either plan or apply, like this:

            ...

            ANSWER

            Answered 2021-Dec-29 at 17:33

            You can use terraform apply -auto-approve within your Jenkins Job.

            See Docs

            Tip: You can add condition in Jenkins stage() when a user choose parameter plan than there will be no -auto-approve option added automatically, else the command will append -auto-approve option.

            Source https://stackoverflow.com/questions/70521477

            QUESTION

            Iterate over list of maps
            Asked 2021-Dec-08 at 22:45

            I'm trying to iterate over a simple list of maps. Here's a segment of what my module code looks like:

            ...

            ANSWER

            Answered 2021-Dec-08 at 22:45

            If you are using for_each in dynamic blocks, you can't use each. Instead, in your case, it should be set:

            Source https://stackoverflow.com/questions/70282327

            QUESTION

            How to make a GitHub Actions workflow dry
            Asked 2021-Dec-07 at 10:41

            Is it possible for a workflow to depend on another workflow?

            I currently have 2 workflows for my test branch.The first is github_action_pull_test.yml that is triggered by a pull_request.When there is a pull_request on the test branch the workflow run to terragrunt plan.The second is github_action_push_test.yml that is triggered when there is a merge to my test branch,the workflow run terragrunt apply.

            The current setup has one negative effect: my github_action_push_test.yml include all the steps in the github_action_pull_test.yml. Is there a way I can have one workflow that include all the steps but only run terragrunt apply after terragrunt plan has been reviewed and merged into the test branch so i can avoid duplications

            ...

            ANSWER

            Answered 2021-Dec-07 at 10:41

            You can make first trigger second:

            Source https://stackoverflow.com/questions/70221020

            QUESTION

            "Invalid legacy provider address" using terragrunt
            Asked 2021-Dec-02 at 01:01

            I am hoping someone can help me with an issue I am having with Terraform/Terragrunt. The versions of each that I am currently using are:

            • Terragrunt v0.35.9
            • Terraform v1.0.11

            I am using Terragrunt to deploy project related infrastructure to GCP. I have two seperate Terragrunt projects to split out variables between a test and a production instance of the same GCP solution.

            When I run the commands terragrunt init or terragrunt plan -out tf.plan using the test .hcl file, the process completes as expected. However when I run either of these commands using the production .hcl file, I get the following error:

            ...

            ANSWER

            Answered 2021-Dec-02 at 01:01

            You seem to have a latest state snapshot that was created with Terraform v0.12 or earlier. That would mean that it would be storing provider configuration references in an older form that Terraform v1.0 and later don't support anymore.

            For your immediate work I'd suggest just figuring out which Terraform version this configuration's associated state was created by and using the latest patch release of that version to do your work, so you can avoid doing any immediate upgrade work. To do that, find your current Terraform state snapshot (refer to the backend configuration to see where it's stored), which will be a JSON data structure stored somewhere configured either in the Terraform configuration or in the Terragrunt configuration.

            In that JSON object there will be a top-level property called terraform_version which will map to a string like 0.11.2, or 0.12.3, or similar. Take the first two elements of that version number as the Terraform major release and then refer to the list of available versions and find the newest version with the same major release number. For example, if you found 0.11.2 in your state file then at the time of writing you'd select Terraform 0.11.15, because that's the newest release in the v0.11 series.

            You should then be able to use that version of Terraform to work with your current Terraform configuration and state.

            Once you know which version your configuration is currently expecting and you're ready to upgrade, you can consult the Terraform v1.0 upgrade guide to see the recommended steps to get from whatever version you are currently using to a version after the v1.0.0 release, after which you can select the latest v1.*.* moving forward because they are all subject to compatibility promises after that point.

            In particular, the v1.0 upgrade guide links to the earlier guide to move from v0.12 to v0.13, which includes steps to move beyond the error message you included in your question. (That is "the Terraform 0.13 upgrade process" that the error message is referring to.)

            Source https://stackoverflow.com/questions/70123365

            QUESTION

            How to use managed policy with iam role
            Asked 2021-Nov-23 at 12:41

            I am using terragrunt to call my terraform module.I have one terragrunt.hcl for my dev and another for testing environment.I would like to be able to attach AWS Managed policy(AdministratorAccess) to my Dev account and (AmazonEC2FullAccess) to my testing account using input variable so that I can remove the policy line in my aws_iam_role_policy section

            ...

            ANSWER

            Answered 2021-Nov-23 at 12:41

            I'm not sure to fully understand your question. You cannot attach an IAM Policy to an account. However, you can attach it to an IAM Role which seems to be your goal here? If yes, you can use a data source:

            Source https://stackoverflow.com/questions/70074675

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install terragrunt

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/gruntwork-io/terragrunt.git

          • CLI

            gh repo clone gruntwork-io/terragrunt

          • sshUrl

            git@github.com:gruntwork-io/terragrunt.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Infrastructure Automation Libraries

            terraform

            by hashicorp

            salt

            by saltstack

            pulumi

            by pulumi

            terraformer

            by GoogleCloudPlatform

            Try Top Libraries by gruntwork-io

            terratest

            by gruntwork-ioGo

            cloud-nuke

            by gruntwork-ioGo

            git-xargs

            by gruntwork-ioGo

            bash-commons

            by gruntwork-ioShell

            fetch

            by gruntwork-ioGo