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]: Cannot create Quicksight Dataset from other datasets #31863

Closed
jshort-insights opened this issue Jun 9, 2023 · 4 comments · Fixed by #31867
Closed

[Bug]: Cannot create Quicksight Dataset from other datasets #31863

jshort-insights opened this issue Jun 9, 2023 · 4 comments · Fixed by #31867
Labels
bug Addresses a defect in current functionality. service/quicksight Issues and PRs that pertain to the quicksight service.
Milestone

Comments

@jshort-insights
Copy link

Terraform Core Version

1.4.5

AWS Provider Version

5.1.0

Affected Resource(s)

aws_quicksight_data_set

Expected Behavior

Creates dataset by joining two existing datasets

Actual Behavior

Fails to create resource

Relevant Error/Panic Output Snippet

│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "897f6e0e-bcb4-48a8-8f84-c8c85d0c1891"
│   },
│   Message_: "Invalid PhysicalTableMap"
│ }
│
│   with aws_quicksight_data_set.account_emails_dataset,
│   on main.tf line 396, in resource "aws_quicksight_data_set" "account_emails_dataset":
│  396: resource "aws_quicksight_data_set" "account_emails_dataset" {

Terraform Configuration Files

resource "aws_quicksight_data_set" "account_emails_dataset" {
  aws_account_id = data.aws_caller_identity.current.account_id
  data_set_id    = "account-emails-dataset"
  import_mode    = "SPICE"
  name           = "Account Emails"

  data_set_usage_configuration {
    disable_use_as_direct_query_source = false
    disable_use_as_imported_source     = false
  }

  physical_table_map {
    physical_table_map_id = "account-email-dataset"
  }

  logical_table_map {
    logical_table_map_id = "accounts-table"
    alias                = "accounts"
    source {
      data_set_arn = "b55386c7-b7f2-4105-ac5e-ad8e782ee851"
    }
  }

  logical_table_map {
    logical_table_map_id = "email-table"
    alias                = "emails"
    source {
      data_set_arn = "45a84a9-22d2-45ae-8e0f-f1f1e386d84b"
    }
  }

  logical_table_map {
    logical_table_map_id = "account-emails"
    alias                = "Account Emails"
    data_transforms {
      project_operation {
        projected_columns = [
          "username",
          "email"
        ]
      }
    }

    source {
      join_instruction {
        left_operand  = "accounts-table"
        right_operand = "emails-table"
        type          = "INNER"
        on_clause     = "{account_id} = {external_id}"
      }
    }
  }
}

Steps to Reproduce

  1. Create two Datasets in Quicksight
  2. Create a Dataset in Quicksight that joins the two dataset resources

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@jshort-insights jshort-insights added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 9, 2023
@github-actions
Copy link

github-actions bot commented Jun 9, 2023

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 github-actions bot added the service/quicksight Issues and PRs that pertain to the quicksight service. label Jun 9, 2023
@g-dx
Copy link
Contributor

g-dx commented Jun 9, 2023

After looking into this I'm reasonably sure the schema definition for physical_table_map should be changed to Optional rather than Required as it is currently:

"physical_table_map": {
Type: schema.TypeSet,
Required: true,
MaxItems: 32,
Elem: physicalTableMapSchema(),
},

This is because the CreateDataSet API says that the physical_table_map is required but may be empty:

PhysicalTableMap

    Declares the physical tables that are available in the underlying data sources.

    Type: String to [PhysicalTable](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_PhysicalTable.html) object map

    Map Entries: Minimum number of 0 items. Maximum number of 32 items.

    Key Length Constraints: Minimum length of 1. Maximum length of 64.

    Key Pattern: [0-9a-zA-Z-]*

    Required: Yes

Source

Then in the example above we can omit physical_table_map completely and simply pass an empty map to the AWS SDK.

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jun 9, 2023
g-dx added a commit to g-dx/terraform-provider-aws that referenced this issue Jun 13, 2023
jar-b added a commit that referenced this issue Jun 13, 2023
…31867)

* r/aws_quicksight_data_set: Allow physical_table_map to be optional

Fixes #31863

* r/aws_quicksight_data_set(test): reuse config args

---------

Co-authored-by: Jared Baker <jared.baker@hashicorp.com>
@github-actions github-actions bot added this to the v5.4.0 milestone Jun 13, 2023
@github-actions
Copy link

This functionality has been released in v5.4.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 Jul 16, 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/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