Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vc_folder flag to project definition. #1483

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
10 changes: 10 additions & 0 deletions nsxt/resource_nsxt_policy_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func resourceNsxtPolicyProject() *schema.Resource {
Optional: true,
Computed: true,
},
"vc_folder": {
Type: schema.TypeBool,
Description: "Flag to specify whether the DVPGs created for project segments are grouped under a folder on the VC",
Optional: true,
Default: true,
},
"external_ipv4_blocks": {
Type: schema.TypeList,
Elem: getElemPolicyPathSchema(),
Expand All @@ -77,6 +83,7 @@ func resourceNsxtPolicyProject() *schema.Resource {
Optional: true,
MinItems: 1,
MaxItems: 1,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"north_south_firewall": {
Expand Down Expand Up @@ -139,6 +146,7 @@ func resourceNsxtPolicyProjectPatch(connector client.Connector, d *schema.Resour
}
tier0s := getStringListFromSchemaList(d, "tier0_gateway_paths")
activateDefaultDFWRules := d.Get("activate_default_dfw_rules").(bool)
vcFolder := d.Get("vc_folder").(bool)
extIpv4BlocksList := getStringListFromSchemaList(d, "external_ipv4_blocks")
tgwConnectionsList := getStringListFromSchemaList(d, "tgw_external_connections")

Expand All @@ -160,6 +168,7 @@ func resourceNsxtPolicyProjectPatch(connector client.Connector, d *schema.Resour

if util.NsxVersionHigherOrEqual("9.0.0") {
obj.TgwExternalConnections = tgwConnectionsList
obj.VcFolder = &vcFolder
}

if shortID != "" {
Expand Down Expand Up @@ -292,6 +301,7 @@ func resourceNsxtPolicyProjectRead(d *schema.ResourceData, m interface{}) error
}
if util.NsxVersionHigherOrEqual("9.0.0") {
d.Set("tgw_external_connections", obj.TgwExternalConnections)
d.Set("vc_folder", obj.VcFolder)
}
return nil
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/policy_project.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The following arguments are supported:
* `default_security_profile`- (Optional) Default security profile properties for project.
* `north_south_firewall` - (Required) North South firewall configuration.
* `enabled` - (Required) This flag indicates whether north-south firewall (Gateway Firewall) is enabled. If set to false, then gateway firewall policies will not be enforced on the VPCs associated with this configuration.
* `vc_folder` - (Optional) Flag to specify whether the DVPGs created for project segments are grouped under a folder on the VC. Defaults to `true`.

## Attributes Reference

Expand Down
Loading