Skip to content

Commit

Permalink
fix type check panic on GetRawConfigAt (#13204)
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau authored Feb 26, 2025
1 parent e98212e commit 1467ae0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ func sensitiveParamCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v
for _, sp := range sensitiveWoParams {
mapLabel := diff.Get("params." + sp[:len(sp)-3]).(string)
authLabel, _ := diff.GetRawConfigAt(cty.GetAttrPath("sensitive_params").IndexInt(0).GetAttr(sp))
if mapLabel != "" && authLabel.AsString() != "" {
if mapLabel != "" && (!authLabel.IsNull() && authLabel.Type() == cty.String) {
return fmt.Errorf("Sensitive param [%s] cannot be set in both `params` and the `sensitive_params` block.", sp)
}
if authLabel.AsString() != "" {
if !authLabel.IsNull() && authLabel.Type() == cty.String {
if _, versionExists := diff.GetOkExists("sensitive_params.0.secret_access_key_wo_version"); !versionExists {
return fmt.Errorf("Sensitive param [%s] must be set with %s_version", sp, sp)
}
Expand Down

0 comments on commit 1467ae0

Please sign in to comment.