Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mmv1/products/compute/OrganizationSecurityPolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
post_create: 'templates/terraform/post_create/org_security_policy.go.tmpl'
post_delete: 'templates/terraform/post_delete/org_security_policy.go.tmpl'
post_update: 'templates/terraform/post_update/org_security_policy.go.tmpl'
# TODO: Remove once b/154369201 is closed.

Check warning on line 40 in mmv1/products/compute/OrganizationSecurityPolicy.yaml

View workflow job for this annotation

GitHub Actions / lint-yaml

40:5 [comments-indentation] comment not indented like content
test_check_destroy: 'templates/terraform/custom_check_destroy/skip_delete_during_test.go.tmpl'
examples:
- name: 'organization_security_policy_basic'
Expand All @@ -61,6 +61,7 @@
User-provided name of the organization security policy. The name should be unique in the organization in which the security policy is created. This should only be used when SecurityPolicyType is FIREWALL.
min_version: 'beta'
immutable: true
diff_suppress_func: 'tpgresource.EmptyStringOrNilDiffSuppress'
- name: 'description'
type: String
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func EmptyOrFalseSuppressBoolean(k, old, new string, d *schema.ResourceData) boo
return (o == nil && !n.(bool))
}

func EmptyStringOrNilDiffSuppress(k, old, new string, d *schema.ResourceData) bool {
o, n := d.GetChange(k)
return (o == nil || o == "") && (n != nil && n != "")
}

func CaseDiffSuppress(_, old, new string, _ *schema.ResourceData) bool {
return strings.ToUpper(old) == strings.ToUpper(new)
}
Expand Down
Loading