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

aws_lakeformation_permissions table wildcard not updating state correctly when granting only SELECT #19862

Closed maiarareinaldo closed 1 year ago

maiarareinaldo commented 3 years ago

Community Note

Terraform CLI and Terraform AWS Provider Version

Affected Resource(s)

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" "permissions" {
  principal = data.aws_iam_role.foo_role.arn

  permissions = [
    "SELECT"
  ]

  table {
    database_name = local.databases.foo_db
    catalog_id          = var.catalog_id
    wildcard             = true
  }

}

Debug Output

Panic Output

Expected Behavior

On second apply there should have been no changes if resource is not modified.

Actual Behavior

{
      "mode": "managed",
      "type": "aws_lakeformation_permissions",
      "name": "permission",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "catalog_id": null,
            "catalog_resource": false,
            "data_location": [],
            "database": [],
            "id": "1293270091",
            "permissions": [
              "SELECT"
            ],
            "permissions_with_grant_option": [],
            "principal": "arn:aws:iam::1234567891011:role/foo",
            "table": [],
            "table_with_columns": [] ## NO TABLE INFORMATION ##
          },
          "sensitive_attributes": [],
          "private": "bnVsbA==",
          "dependencies": [
            "data.aws_iam_role.foo_role"
          ]
        }
      ]
    }

Steps to Reproduce

  1. terraform apply
  2. terraform plan -> the resource will appear as new addition

Important Factoids

References

github-actions[bot] commented 1 year ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

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.