Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove all usage of get-plugins=false which is removed in 0.15.0 #1618

Merged
merged 1 commit into from Mar 29, 2021

Conversation

davidalger
Copy link
Contributor

The optimization from #1321 added use of -get-plugins flag when calling terraform init. This flag is removed in Terraform 0.15.0-beta1, and has been a no-op since 0.13.0:

From the changelog for Terraform v014.3:

terraform init: setting -get-plugins to false will now cause a warning, as this flag has been a no-op since 0.13.0 and usage is better served through using provider_installation blocks (#27092)

From the changelog for Terraform v0.15.0-beta1:

The -get-plugins=false option is no longer available on terraform init. (Terraform now always installs plugins.) (#27463)

Due to the use of this, when running Terraform 0.15.0-beta1 or later, Terragrunt will fail with a rather uninformative error from Terraform bubbling up:

davidalger@silver-bullet:~/work/algerdev (master) $ find . -type d -name .terragrunt-cache -exec rm -rf {} +
davidalger@silver-bullet:~/work/algerdev (master) $ (cd live/traefik; terragrunt init)
╷
│ Error: Initialization required. Please see the error message above.
│ 
│ 
╵
╷
│ Error: Initialization required. Please see the error message above.
│ 
│ 
╵
ERRO[0002] exit status 1                                

A trace reveals the error, silelently ignored by Terragrunt:

DEBU[0000] Running command: terraform init -get=false -get-plugins=false  prefix=[/Users/davidalger/Work/algerdev/live/project] 
DEBU[0001] Ignoring expected error from dependency init call  prefix=[/Users/davidalger/Work/algerdev/live/project] 
DEBU[0001] Init call stderr:                             prefix=[/Users/davidalger/Work/algerdev/live/project] 
DEBU[0001] Usage: terraform [global options] init [options]

  Initialize a new or existing Terraform working directory by creating
  initial files, loading any remote state, downloading modules, etc.

  This is the first command that should be run for any new or existing
  Terraform configuration per machine. This sets up all the local data
  necessary to run Terraform that is typically not committed to version
  control.

  This command is always safe to run multiple times. Though subsequent runs
  may give errors, this command will never delete your configuration or
  state. Even so, if you have important information, please back it up prior
  to running this command, just in case.

Options:

  -backend=true        Configure the backend for this configuration.

  -backend-config=path This can be either a path to an HCL file with key/value
                       assignments (same format as terraform.tfvars) or a
                       'key=value' format. This is merged with what is in the
                       configuration file. This can be specified multiple
                       times. The backend type must be in the configuration
                       itself.

  -force-copy          Suppress prompts about copying state data. This is
                       equivalent to providing a "yes" to all confirmation
                       prompts.

  -from-module=SOURCE  Copy the contents of the given module into the target
                       directory before initialization.

  -get=true            Download any modules for this configuration.

  -input=true          Ask for input if necessary. If false, will error if
                       input was required.

  -no-color            If specified, output won't contain any color.

  -plugin-dir          Directory containing plugin binaries. This overrides all
                       default search paths for plugins, and prevents the
                       automatic installation of plugins. This flag can be used
                       multiple times.

  -reconfigure         Reconfigure the backend, ignoring any saved
                       configuration.

  -upgrade=false       If installing modules (-get) or plugins, ignore
                       previously-downloaded objects and install the
                       latest version allowed within configured constraints.

  -lockfile=MODE       Set a dependency lockfile mode.

Full trace can be found here: #1577 (comment)

Setting disable_dependency_optimization to true workaround the problem as it disables the optimization which introduced use of the deprecated argument to terraform init.

The changes here have resolved the underlying for me in local tests and in our CI where I was testing the use of 0.15.0 betas, and the tests changed continue to pass:

davidalger@silver-bullet:.../terragrunt/remote (develop) $ go test -v -run TestDependencyOutputOptimization
testing: warning: no tests to run
PASS
ok  	github.com/gruntwork-io/terragrunt/remote	0.254s
davidalger@silver-bullet:.../terragrunt/remote (develop) $ go test -v -run TestDependencyOutputOptimizationNoGenerate
testing: warning: no tests to run
PASS
ok  	github.com/gruntwork-io/terragrunt/remote	0.217s

Copy link
Member

@brikis98 brikis98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! I'll kick off tests now.

@brikis98
Copy link
Member

Tests passed! Merging now.

@brikis98 brikis98 merged commit 15f054d into gruntwork-io:master Mar 29, 2021
@davidalger davidalger deleted the cleanup-obsolete-flag-use branch March 29, 2021 15:32
@brikis98
Copy link
Member

@davidalger
Copy link
Contributor Author

Thanks @brikis98

teamfighter added a commit to teamfighter/terragrunt that referenced this pull request Apr 5, 2021
* Fix dead link in multiple aws accounts docs (gruntwork-io#1563)

* Fix dead link in multiple aws accounts docs

The link to AWS docs is now 404.
The corrected link seems to most closely resemble the intended target.
Other options to consider:
https://aws.amazon.com/organizations/getting-started/best-practices/
https://docs.aws.amazon.com/controltower/latest/userguide/aws-multi-account-landing-zone.html

* Link to AWS best practices for multi account docs

* Whitespace removal (gruntwork-io#1573)

* Fix empty outputs (gruntwork-io#1568)

If stack run finished without errors, `summarizePlanAllErrors()`
receives empty buffer and outputs empty line. This change ensures that
only non-empty outputs are getting logged.

Related: gruntwork-io#1541

* doc: contributing: fix broken link to circleci (gruntwork-io#1580)

* Bump AWS SDK to version v1.37.7 to support AWS SSO (gruntwork-io#1537)

* Add TargetPrefix as config input to access bucket logging (gruntwork-io#1507)

* adding target-prefix ro access bucket logging

* Updating test & example

! Note that this needs the terratest PR (gruntwork-io/terratest#767) to be merged in to work & be tested.

* Updating Terratest dependency

* testing for target prefix

* Updating docs

* Renaming folder

* Updating to Debugf

* Adding default value

* WIP - parsing for TFstatelogs

* Updating logic & docs

* Adding a new test for default TargetPrefix in remote backend config

* Introduce validate-inputs, which can be used to check for variable alignment (gruntwork-io#1572)

* Introduce terragrunt-input-info, which can be used to check for variable alignment

* Apply suggestions from code review

Co-authored-by: Zack Proser <zackproser@gmail.com>

* Tidy go modules

* Renamed input-info to validate-inputs

* Switch missing required vars to errors

* Handle -var and -var-file args

* Update cli/validate_inputs.go

Co-authored-by: Yevgeniy Brikman <brikis98@users.noreply.github.com>

* Make sure to check for dynamically passed in CLI args

* Fix build

* Handle automatically loaded var files

* Remove plan args check

* Clarify difference between getTerraformInputNamesFromVarFiles and getTerraformInputNamesFromCLIArgs

* Address PR nit to move example in docs

Co-authored-by: Zack Proser <zackproser@gmail.com>
Co-authored-by: Yevgeniy Brikman <brikis98@users.noreply.github.com>

* Use go1.16 to build arm64 binaries (gruntwork-io#1585)

* Bump creack/pty to 1.1.11 (gruntwork-io#1582)

Co-authored-by: Andy Bohne <andrew.bohne@ring.com>

* Add ability to specify working directory of hooks (gruntwork-io#1588)

* Add ability to specify working directory of hooks

* Fix build

* Support dynamodb_endpoint attribute of S3 backend (gruntwork-io#1586)

* Clarify non-interactive will not include external dependencies (gruntwork-io#1593)

* add getTerragruntSource helper function (gruntwork-io#1575)

* add getTerragruntSource helper function

* update docs

* update docs and tests for get_terragrunt_source_cli_flag() function

* add use cases for get_terragrunt_source_cli_flag

* Recursively extract forcedgetters until there are none (gruntwork-io#1594)

* Remove all usage of get-plugins=false which is removed in 0.15.0 (gruntwork-io#1618)

* Fix validate-inputs to support null defaults (gruntwork-io#1613)

* Clarify context of find_in_parent_folders (gruntwork-io#1623)

Co-authored-by: Paul <1727604+paulvandenburg@users.noreply.github.com>
Co-authored-by: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com>
Co-authored-by: amnk <amnk@users.noreply.github.com>
Co-authored-by: Marco Molteni <51477941+marco-m-pix4d@users.noreply.github.com>
Co-authored-by: David Wooldridge <zombie@zombix.org>
Co-authored-by: Ina Stoyanova <ina@gruntwork.io>
Co-authored-by: Zack Proser <zackproser@gmail.com>
Co-authored-by: Yevgeniy Brikman <brikis98@users.noreply.github.com>
Co-authored-by: Andy Bohne <abohne@users.noreply.github.com>
Co-authored-by: Andy Bohne <andrew.bohne@ring.com>
Co-authored-by: Alexey Remizov <alexey@remizov.org>
Co-authored-by: Syed Hussain <suhussai@ualberta.ca>
Co-authored-by: David Alger <davidmalger@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants