terraform-provider-aws icon indicating copy to clipboard operation
terraform-provider-aws copied to clipboard

[Bug]: Terraform cannot handle aws_lakeformation_lf_tag with colon in Tag Key name

Open JonathanLieberman opened this issue 2 years ago • 1 comments

Terraform Core Version

1.0.3

AWS Provider Version

4.31.0

Affected Resource(s)

  • aws_lakeformation_lf_tag

Expected Behavior

When creating a Lake Formation Tag with a colon in the name, the resource should create successfully, and terraform apply should succeed for the aws_lakeformation_tag resources.

Actual Behavior

terraform apply fails, the tags are created, the tags are added to the terraform state file, and future terraform plan runs fail due to terraform expecting a different input from the state file (colons interfering with the catalog:tagkey structure)

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_lakeformation_lf_tag" "tag_with_colon" {
    key    = "LoB:Sales"
    values = ["Orders", "Inventory", "Customers"]
}

Steps to Reproduce

  • create configuration with an aws_lakeformation_tag resource with a colon in the tag Key name
  • terraform plan
  • terraform apply

After apply failure, future terraform plan runs will fail

Debug Output

terraform plan output image

terraform apply output image

Terraform State File (after failed apply)

{
  "version": 4,
  "terraform_version": "1.0.3",
  "serial": 1,
  "lineage": "47ac89eb-e791-9e78-781f-8eaf657506ad",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "aws_lakeformation_lf_tag",
      "name": "tag_with_colon",
      "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
      "instances": [
        {
          "status": "tainted",
          "schema_version": 0,
          "attributes": {
            "catalog_id": null,
            "id": "145103944781:LoB:Sales",
            "key": "LoB:Sales",
            "values": [
              "Customers",
              "Inventory",
              "Orders"
            ]
          },
          "sensitive_attributes": [],
          "private": "bnVsbA=="
        }
      ]
    }
  ]
}

Future terraform plan outputs image

Proof of Tag Creation (AWS Console) image

Panic Output

No response

Important Factoids

No response

References

Naming convention follows AWS guidance on creating a centralized Glue Data Catalog (in support of Data Mesh architecture): https://aws.amazon.com/blogs/big-data/build-a-modern-data-architecture-and-data-mesh-pattern-at-scale-using-aws-lake-formation-tag-based-access-control/

Would you like to implement a fix?

No response

JonathanLieberman avatar Sep 21 '22 21:09 JonathanLieberman

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

github-actions[bot] avatar Sep 21 '22 21:09 github-actions[bot]

This functionality has been released in v4.61.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] avatar Mar 30 '23 23:03 github-actions[bot]

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[bot] avatar Apr 30 '23 02:04 github-actions[bot]