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

Issue 26920 support colon in LakeFormation lf-tag key #28258

Merged

Conversation

andyfurnival
Copy link
Contributor

Description

Adds support for LF-TAGS to use colons in the key names. It's fairly common to use sub categories like Sales:LoB or Department:LoB to further focus the tag to a domain. AWS supports using colons in tags, as well as other characters, however colons was the only character impacted due to how Terraform processed tf files.

Relations

Closes #26920

Output from Acceptance Testing

make testacc TESTS=testAccLFTag_basic PKG=lakeformation

make testacc PKG=lakeformation
...

Integration tests were run for all of Lake Formation functions

=== RUN   TestAccLakeFormation_serial
=== RUN   TestAccLakeFormation_serial/DataLakeSettings
=== RUN   TestAccLakeFormation_serial/DataLakeSettings/basic
=== RUN   TestAccLakeFormation_serial/DataLakeSettings/dataSource
=== RUN   TestAccLakeFormation_serial/DataLakeSettings/disappears
=== RUN   TestAccLakeFormation_serial/DataLakeSettings/withoutCatalogId
=== RUN   TestAccLakeFormation_serial/PermissionsBasic
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/dataLocation
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/disappears
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/lfTag
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/lfTagPolicy
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/basic
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/database
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/databaseIAMAllowed
=== RUN   TestAccLakeFormation_serial/PermissionsBasic/databaseMultiple
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/database
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/dataLocation
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/lfTag
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/table
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns
=== RUN   TestAccLakeFormation_serial/PermissionsDataSource/basic
=== RUN   TestAccLakeFormation_serial/PermissionsTable
=== RUN   TestAccLakeFormation_serial/PermissionsTable/wildcardNoSelect
=== RUN   TestAccLakeFormation_serial/PermissionsTable/wildcardSelectPlus
=== RUN   TestAccLakeFormation_serial/PermissionsTable/implicit
=== RUN   TestAccLakeFormation_serial/PermissionsTable/selectPlus
=== RUN   TestAccLakeFormation_serial/PermissionsTable/multipleRoles
=== RUN   TestAccLakeFormation_serial/PermissionsTable/selectOnly
=== RUN   TestAccLakeFormation_serial/PermissionsTable/wildcardSelectOnly
=== RUN   TestAccLakeFormation_serial/PermissionsTable/basic
=== RUN   TestAccLakeFormation_serial/PermissionsTable/iamAllowed
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns/basic
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns/implicit
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardExcludedColumns
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectOnly
=== RUN   TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectPlus
=== RUN   TestAccLakeFormation_serial/LFTags
=== RUN   TestAccLakeFormation_serial/LFTags/values
=== RUN   TestAccLakeFormation_serial/LFTags/basic
=== RUN   TestAccLakeFormation_serial/LFTags/disappears
=== RUN   TestAccLakeFormation_serial/ResourceLFTags
=== RUN   TestAccLakeFormation_serial/ResourceLFTags/basic
=== RUN   TestAccLakeFormation_serial/ResourceLFTags/database
=== RUN   TestAccLakeFormation_serial/ResourceLFTags/databaseMultiple
=== RUN   TestAccLakeFormation_serial/ResourceLFTags/table
=== RUN   TestAccLakeFormation_serial/ResourceLFTags/tableWithColumns
--- PASS: TestAccLakeFormation_serial (1685.53s)
    --- PASS: TestAccLakeFormation_serial/DataLakeSettings (80.64s)
        --- PASS: TestAccLakeFormation_serial/DataLakeSettings/basic (21.60s)
        --- PASS: TestAccLakeFormation_serial/DataLakeSettings/dataSource (20.76s)
        --- PASS: TestAccLakeFormation_serial/DataLakeSettings/disappears (19.59s)
        --- PASS: TestAccLakeFormation_serial/DataLakeSettings/withoutCatalogId (18.68s)
    --- PASS: TestAccLakeFormation_serial/PermissionsBasic (418.27s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/dataLocation (35.84s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/disappears (91.57s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTag (49.08s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/lfTagPolicy (70.66s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/basic (38.58s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/database (40.90s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseIAMAllowed (51.91s)
        --- PASS: TestAccLakeFormation_serial/PermissionsBasic/databaseMultiple (39.72s)
    --- PASS: TestAccLakeFormation_serial/PermissionsDataSource (318.90s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/database (43.23s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/dataLocation (38.17s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTag (55.32s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/lfTagPolicy (67.88s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/table (38.04s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/tableWithColumns (35.50s)
        --- PASS: TestAccLakeFormation_serial/PermissionsDataSource/basic (40.76s)
    --- PASS: TestAccLakeFormation_serial/PermissionsTable (320.35s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/wildcardNoSelect (31.58s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/wildcardSelectPlus (33.03s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/implicit (33.70s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/selectPlus (33.13s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/multipleRoles (33.98s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/selectOnly (33.56s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/wildcardSelectOnly (33.82s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/basic (33.69s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTable/iamAllowed (53.87s)
    --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns (229.00s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/basic (86.69s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/implicit (40.46s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardExcludedColumns (34.63s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectOnly (34.03s)
        --- PASS: TestAccLakeFormation_serial/PermissionsTableWithColumns/wildcardSelectPlus (33.18s)
    --- PASS: TestAccLakeFormation_serial/LFTags (107.88s)
        --- PASS: TestAccLakeFormation_serial/LFTags/values (62.73s)
        --- PASS: TestAccLakeFormation_serial/LFTags/basic (25.47s)
        --- PASS: TestAccLakeFormation_serial/LFTags/disappears (19.68s)
    --- PASS: TestAccLakeFormation_serial/ResourceLFTags (210.49s)
        --- PASS: TestAccLakeFormation_serial/ResourceLFTags/basic (23.65s)
        --- PASS: TestAccLakeFormation_serial/ResourceLFTags/database (42.86s)
        --- PASS: TestAccLakeFormation_serial/ResourceLFTags/databaseMultiple (56.61s)
        --- PASS: TestAccLakeFormation_serial/ResourceLFTags/table (44.01s)
        --- PASS: TestAccLakeFormation_serial/ResourceLFTags/tableWithColumns (43.35s)

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. service/lakeformation Issues and PRs that pertain to the lakeformation service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Dec 8, 2022
@andyfurnival andyfurnival changed the title issue 26920 support colon in LakeFormation lf-tag key Issue 26920 support colon in LakeFormation lf-tag key Dec 8, 2022
@andyfurnival andyfurnival marked this pull request as ready for review December 8, 2022 17:18
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @andyfurnival 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 8, 2022
@johnsonaj johnsonaj self-assigned this Mar 27, 2023
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/L Managed by automation to categorize the size of a PR. labels Mar 27, 2023
Copy link
Contributor

@johnsonaj johnsonaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

I added a standalone test for LFTags with a : in the key and removed the testing from other resource since it was indirectly testing the aws_lakeformation_lf_tag resource indirectly.

$ make testacc PKG=lakeformation TESTS="TestAccLakeFormation_serial/^LFTags"

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/lakeformation/... -v -count 1 -parallel 20 -run='TestAccLakeFormation_serial/^LFTags'  -timeout 180m
--- PASS: TestAccLakeFormation_serial (68.41s)
    --- PASS: TestAccLakeFormation_serial/LFTags (68.41s)
        --- PASS: TestAccLakeFormation_serial/LFTags/tagKeyComplex (13.68s)
        --- PASS: TestAccLakeFormation_serial/LFTags/values (25.58s)
        --- PASS: TestAccLakeFormation_serial/LFTags/basic (15.34s)
        --- PASS: TestAccLakeFormation_serial/LFTags/disappears (13.81s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/lakeformation	71.373s

@johnsonaj
Copy link
Contributor

@andyfurnival thanks for the contribution! 🎉

@johnsonaj johnsonaj merged commit eba8a7b into hashicorp:main Mar 28, 2023
@github-actions github-actions bot added this to the v4.61.0 milestone Mar 28, 2023
@andyfurnival andyfurnival deleted the b_aws_lakeformation_lf_tag_26920 branch March 28, 2023 14:00
@github-actions
Copy link

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
Copy link

github-actions bot commented May 1, 2023

I'm going to lock this pull request 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 related to this change, 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 May 1, 2023
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. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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