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

API_KEY is not read when the provider has an alias #38

Closed
fermentfan opened this issue Mar 29, 2023 · 2 comments
Closed

API_KEY is not read when the provider has an alias #38

fermentfan opened this issue Mar 29, 2023 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@fermentfan
Copy link

Hi, we noticed a bug in our repository that if you alias your stripe provider like this:

provider "stripe" {
  alias   = "stripe_account_1"
  api_key = var.stripe_account_1_api_key
}

it will not read out the api_key property correctly. It will therefore ask you for it in the manual prompt and fail in CI/CD. With the env var STRIPE_API_KEY it works.

@lukasaron
Copy link
Owner

I think the issue is in the Terraform state. Looks like you created resources with the provider without the alias. Could you please try to keep the stripe provider without the alias as it is and create a new one with the new alias and update resources to use that alias provider?

@lukasaron lukasaron added the question Further information is requested label Mar 29, 2023
@lukasaron lukasaron self-assigned this Mar 29, 2023
@fermentfan
Copy link
Author

Ahh that makes total sense. Looking at our git it is really what happened. Thing is we didn't really need the alias in the first place, but that sounds like a logical thing. Thank you for the help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants