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.87k stars 9.21k forks source link

Documentation: Error in example (`role` -> `principal`) #25202

Closed chroche closed 2 years ago

chroche commented 2 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

AWS Provider v4.17.1

Affected Resource(s)

Documentation page for resource: aws_lakeformation_permissions

Actual Behavior

When using the example titled Grant Permissions For A Glue Catalog Database, the following error is generated:

│ Error: Missing required argument
│
│   on s3-storage-lens.tf line 44, in resource "aws_lakeformation_permissions" "s3_storage_lens":
│   44: resource "aws_lakeformation_permissions" "s3_storage_lens" {
│
│ The argument "principal" is required, but no definition was found.
╵
╷
│ Error: Unsupported argument
│
│   on s3-storage-lens.tf line 45, in resource "aws_lakeformation_permissions" "s3_storage_lens":
│   45:   role        = aws_iam_role.s3_storage_lens.arn
│
│ An argument named "role" is not expected here.

Important Factoids

The example should be, just like the one above it:

resource "aws_lakeformation_permissions" "example" {
  principal   = aws_iam_role.workflow_role.arn
  permissions = ["CREATE_TABLE", "ALTER", "DROP"]

  database {
    name       = aws_glue_catalog_database.example.name
    catalog_id = "110376042874"
  }
}
justinretzolk commented 2 years ago

Hey @chroche 👋 Thank you very much for bringing this to our attention! I've opened a PR to correct this 👍

github-actions[bot] commented 2 years ago

This functionality has been released in v4.18.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 2 years 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.