hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.83k stars 9.18k forks source link

[Docs]: It is not clear about the precedence for `profile` option or `AWS_PROFILE` #37734

Open EugenKon opened 5 months ago

EugenKon commented 5 months ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs#shared-configuration-and-credentials-files

Description

If both profle option and AWS_PROFILE environment variable were configured. Which one take precedence?

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 5 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 5 months ago

Hey @EugenKon 👋 Thanks for taking the time to raise this so we could take another look at it! In this case, the order of precedence is profile and then AWS_PROFILE. This is true for all of the provider options that accept both a configuration argument and an environment variable, so we mention it at the top of the configuration document.

On this page, we've attempted to strike a balance between having that information available (currently in a centralized place at the top of the page) without being too repetitive (mentioning the order in each subsequent section).

With that in mind, I'm of two minds. I think the documentation should be left as is, however, I recognize that if you navigate straight to the section you linked to, the section I linked to could be overlooked. Is there something that you think would have made things more clear on your read?

EugenKon commented 5 months ago

@justinretzolk I believe, the sections should have a link to the top of the configuration document and mention that explicitly. So you will understand the precedence for exact options if you navigate into in directly. And you can easily navigate to the section which will describe behaviour in general.