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.74k stars 9.1k forks source link

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

Closed JonathanLieberman closed 1 year ago

JonathanLieberman commented 1 year ago

Terraform Core Version

1.0.3

AWS Provider Version

4.31.0

Affected Resource(s)

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

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

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 year ago

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] 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.