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.81k stars 9.16k forks source link

[Docs]: aws_guardduty_malware_protection_plan role argument reference should specify that it requires a role ARN #38719

Closed kxgillispie closed 2 months ago

kxgillispie commented 2 months ago

Documentation Link

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_malware_protection_plan#role

Description

Documentation for resource aws_guardduty_malware_protection_plan's argument role says only:

The IAM role that includes the permissions required to scan and add tags to the associated protected resource.

Based on both the code example from the same link (which specifies role = aws_iam_role.example.arn), and errors we've received when attempting to use a role name instead (detailed below), it seems that this argument specifically requires an ARN; it would be helpful if the documentation was updated accordingly.

===

Additionally, it seems that the URL fragment for that role attribute doesn't function as expected; when clicking on the attribute name the fragment is added to the URL displayed in the browser, but attempting to navigate to that URL directly does not result in the view being scrolled to it (as it does with other fragment URLs from that same page, like for the tags attribute: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/guardduty_malware_protection_plan#tags).

===

Error from attempting to use role name for this argument instead of ARN:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/hashicorp/aws" planned an invalid value for
│ aws_guardduty_malware_protection_plan.protection_plan.role: planned value
│ cty.UnknownVal(cty.String) does not match config value
│ cty.StringVal("GuardDutyMalwareProtectionRole").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Operation failed: failed running terraform plan (exit 1)

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 2 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

stefanfreitag commented 2 months ago

Hi @kxgillispie,

let me look into this.

github-actions[bot] commented 2 months 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.

github-actions[bot] commented 2 months ago

This functionality has been released in v5.62.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

github-actions[bot] commented 1 month ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.