-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
r/aws_quicksight_data_set
: Allow physical_table_map to be optional
#31867
r/aws_quicksight_data_set
: Allow physical_table_map to be optional
#31867
Conversation
Community NoteVoting for Prioritization
For Submitters
|
031febc
to
e823cb4
Compare
Hey @g-dx - would it be possible to add a test case covering the desired configuration from the original issue? I've tried a few variants, but may be missing the intent.
resource "aws_quicksight_data_set" "test" {
data_set_id = %[1]q
name = %[2]q
import_mode = "SPICE"
physical_table_map {
physical_table_map_id = %[1]q
}
} resource "aws_quicksight_data_set" "test" {
data_set_id = %[1]q
name = %[2]q
import_mode = "SPICE"
physical_table_map {
physical_table_map_id = %[1]q
}
logical_table_map {
logical_table_map_id = %[1]q
alias = "Group1"
source {
physical_table_id = %[1]q
}
}
} Error (in both cases):
resource "aws_quicksight_data_set" "test" {
data_set_id = %[1]q
name = %[2]q
import_mode = "SPICE"
} Error:
I also tried creating a "parent" data set with a physical table and leaving the child with only a logical table map reference, but the physical table ID references don't appear to work across data sets. |
Hey, @jar-b of course I can add a test. More generally the intent of this PR is that it allows data sets which are composed of other datasets, via a join instruction. In these cases there is no physical table map. Roughly like this: resource "aws_quicksight_data_set" "one" {
// ...
}
resource "aws_quicksight_data_set" "two" {
// ...
}
resource "aws_quicksight_data_set" "joined" {
logical_table_map {
logical_table_map_id = "one"
source {
data_set_arn = aws_quicksight_data_set.one.arn
}
}
logical_table_map {
logical_table_map_id = "two"
source {
data_set_arn = aws_quicksight_data_set.two.arn
}
}
logical_table_map {
logical_table_map_id = "result"
source {
join_instruction {
left_operand = "one"
right_operand = "two"
type = "INNER"
on_clause = "{col1} = {col2}"
}
}
}
} |
Ah, thanks for the clarification. I should have been using |
e823cb4
to
6147905
Compare
Hey @jar-b I've updated the PR with a test which creates a data set without a physical table map. Let me know if that's all good or there's anything else which should be added. Thanks again for your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
$ make testacc PKG=quicksight TESTS=TestAccQuickSightDataSet_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/quicksight/... -v -count 1 -parallel 20 -run='TestAccQuickSightDataSet_' -timeout 180m
? github.com/hashicorp/terraform-provider-aws/internal/service/quicksight/schema [no test files]
--- PASS: TestAccQuickSightDataSet_disappears (40.21s)
--- PASS: TestAccQuickSightDataSet_columnLevelPermissionRules (43.61s)
--- PASS: TestAccQuickSightDataSet_rowLevelPermissionTagConfiguration (44.26s)
--- PASS: TestAccQuickSightDataSet_fieldFolders (45.44s)
--- PASS: TestAccQuickSightDataSet_basic (45.47s)
--- PASS: TestAccQuickSightDataSet_columnGroups (45.92s)
--- PASS: TestAccQuickSightDataSet_dataSetUsageConfiguration (45.92s)
--- PASS: TestAccQuickSightDataSet_noPhysicalTableMap (48.54s)
--- PASS: TestAccQuickSightDataSet_logicalTableMap (70.08s)
--- PASS: TestAccQuickSightDataSet_tags (88.90s)
--- PASS: TestAccQuickSightDataSet_permissions (93.98s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/quicksight 97.212s
Thanks for your contribution, @g-dx! 👍 |
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! |
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. |
Description
Currently, the schema for the
aws_quicksight_data_set
resource marks thephysical_table_map
field asRequired
.However, the AWS API makes clear that while required, the map it represents may contain zero entries:
Source
The present schema definition of
Required
therefore makes it impossible to specify an empty map.This PR fixes this by updating the
physical_table_map
field to beOptional
and ensures that an empty map is passed to the AWS SDK in the event that nophysical_table_map
blocks have been specified.Relations
Fixes #31863
Related To: #30349
References
Output from Acceptance Testing