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

Terraform plugin state commands #441

Open
federicopires opened this issue Mar 18, 2024 · 3 comments
Open

Terraform plugin state commands #441

federicopires opened this issue Mar 18, 2024 · 3 comments

Comments

@federicopires
Copy link

Platform or tool

Terraform

Desired or expected behavior

terraform state [subcommand] should work.

Subcommands:
    list                List resources in the state
    mv                  Move an item in the state
    pull                Pull current state and output to stdout
    push                Update remote state from a local state file
    replace-provider    Replace provider in the state
    rm                  Remove instances from the state
    show                Show a resource in the state

Current behavior

Commands fails with no valid credential sources found.

terraform init and plan | apply work fine.

Relevant log output

Error: No valid credential sources found
│
│ Please see https://www.terraform.io/docs/language/settings/backends/s3.html
│ for more information about providing credentials.
│
│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request canceled,
│ context deadline exceeded


### op CLI version

2.23.0-beta.01
@mattpascoe
Copy link

I see this same problem. I am able to do a "terraform state list" but if I try to do a "terraform state show xxxx" it fails.

Additionally a "terraform providers" fails in a similar way.

I'm also curious to know what the state of the terraform plugin truly is. Its been in beta for quite some time. Is there any hope or expectation that it will reach an official release?

@mattpascoe
Copy link

@federicopires FYI, we were able to move past this terraform beta version. Recently the main desktop app was updated and would no longer work with the older beta 1password-cli version.

Once we were on the latest version of the desktop app and 1password-cli and things were functioning there, we of course no longer had the terraform plugin that was included in the 2.23.0-beta.01 version.

To address this, you can simply just clone this repo and then issue the following commands:

make terraform/validate
make terraform/build

Now you should have the latest versions of the desktop app, 1password-cli, and a locally installed version of the terraform plugin. This now has allowed us to use all of the terraform state and terraform providers commands without issue. You will see a slightly annoying WARNING message about it not being an official plugin but for now I can accept this.

Hope that helps folks out. Here is to hoping that 1password will just start including the terraform plugin in the latest 1password-cli releases?

@mattpascoe
Copy link

Just commenting here that this issue and #447 seem to share the common theme of being in the beta state.

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

No branches or pull requests

2 participants