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

op run -- terraform <command> fails because it doesn't allow setting credentials #502

Open
npearson72 opened this issue Jan 1, 2025 · 3 comments
Labels
op-cli Functionality to be implemented in 1Password CLI. Needs to be done by 1Password Developers.

Comments

@npearson72
Copy link

npearson72 commented Jan 1, 2025

op CLI version

2.30.3

Goal or desired behavior

For this to work:

op run --env-file=.env -- terraform <command>

Current behavior

Running op run --env-file=.env -- terraform <command> command throws the following error (without allowing to select credentials):

Error: NoCredentialProviders: no valid providers in chain. Deprecated.
      For verbose messaging see aws.Config.CredentialsChainVerboseErrors

I was required to remove the terraform alias in ~/.config/op/plugins.sh to get it t work. But now I have to use the following command:

op run --env-file=.env -- op plugin run -- terraform <command>

Relevant log output

Error: NoCredentialProviders: no valid providers in chain. Deprecated.
      For verbose messaging see aws.Config.CredentialsChainVerboseErrors
@npearson72 npearson72 added the op-cli Functionality to be implemented in 1Password CLI. Needs to be done by 1Password Developers. label Jan 1, 2025
@Marton6
Copy link
Member

Marton6 commented Jan 6, 2025

Thank you for reporting this issue, @npearson72!

Could you share the format of your .env file? It would be helpful to see what kind of environment variables you're trying to set via op run that cannot be set by the AWS shell plugin

@moward98
Copy link

moward98 commented Jan 6, 2025

Hello @npearson72 ,
It looks like you're using the Terraform plugin with a stable version of the CLI (2.30.3). However, please note that the Terraform plugin is currently only available in the beta versions of the CLI. The latest beta release is 2.30.0-beta.03.
We recommend trying the command again using the beta version, which should allow the plugin to work as expected.

@npearson72
Copy link
Author

npearson72 commented Jan 6, 2025

@Marton6 the contents of my .env files looks like:

TF_VAR_aws_account_id=op://infra/global/aws_account_id
TF_VAR_domain_name=op://infra/services_app_global/domain_name
TF_VAR_region=op://infra/global/region
TF_VAR_repository_name=op://infra/services_app_global/repository_name
TF_VAR_service_name=op://infra/services_app_global/service_name

@moward98 Thanks for the tip. I'll give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
op-cli Functionality to be implemented in 1Password CLI. Needs to be done by 1Password Developers.
Projects
None yet
Development

No branches or pull requests

3 participants