Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_lakeformation_permissions inconsistent result after apply #19643

Closed
phzietsman opened this issue Jun 3, 2021 · 4 comments · Fixed by #19817
Closed

aws_lakeformation_permissions inconsistent result after apply #19643

phzietsman opened this issue Jun 3, 2021 · 4 comments · Fixed by #19817
Assignees
Labels
bug Addresses a defect in current functionality. service/lakeformation Issues and PRs that pertain to the lakeformation service.
Milestone

Comments

@phzietsman
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.5
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.43.0

Affected Resource(s)

  • aws_lakeformation_permissions

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "aws_lakeformation_permissions" "data_producer_database" {

  provider = aws.lf_data_producer

  principal = var.org_arn

  permissions                   = ["DESCRIBE"]
  permissions_with_grant_option = ["DESCRIBE"]
  
  database {
    name       = aws_glue_catalog_database.data_producer.name
    catalog_id = data.aws_caller_identity.lf_data_producer.account_id
  }
}

variable "org_arn" {
  default = "arn:aws:organizations::xxx:organization/o-zzzzzz"
}

Expected Behavior

Permissions to be added to the Glue database that gives the entire AWS Organization DESCRIBE access and the changes to be reflected in the state file.

Actual Behavior

The changes are applied in the AWS, but the state does not reflect the changes. This only occurs when applying permissions to organizations and organizational units, when giving access to other accounts, this error does not occur.

Subsequent applies creates another resource in AWS and give the same error, resulting in multiple permission entries for the same Org/OU.

aws_lakeformation_permissions.data_producer_database: Creating...
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to aws_lakeformation_permissions.data_producer_database, provider
│ "provider[\"registry.terraform.io/hashicorp/aws\"].lf_data_producer" produced an
│ unexpected new value: Root resource was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue
│ tracker.

Steps to Reproduce

  1. terraform apply
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. bug Addresses a defect in current functionality. service/lakeformation Issues and PRs that pertain to the lakeformation service. labels Jun 3, 2021
@ramprasadtx
Copy link

We are using * provider.aws: version = "~> 3.42". PFA attached build file with error

Step 1 (worked FINE)
resource "aws_lakeformation_permissions" "test_athenalf_table" {
principal = "arn:aws:iam::ACCCT:role/app-athena-lf-user"
permissions = ["SELECT"]

table_with_columns {
database_name = "lffix"
name = "lffix"
column_names=["amt","age"]
}
}

When we Changed to :

resource "aws_lakeformation_permissions" "test_athenalf_table" {
principal = "arn:aws:iam::ACCCT:role/app-athena-lf-user"
permissions = ["SELECT"]

table_with_columns {
database_name = "lffix"
name = "lffix"
column_names=["amt"]
}
}

It FAILED with
This is a bug in the provider, which should be reported in the provider's own issue tracker.
2021/06/04 19:34:01 [ERROR] : eval: *terraform.EvalSequence, err: Provider produced inconsistent result after apply: When applying changes to aws_lakeformation_permissions.test_athenalf_table, provider "registry.terraform.io/-/aws" produced an unexpected new value for was present, but now absent.

@YakDriver YakDriver removed the needs-triage Waiting for first response or review from a maintainer. label Jun 15, 2021
@YakDriver YakDriver self-assigned this Jun 15, 2021
@YakDriver
Copy link
Member

YakDriver commented Jun 16, 2021

This bug would be reproduced by the new testAccAWSLakeFormationPermissions_tableWithColumns() acceptance test in #19817. That verifies that the bug is resolved with the PR.

@github-actions github-actions bot added this to the v3.46.0 milestone Jun 17, 2021
@github-actions
Copy link

This functionality has been released in v3.46.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
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/lakeformation Issues and PRs that pertain to the lakeformation service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants