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

Can't interact with multiple Terraform provider blocks of same type #33

Open
bobziuchkovski opened this issue Sep 30, 2021 · 3 comments

Comments

@bobziuchkovski
Copy link

I was hoping to use hcledit to extract and manipulate AWS provider attributes within our terraform config.

However, it looks like the lack of provider names or address indexing prevents this from working? I could also be missing something on my end, though.

The example file I'm working with is a main.tf file with 4 different AWS provider blocks. Each provider has a different profile specified, but I can only interact with the first of these from hcledit:

$ hcledit -f main.tf attribute get provider.aws.profile
"prod"

$ grep -A 1 aws main.tf
provider "aws" {
  profile = "prod"
--
provider "aws" {
  profile = "dev"
--
provider "aws" {
  profile = "qa"
--
provider "aws" {
  profile = "ops"
@minamijoyo
Copy link
Owner

Thank you for reporting the issue. Yes, the address index expression hasn't been implemented yet.

@ayodelecaleb
Copy link

any updates on this?

@jchytrowski
Copy link

@ayodelecaleb , you might be able to use this-

I wrote this with the goal of being able to add to provider blocks, not being able to query them; but you could probably hack a solution from this.

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

4 participants