Skip to content

live-ls: with a DIR given, default -region to the root's configured provider region rather than the SDK chain #1044

Description

@lex00

Found while working #1043.

live-ls resolves its region from -region, else the AWS SDK's default chain (internal/command/live_ls.go:217, documented at :675). live-plan and live-check on the same root resolve the region from the root's own provider configuration (region = var.aws_region, so TF_VAR_aws_region). When the two disagree, for example a shell with AWS_REGION unset or set to another region, live-ls DIR and live-plan in that DIR read different regions of the same account and their answers cannot be compared: one can report an estate empty while the other binds every resource.

It did not cause #1043's symptom (the issue's own live-ls evidence carried the right region), but it is the one region path in the live verbs that ignores the root.

Ask: when a DIR is given and the root's provider block names a region, use it as the default for -region, and print which source the region came from in the human output so a mismatch is visible. Without a DIR, keep the SDK chain. An explicit -region still wins.

Refs #1043

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions