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

configuration alias causes version detection failure #2642

Closed
wyardley opened this issue Nov 3, 2022 · 2 comments
Closed

configuration alias causes version detection failure #2642

wyardley opened this issue Nov 3, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@wyardley
Copy link
Contributor

wyardley commented Nov 3, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

When a configuration_aliases attribute is configured within terraform { required_providers ..., it interferes with Atlantis's version detection.

The specific error in the logs is trying to detect required version: Variables not allowed: Variables may not be used here.

Reproduction Steps

Simple repro case; create a state with the following configuration:

terraform {
  required_version = "1.3.4" // Where the version is different from Atlantis's default version
  required_providers {
    google = {
      source                = "hashicorp/google"
      version               = "4.41.0"
      configuration_aliases = [google.management]
    }

plan and Atlantis will give an error about the version not being supported.

Logs

msg: trying to detect required version: Variables not allowed: Variables may not be used here.
stacktrace: github.com/runatlantis/atlantis/server/events.getTfVersion
	github.com/runatlantis/atlantis/server/events/project_command_context_builder.go:289
github.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandContextBuilder).BuildProjectContext
	github.com/runatlantis/atlantis/server/events/project_command_context_builder.go:113
github.com/runatlantis/atlantis/server/events.(*CommandScopedStatsProjectCommandContextBuilder).BuildProjectContext
	github.com/runatlantis/atlantis/server/events/project_command_context_builder.go:65
github.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandBuilder).buildPlanAllCommands
	github.com/runatlantis/atlantis/server/events/project_command_builder.go:291
github.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandBuilder).BuildAutoplanCommands
	github.com/runatlantis/atlantis/server/events/project_command_builder.go:166
github.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandBuilder).BuildAutoplanCommands
	github.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:44
github.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).runAutoplan
	github.com/runatlantis/atlantis/server/events/plan_command_runner.go:77
github.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run
	github.com/runatlantis/atlantis/server/events/plan_command_runner.go:245
github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunAutoplanCommand
	github.com/runatlantis/atlantis/server/events/command_runner.go:174

Environment details

If not already included, please provide the following:

  • Atlantis version: v0.20.1
  • If not running the latest Atlantis version have you tried to reproduce this issue on the latest version:
  • Atlantis flags:

Atlantis server-side config file:
[can provide if ends up being necesary]

Repo atlantis.yaml file:
[can provide if ends up being necesary]

Additional Context

@wyardley wyardley added the bug Something isn't working label Nov 3, 2022
@wyardley
Copy link
Contributor Author

wyardley commented Nov 3, 2022

Seems to be a dupe of #2598, though it's not clear to me that's actually resolved yet?

@wyardley
Copy link
Contributor Author

wyardley commented Nov 3, 2022

I see, yes, fixed in #2599

@wyardley wyardley closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant