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

[Bug]: Order lost in aws_quicksight_data_set causing endless plan updates due to ordering of principals in permissions block #32645

Closed
udidn opened this issue Jul 21, 2023 · 5 comments · Fixed by #32984
Assignees
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/quicksight Issues and PRs that pertain to the quicksight service.
Milestone

Comments

@udidn
Copy link

udidn commented Jul 21, 2023

Terraform Core Version

1.5.3

AWS Provider Version

5.8.0

Affected Resource(s)

The permissions block in aws_quicksight_data_set resource

Expected Behavior

When running multiple plans without changes to the Terraform configuration file, Terraform should detect no changes

Actual Behavior

When running multiple plans without changes to the Terraform configuration file, changes are detected on every plan due to reordering of the principals

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

locals {
  users = ["Admin/Isengard-udid", "Admin2/Isengard-udid"]
}

data "aws_quicksight_user" "qs_data_set_users" {
  count = length(local.users)

  user_name = local.users[count.index]
}

resource "aws_quicksight_data_set" "test_dataset" {
  data_set_id = "test
  import_mode = "SPICE"
  name        = "test"

  data_set_usage_configuration {
    disable_use_as_direct_query_source = false
    disable_use_as_imported_source     = false
  }

  dynamic "permissions" {
    for_each = data.aws_quicksight_user.qs_data_set_users
    content {
      actions = [
        "quicksight:CancelIngestion",
        "quicksight:CreateIngestion",
        "quicksight:DeleteDataSet",
        "quicksight:DescribeDataSet",
        "quicksight:DescribeDataSetPermissions",
        "quicksight:DescribeIngestion",
        "quicksight:ListIngestions",
        "quicksight:PassDataSet",
        "quicksight:UpdateDataSet",
        "quicksight:UpdateDataSetPermissions",
      ]
      principal = data.aws_quicksight_user.users[permissions.key].arn
    }
  }

  physical_table_map {
    physical_table_map_id = "test"

    relational_table {
      catalog         = "AwsDataCatalog"
      data_source_arn = aws_quicksight_data_source.test_datasource.arn
      name            = "test"
      schema          = "test"

      input_columns {
        name = "name"
        type = "STRING"
      }
    }
  }
}

Steps to Reproduce

  1. terraform apply
  2. terraform plan

Notice there's significance to the usernames.
The usernames I'm using in the users list are returned in reversed order in terraform plan (step 2 above), and this is what's causing the drift.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

#22274

Would you like to implement a fix?

None

@udidn udidn added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jul 21, 2023
@github-actions github-actions bot added the service/quicksight Issues and PRs that pertain to the quicksight service. label Jul 21, 2023
@github-actions
Copy link

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.

@jar-b jar-b removed the needs-triage Waiting for first response or review from a maintainer. label Jul 21, 2023
@jar-b
Copy link
Member

jar-b commented Jul 21, 2023

permissions argument may need converted to TypeSet:

"permissions": {
Type: schema.TypeList,
Optional: true,
MinItems: 1,
MaxItems: 64,

@udidn
Copy link
Author

udidn commented Jul 24, 2023

Thank you for point this out @jar-b.
Is there anyone looking into it and committing the fix?

@github-actions
Copy link

This functionality has been released in v5.13.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 Sep 18, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 10, 2024
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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/quicksight Issues and PRs that pertain to the quicksight service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants