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]: KMS Key Alias data source attributes #38879

Closed toobiii closed 1 week ago

toobiii commented 2 months ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/kms_alias#attribute-reference

Description

Under the attribute reference section of the docs in the aws_kms_alias data source; both the arn and id share the same string describing what they are, but they should be different as they are different attributes with different outputs.

Happy to give a go at wording the ID string being changed. e.g something as simple as Identifier of the key alias

References

No response

Would you like to implement a fix?

Yes

github-actions[bot] commented 2 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

stefanfreitag commented 2 months ago

Hi @toobiii, thanks for raising the issue. In your explanation you mentioned

both the arn and id [...] should be different as they are different attributes with different outputs.

Do you mean with "different outputs" a semantic difference or a difference in value?

I used below code to check the values and also had a look into the code: both attributes have the same value.

data "aws_kms_alias" "s3" {
  name = "alias/aws/s3"
}

output "arn" {
  value = data.aws_kms_alias.s3.arn
}
output "id" {
  value = data.aws_kms_alias.s3.id
}
justinretzolk commented 1 week ago

Thank you for taking the time to raise this! As mentioned above, the documentation is identical for the two attributes because their values are the same.

One thing to note is that "id" can be a bit loaded here -- some AWS resources have and "id" that's an identifier on the AWS side. For Terraform resources, the "id" is Terraform's unique identifier of the resource, used to track the resource in the state. All resources in Terraform have this id attribute for that reason. Oftentimes, this value matches another attribute of the resource/data source (specifically, in the AWS Provider, this is often the ARN, since it's inherently a unique value).

Since the documentation is correct as is, and we haven't heard back in some time, I'm going to close this issue. If you see anything else that seems out of sorts in the future, please do let us know!

github-actions[bot] commented 1 week ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.