terragrunt

Terragrunt is a thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules.

MIT License

Stars
7.6K
Committers
279

Bot releases are hidden (Show)

terragrunt - v0.35.11

Published by yorinasub17 almost 3 years ago

Description

  • Fixed bug where terragrunt could not handle args passed in as --terragrunt-option=value.

Related links

terragrunt - v0.35.10

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • prevent_destroy

Description

  • Fixed bug where terragrunt was not treating apply -destroy as a destroy operation, so it was not taking into account the prevent_destroy flag.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.35.9

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • run-all
  • --terragrunt-modules-that-include [NEW OPTION]

Description

  • Added new option --terragrunt-modules-that-include for run-all command which will restrict the run-all stack set to only those modules that include the given configuration file. This is useful for driving CI/CD workloads based on updates to common files that are included in child configurations.

Related links

terragrunt - v0.35.8

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • dependency
  • dependencies
  • include

Description

  • Fixed bug where deep dependency merge did not properly merge the config_path when the dependency block was redefined in the child.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.35.7

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • terraform.source
  • auto-init

Description

  • Fixed bug where tfr source did not handle registries that returned absolute URLs.
  • Fixed regression bug where auto-init no longer handled updates to the source attribute of the terraform block.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.35.6

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • include

Description

Warning logs about partial parsing of included configurations have been converted to debug level.

Related links

terragrunt - v0.35.5

Published by yorinasub17 almost 3 years ago

Updated CLI args, config attributes and blocks

  • destroy

Description

Terragrunt will now log parsing errors during the dependency detection phase for destroy at the debug level.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.35.4

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • run-all

Description

Terragrunt will now log the order in which modules are deployed when using run-all, instead of all the modules in the graph including those that are excluded. You can get the old format logs if you use --terragrunt-log-level debug.

Example module

%~> tree .
.
├── account-baseline
│   ├── main.tf
│   └── terragrunt.hcl
└── services
    ├── myapp
    │   ├── main.tf
    │   └── terragrunt.hcl
    ├── mysql
    │   ├── main.tf
    │   └── terragrunt.hcl
    ├── redis
    │   ├── main.tf
    │   └── terragrunt.hcl
    └── vpc
        ├── main.tf
        └── terragrunt.hcl

The following runs are done from the services folder, so we expect the account-baseline to be skipped.

Graph output before

%~> terragrunt run-all apply --terragrunt-non-interactive
INFO[0000] Stack at ~/gruntwork/support/terragrunt-run-all-destroy/proj/services:
  => Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/account-baseline (excluded: false, dependencies: [])
  => Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/myapp (excluded: false, dependencies: [~/gruntwork/support/terragrunt-run-all-destroy/proj/services/mysql, ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/redis])
  => Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/mysql (excluded: false, dependencies: [~/gruntwork/support/terragrunt-run-all-destroy/proj/services/vpc])
  => Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/redis (excluded: false, dependencies: [~/gruntwork/support/terragrunt-run-all-destroy/proj/services/vpc])
  => Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/vpc (excluded: false, dependencies: [~/gruntwork/support/terragrunt-run-all-destroy/proj/account-baseline])

Graph output with this release (apply)

%~> ~/gruntwork/tools/terragrunt/terragrunt run-all apply --terragrunt-non-interactive
INFO[0000] The stack at ~/gruntwork/support/terragrunt-run-all-destroy/proj/services will be processed in the following order for command apply:
Group 1
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/vpc

Group 2
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/mysql
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/redis

Group 3
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/myapp

Graph output with this release (destroy)

%~> ~/gruntwork/tools/terragrunt/terragrunt run-all destroy --terragrunt-non-interactive
INFO[0000] The stack at ~/gruntwork/support/terragrunt-run-all-destroy/proj/services will be processed in the following order for command destroy:
Group 1
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/myapp

Group 2
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/mysql
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/redis

Group 3
- Module ~/gruntwork/support/terragrunt-run-all-destroy/proj/services/vpc

Related links

terragrunt - v0.35.3

Published by yorinasub17 about 3 years ago

Description

Fixed bug where Terragrunt panicked with a nil pointer error for certain configurations.

Related links

terragrunt - v0.35.2

Published by yorinasub17 about 3 years ago

Description

Fixed a regression bug introduced in v0.35.1 where the iam_role config was ignored when managing the s3 state bucket in auto init.

Related links

terragrunt - v0.35.1

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • --terragrunt-iam-role
  • --terragrunt-iam-assume-role-duration
  • --terragrunt-iam-assume-role-session-name
  • iam_role
  • iam_assume_role_duration
  • iam_assume_role_session_name

Description

NOTE: There is a regression bug introduced in this version. We recommend using v0.35.2.

The following bugs related to the assume IAM role features of terragrunt has been fixed:

  • There was a bug in the logic for --terragrunt-assume-role-session-name, where the default session name was always used when the CLI option was not passed in due to the session name being set on the options struct with the default. Now the default is only used if it is not explicitly set by CLI flag or config.
  • There was a bug in the logic for assuming IAM roles in the remote state initialization, where it did not use the session duration or the session name that was set on the CLI. Now the remote state initialization will use the session duration and session name passed through the CLI, if set.
  • There was a bug in the logic for assuming IAM roles for the terragrunt AWS internal helper functions, where it did not use the session duration or the session name from the config or CLI. Now the AWS internal helpers will use the session duration and session name if set.
  • There was a bug in the logic for dependency, where it did not use the session duration or the session name from the config or CLI. Now dependency fetching will use the session duration and the session name if set.

Related links

terragrunt - v0.35.0

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • dependencies [BACKWARD INCOMPATIBLE]
  • dependency
  • include

Description

  • Fixed bug where Terragrunt only took the last include block into consideration for the dependency run graph. Now all dependency blocks defined across all include configurations will be taken into consideration.

Migration guide

As a part of this change, the behavior of how dependencies blocks are merged together in the shallow merge strategy has been updated to be a deep merge - now all the paths defined in dependencies blocks across the included modules are always concatenated together rather than replaced. If you have a configuration that depended on the old behavior, you will need to update your configuration to take advantage of multiple include blocks to selectively include the parent dependencies block.

E.g., if you had the following configurations:

parent terragrunt.hcl

dependencies {
  paths = ["../vpc", "../mysql"]
}

# ... other blocks ...

child terragrunt.hcl

include "root" {
  path = find_in_parent_folders()
}

dependencies {
  paths = ["../new_vpc"] # intended to replace dependencies block in parent
}

# ... other blocks ...

You will want to update to the following:

parent terragrunt.hcl

# ... other blocks ...

dependencies parent terragrunt.hcl

dependencies {
  paths = ["../vpc", "../mysql"]
}

child terragrunt.hcl

include "root" {
  path = find_in_parent_folders()
}

dependencies {
  paths = ["../new_vpc"] # intended to replace dependencies block in parent
}

# ... other blocks ...

child who wants dependencies

include "root" {
  path = find_in_parent_folders()
}

include "dependencies" {
  path = find_in_parent_folders("dependencies_parent_terragrunt.hcl")
}

# ... other blocks ...

Related links

terragrunt - v0.34.3

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • --terragrunt-iam-assume-role-session-name [NEW CLI OPTION]
  • iam_assume_role_session_name [NEW CONFIG ATTR]
  • iam_role
  • dependency

Description

  • Fixed bug where iam_role configuration functionality broke for dependencies.
  • Updated hclfmt to only log files that were updated by the command by default. You can get the original output if you set --terragrunt-log-level debug.
  • Fixed bug where Terragrunt prompts for run-all plan were not shown to the console.
  • Added new configuration option that can be used to set the assume role session name when iam_role is configured.

Special thanks

Special thanks to the following users for their contribution!

  • @denis256
  • @kartikay101
  • @pjuanda

Related links

terragrunt - v0.34.2

Published by yorinasub17 about 3 years ago

Description

  • Updated error messages related to locals parsing.

Related links

terragrunt - v0.34.1

Published by yorinasub17 about 3 years ago

Description

  • Fixed bug where the include related functions were not being correctly parsed when used in locals blocks.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.34.0

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • iam_role [BEHAVIOR CHANGE]
  • get_aws_account_id [BEHAVIOR CHANGE]
  • get_aws_caller_identity_arn [BEHAVIOR CHANGE]
  • get_aws_caller_identity_user_id [BEHAVIOR CHANGE]
  • locals [BEHAVIOR CHANGE]

Description

  • Fixed bug where the iam_role config attribute was ignored when creating the S3 bucket during Auto-Init.
  • Terragrunt now has an additional parsing stage to parse iam_role attribute early, so that it can use it to resolve each of the get_aws_* functions. This means that the get_aws_* functions now return answers after the IAM role has been assumed, whereas before it was always based on the . Note that this additional parsing stage means that locals are parsed an additional time, which may cause side effects if you are using run_cmd in locals, and the args are dynamic so as to bust the cache.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.33.2

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • render-json [NEW CMD]
  • dependency

Description

  • Terragrunt now has a new command render-json which can be used to render the json representation of the fully interpreted terragrunt.hcl config. This can be used for debugging purposes, as well as for enforcing policies using OPA.
  • Reverted the change from v0.32.2, as it is intentional for terragrunt to error out on dependency blocks that have no outputs. If it is desired to allow empty outputs on dependency blocks, you should configure mock_outputs and mock_outputs_allowed_terraform_commands or skip_outputs.

Related links

terragrunt - v0.33.1

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • run-all

Description

  • run-all will now error with a more sensible error message if you are missing the Terraform command that Terragrunt should run on all modules.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.33.0

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • destroy [BEHAVIOR CHANGE]

Description

  • Running destroy on a single module will now check for dependency references that point to that module. If there are any modules that reference the module being destroyed, terragrunt will warn you with the list of modules that point to the module being destroyed and prompt for a confirmation that you are ok destroying the module. To avoid the prompt and restore previous behavior, you can pass in --terragrunt-non-interactive.

Special thanks

Special thanks to @denis256 for their contribution!

Related links

terragrunt - v0.32.6

Published by yorinasub17 about 3 years ago

Updated CLI args, config attributes and blocks

  • include

Description

  • You can now access later stage configuration elements in exposed includes (e.g., inputs) if certain conditions are met. Refer to the updated documentation for more info (specifically, section "Limitations on accessing exposed config").

Related links