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.85k stars 9.2k forks source link

[Bug]: #27518

Closed abhihashi closed 2 years ago

abhihashi commented 2 years ago

Terraform Core Version

1.1.2

AWS Provider Version

4.18

Affected Resource(s)

aws_lakeformation_permissions

Expected Behavior

Following up on this bug - https://github.com/hashicorp/terraform-provider-aws/issues/17300, Creating an aws_lakeformation_permissions resource with table.wildcard set to true should create permissions for all tables in the database.

Terraform documentation - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lakeformation_permissions#wildcard

Actual Behavior

Creating an aws_lakeformation_permissions resource with table.wildcard set to true times out after 2 minutes and triggers an error AccessDeniedException: Resource does not exist or requester is not authorized to access requested permissions.

resource "aws_lakeformation_permissions " "lf_glue_runner_all_table_permission" {
  permissions = ["SELECT"] 
  principal   = var.aws_iam_role_arn_variable

  table {
    database_name = var.db_catalog_name
    wildcard =  true
  }
}

Relevant Error/Panic Output Snippet

Error: error creating Lake Formation Permissions (input: { Permissions: ["SELECT"], Principal: { DataLakePrincipalIdentifier: "arn:aws:iam::<acct_id>:role/hcp_glue_runner_role" }, Resource: { Table: { DatabaseName: "<database name>", TableWildcard: { } } } }): AccessDeniedException: Resource does not exist or requester is not authorized to access requested permissions.
with module.lakeformation.aws_lakeformation_permissions.lf_glue_runner_all_table_permission
on ../modules/lakeformation/main.tf line 29, in resource "aws_lakeformation_permissions" "lf_glue_runner_all_table_permission":

Terraform Configuration Files

terraform { required_version = "~> 1.1.2" required_providers { aws = { source = "hashicorp/aws" version = "~> 4.18" } }

backend "remote" { hostname = "app.terraform.io" organization = "xxx"

workspaces {
  prefix = "integration-config-"
}

} }

Steps to Reproduce

Run terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No response

github-actions[bot] commented 2 years ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

abhihashi commented 2 years ago

Configured the principal that applies terraform plan to be a lakeformation admin which resolved the issue.

abhihashi commented 2 years ago

Configured the principal that applies terraform plan to be a lakeformation admin which resolved the issue.

github-actions[bot] commented 1 year 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.