diff --git a/mmv1/products/orgpolicy/CustomConstraint.yaml b/mmv1/products/orgpolicy/CustomConstraint.yaml index 60635242fd0f..e305db146275 100644 --- a/mmv1/products/orgpolicy/CustomConstraint.yaml +++ b/mmv1/products/orgpolicy/CustomConstraint.yaml @@ -31,11 +31,19 @@ examples: - !ruby/object:Provider::Terraform::Examples name: 'org_policy_custom_constraint_basic' primary_resource_id: 'constraint' + vars: + policy_name: 'custom.disableGkeAutoUpgrade' + test_vars_overrides: + policy_name: '"custom.tfTestDisableGkeAutoUpgrade" + acctest.RandString(t, 10)' test_env_vars: org_id: :ORG_ID - !ruby/object:Provider::Terraform::Examples name: 'org_policy_custom_constraint_full' primary_resource_id: 'constraint' + vars: + policy_name: 'custom.disableGkeAutoUpgrade' + test_vars_overrides: + policy_name: '"custom.tfTestDisableGkeAutoUpgrade" + acctest.RandString(t, 10)' test_env_vars: org_id: :ORG_TARGET parameters: diff --git a/mmv1/templates/terraform/examples/org_policy_custom_constraint_basic.tf.erb b/mmv1/templates/terraform/examples/org_policy_custom_constraint_basic.tf.erb index 32b23fc4b45f..61a4805230b8 100644 --- a/mmv1/templates/terraform/examples/org_policy_custom_constraint_basic.tf.erb +++ b/mmv1/templates/terraform/examples/org_policy_custom_constraint_basic.tf.erb @@ -1,6 +1,6 @@ resource "google_org_policy_custom_constraint" "<%= ctx[:primary_resource_id] %>" { - name = "custom.disableGkeAutoUpgrade" + name = "<%= ctx[:vars]['policy_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" action_type = "ALLOW" diff --git a/mmv1/templates/terraform/examples/org_policy_custom_constraint_full.tf.erb b/mmv1/templates/terraform/examples/org_policy_custom_constraint_full.tf.erb index a75a21e907de..cf08b9504acd 100644 --- a/mmv1/templates/terraform/examples/org_policy_custom_constraint_full.tf.erb +++ b/mmv1/templates/terraform/examples/org_policy_custom_constraint_full.tf.erb @@ -1,6 +1,6 @@ resource "google_org_policy_custom_constraint" "<%= ctx[:primary_resource_id] %>" { - name = "custom.disableGkeAutoUpgrade" + name = "<%= ctx[:vars]['policy_name'] %>" parent = "organizations/<%= ctx[:test_env_vars]['org_id'] %>" display_name = "Disable GKE auto upgrade" description = "Only allow GKE NodePool resource to be created or updated if AutoUpgrade is not enabled where this custom constraint is enforced."