diff --git a/.changelog/39778.txt b/.changelog/39778.txt new file mode 100644 index 00000000000..5f8fada3fd0 --- /dev/null +++ b/.changelog/39778.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_quicksight_data_set: Fix `InvalidParameterValueException: Invalid RowLevelPermissionDataSet. Namespace parameter should not be specified for Version 2` errors on Create and Update +``` \ No newline at end of file diff --git a/internal/service/quicksight/schema/data_set.go b/internal/service/quicksight/schema/data_set.go index b89922ba0db..e08b350ba56 100644 --- a/internal/service/quicksight/schema/data_set.go +++ b/internal/service/quicksight/schema/data_set.go @@ -1352,19 +1352,19 @@ func ExpandRowLevelPermissionDataSet(tfList []interface{}) *awstypes.RowLevelPer apiObject := &awstypes.RowLevelPermissionDataSet{} - if v, ok := tfMap[names.AttrARN].(string); ok { + if v, ok := tfMap[names.AttrARN].(string); ok && v != "" { apiObject.Arn = aws.String(v) } - if v, ok := tfMap["permission_policy"].(string); ok { - apiObject.PermissionPolicy = awstypes.RowLevelPermissionPolicy(v) - } - if v, ok := tfMap["format_version"].(string); ok { + if v, ok := tfMap["format_version"].(string); ok && v != "" { apiObject.FormatVersion = awstypes.RowLevelPermissionFormatVersion(v) } - if v, ok := tfMap[names.AttrNamespace].(string); ok { + if v, ok := tfMap[names.AttrNamespace].(string); ok && v != "" { apiObject.Namespace = aws.String(v) } - if v, ok := tfMap[names.AttrStatus].(string); ok { + if v, ok := tfMap["permission_policy"].(string); ok && v != "" { + apiObject.PermissionPolicy = awstypes.RowLevelPermissionPolicy(v) + } + if v, ok := tfMap[names.AttrStatus].(string); ok && v != "" { apiObject.Status = awstypes.Status(v) }