diff --git a/nsxt/resource_nsxt_policy_context_profile.go b/nsxt/resource_nsxt_policy_context_profile.go index 9643b6258..177b80570 100644 --- a/nsxt/resource_nsxt_policy_context_profile.go +++ b/nsxt/resource_nsxt_policy_context_profile.go @@ -90,6 +90,11 @@ func getContextProfilePolicyAppIDAttributesSchema() *schema.Schema { Type: schema.TypeString, }, }, + "custom_url_partial_match": { + Type: schema.TypeBool, + Description: "True value for this flag will be treated as a partial match for custom url", + Default: true, + }, "sub_attribute": getPolicyAttributeSubAttributeSchema(), }, }, @@ -514,6 +519,7 @@ func fillAttributesInSchema(d *schema.ResourceData, policyAttributes []model.Pol elem["sub_attribute"] = fillSubAttributesInSchema(policyAttribute.SubAttributes) } elem["is_alg_type"] = policyAttribute.IsALGType + elem["custom_url_partial_match"] = policyAttribute.CustomUrlPartialMatch } attributes[key] = append(attributes[key], elem) } diff --git a/nsxt/resource_nsxt_policy_context_profile_test.go b/nsxt/resource_nsxt_policy_context_profile_test.go index 183c51b02..a74985165 100644 --- a/nsxt/resource_nsxt_policy_context_profile_test.go +++ b/nsxt/resource_nsxt_policy_context_profile_test.go @@ -172,6 +172,7 @@ func TestAccResourceNsxtPolicyContextProfile_multipleAttributes(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "domain_name.#", "1"), resource.TestCheckResourceAttr(testResourceName, "url_category.#", "0"), resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.is_alg_type"), + resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.custom_url_partial_match"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.#", "3"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.0", "HTTP"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.1", "SSH"), @@ -214,6 +215,7 @@ func TestAccResourceNsxtPolicyContextProfile_subAttributes(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "domain_name.#", "0"), resource.TestCheckResourceAttr(testResourceName, "url_category.#", "0"), resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.is_alg_type"), + resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.custom_url_partial_match"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.#", "1"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.0", "SSL"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.sub_attribute.#", "1"), @@ -239,6 +241,7 @@ func TestAccResourceNsxtPolicyContextProfile_subAttributes(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "domain_name.#", "0"), resource.TestCheckResourceAttr(testResourceName, "url_category.#", "0"), resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.is_alg_type"), + resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.custom_url_partial_match"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.#", "1"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.0", "CIFS"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.sub_attribute.#", "1"), @@ -265,6 +268,7 @@ func TestAccResourceNsxtPolicyContextProfile_subAttributes(t *testing.T) { resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.#", "1"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.value.0", "SSL"), resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.is_alg_type"), + resource.TestCheckResourceAttrSet(testResourceName, "app_id.0.custom_url_partial_match"), resource.TestCheckResourceAttr(testResourceName, "app_id.0.sub_attribute.#", "0"), ), }, diff --git a/website/docs/r/policy_context_profile.html.markdown b/website/docs/r/policy_context_profile.html.markdown index 5168305de..24e78054b 100644 --- a/website/docs/r/policy_context_profile.html.markdown +++ b/website/docs/r/policy_context_profile.html.markdown @@ -85,6 +85,7 @@ In addition to arguments listed above, the following attributes are exported: * `path` - The NSX path of the policy resource. * `app_id`: * `is_alg_type` - Describes whether the APP_ID value is ALG type or not. + * `custom_url_partial_match` - True value for this flag will be treated as a partial match for custom url ## Importing