Skip to content

Commit a6b4a52

Browse files
committed
add sensitiveWoParams in customDiff
1 parent 0868879 commit a6b4a52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mmv1/templates/terraform/constants/bigquery_data_transfer.go.tmpl

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ func sensitiveParamCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v
99
return fmt.Errorf("Sensitive param [%s] cannot be set in both `params` and the `sensitive_params` block.", sp)
1010
}
1111
}
12+
for _, sp := range sensitiveWoParams {
13+
mapLabel := diff.Get("params." + sp[:len(sp)-3]).(string)
14+
authLabel, _ := diff.GetRawConfigAt(cty.GetAttrPath("sensitive_params").IndexInt(0).GetAttr(sp))
15+
if mapLabel != "" && authLabel.AsString() != "" {
16+
return fmt.Errorf("Sensitive param [%s] cannot be set in both `params` and the `sensitive_params` block.", sp)
17+
}
18+
}
1219
return nil
1320
}
1421

0 commit comments

Comments
 (0)