Skip to content

Commit

Permalink
Add custom control topology policy definition resource and data source
Browse files Browse the repository at this point in the history
  • Loading branch information
danischm committed Jul 16, 2023
1 parent a8ed447 commit f44d39d
Show file tree
Hide file tree
Showing 15 changed files with 2,741 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Add `sdwan_cisco_secure_internet_gateway_feature_template` resource and data source
- Add `sdwan_hub_and_spoke_topology_policy_definition` resource and data source
- Add `sdwan_mesh_topology_policy_definition` resource and data source
- Add `sdwan_custom_control_topology_policy_definition` resource and data source

## 0.2.0

Expand Down
117 changes: 117 additions & 0 deletions docs/data-sources/custom_control_topology_policy_definition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_custom_control_topology_policy_definition Data Source - terraform-provider-sdwan"
subcategory: "Centralized Policies"
description: |-
This data source can read the Custom Control Topology policy definition.
---

# sdwan_custom_control_topology_policy_definition (Data Source)

This data source can read the Custom Control Topology policy definition.

## Example Usage

```terraform
data "sdwan_custom_control_topology_policy_definition" "example" {
id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `id` (String) The id of the policy definition

### Read-Only

- `default_action` (String) Default action, either `accept` or `reject`
- `description` (String) The description of the policy definition
- `name` (String) The name of the policy definition
- `sequences` (Attributes List) List of sequences (see [below for nested schema](#nestedatt--sequences))
- `type` (String) The policy definition type
- `version` (Number) The version of the policy definition

<a id="nestedatt--sequences"></a>
### Nested Schema for `sequences`

Read-Only:

- `action_entries` (Attributes List) List of action entries (see [below for nested schema](#nestedatt--sequences--action_entries))
- `id` (Number) Sequence ID
- `ip_type` (String) Sequence IP type, either `ipv4`, `ipv6` or `all`
- `match_entries` (Attributes List) List of match entries (see [below for nested schema](#nestedatt--sequences--match_entries))
- `name` (String) Sequence name
- `type` (String) Sequence type, either `route` or `tloc`

<a id="nestedatt--sequences--action_entries"></a>
### Nested Schema for `sequences.action_entries`

Read-Only:

- `export_to_vpn_list_id` (String) Export to VPN list ID
- `export_to_vpn_list_version` (Number) Export to VPN list version
- `set_parameters` (Attributes List) List of set parameters (see [below for nested schema](#nestedatt--sequences--action_entries--set_parameters))
- `type` (String) Type of action entry

<a id="nestedatt--sequences--action_entries--set_parameters"></a>
### Nested Schema for `sequences.action_entries.set_parameters`

Read-Only:

- `community` (String) Community value, e.g. `1000:10000` or `internet` or `local-AS`
- `community_additive` (Boolean) Community additive
- `omp_tag` (Number) OMP tag
- `preference` (Number) Preference
- `service_tloc_color` (String) Service TLOC color
- `service_tloc_encapsulation` (String) Service TLOC encapsulation
- `service_tloc_ip` (String) Service TLOC IP address
- `service_tloc_list_id` (String) Service TLOC list ID
- `service_tloc_list_version` (Number) Service TLOC list version
- `service_type` (String) Service type
- `service_vpn_id` (Number) Service VPN ID
- `tloc_action` (String) TLOC action
- `tloc_color` (String) TLOC color
- `tloc_encapsulation` (String) TLOC encapsulation
- `tloc_ip` (String) TLOC IP address
- `tloc_list_id` (String) TLOC list ID
- `tloc_list_version` (Number) TLOC list version
- `type` (String) Type of action entry



<a id="nestedatt--sequences--match_entries"></a>
### Nested Schema for `sequences.match_entries`

Read-Only:

- `carrier` (String) Carrier
- `color_list_id` (String) Color list ID
- `color_list_version` (Number) Color list version
- `community_list_id` (String) Community list ID
- `community_list_version` (Number) Community list version
- `domain_id` (Number) Domain ID
- `expanded_community_list_id` (String) Expanded community list ID
- `expanded_community_list_version` (Number) Expanded community list version
- `group_id` (Number) Group ID
- `omp_tag` (Number) OMP tag
- `origin` (String) Origin
- `originator` (String) Originator IP
- `path_type` (String) Path type
- `preference` (Number) Preference
- `prefix_list_id` (String) Prefix list ID
- `prefix_list_version` (Number) Prefix list version
- `site_id` (Number) Site ID
- `site_list_id` (String) Site list ID
- `site_list_version` (Number) Site list version
- `tloc_color` (String) TLOC color
- `tloc_encapsulation` (String) TLOC encapsulation
- `tloc_ip` (String) TLOC IP address
- `tloc_list_id` (String) TLOC list ID
- `tloc_list_version` (Number) TLOC list version
- `type` (String) Type of match entry
- `vpn_id` (Number) VPN ID
- `vpn_list_id` (String) VPN list ID
- `vpn_list_version` (Number) VPN list version
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ description: |-
- Add `sdwan_cisco_secure_internet_gateway_feature_template` resource and data source
- Add `sdwan_hub_and_spoke_topology_policy_definition` resource and data source
- Add `sdwan_mesh_topology_policy_definition` resource and data source
- Add `sdwan_custom_control_topology_policy_definition` resource and data source

## 0.2.0

Expand Down
190 changes: 190 additions & 0 deletions docs/resources/custom_control_topology_policy_definition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_custom_control_topology_policy_definition Resource - terraform-provider-sdwan"
subcategory: "Centralized Policies"
description: |-
This resource can manage a Custom Control Topology policy definition.
---

# sdwan_custom_control_topology_policy_definition (Resource)

This resource can manage a Custom Control Topology policy definition.

## Example Usage

```terraform
resource "sdwan_custom_control_topology_policy_definition" "example" {
name = "Example"
description = "My description"
default_action = "reject"
sequences = [
{
id = 1
name = "Region1"
type = "route"
ip_type = "ipv4"
match_entries = [
{
type = "ompTag"
omp_tag = 100
}
]
action_entries = [
{
type = "set"
set_parameters = [
{
type = "preference"
preference = 100
}
]
}
]
}
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `description` (String) The description of the policy definition
- `name` (String) The name of the policy definition
- `sequences` (Attributes List) List of sequences (see [below for nested schema](#nestedatt--sequences))

### Optional

- `default_action` (String) Default action, either `accept` or `reject`
- Choices: `accept`, `reject`

### Read-Only

- `id` (String) The id of the policy definition
- `type` (String) The policy defintion type
- `version` (Number) The version of the policy definition

<a id="nestedatt--sequences"></a>
### Nested Schema for `sequences`

Required:

- `id` (Number) Sequence ID
- `name` (String) Sequence name

Optional:

- `action_entries` (Attributes List) List of action entries (see [below for nested schema](#nestedatt--sequences--action_entries))
- `ip_type` (String) Sequence IP type, either `ipv4`, `ipv6` or `all`
- Choices: `ipv4`, `ipv6`, `all`
- `match_entries` (Attributes List) List of match entries (see [below for nested schema](#nestedatt--sequences--match_entries))
- `type` (String) Sequence type, either `route` or `tloc`
- Choices: `route`, `tloc`

<a id="nestedatt--sequences--action_entries"></a>
### Nested Schema for `sequences.action_entries`

Required:

- `type` (String) Type of action entry
- Choices: `set`, `exportTo`

Optional:

- `export_to_vpn_list_id` (String) Export to VPN list ID
- `export_to_vpn_list_version` (Number) Export to VPN list version
- `set_parameters` (Attributes List) List of set parameters (see [below for nested schema](#nestedatt--sequences--action_entries--set_parameters))

<a id="nestedatt--sequences--action_entries--set_parameters"></a>
### Nested Schema for `sequences.action_entries.set_parameters`

Required:

- `type` (String) Type of action entry
- Choices: `tlocList`, `tloc`, `tlocAction`, `preference`, `ompTag`, `community`, `communityAdditive`, `service`

Optional:

- `community` (String) Community value, e.g. `1000:10000` or `internet` or `local-AS`
- `community_additive` (Boolean) Community additive
- `omp_tag` (Number) OMP tag
- Range: `0`-`4294967295`
- `preference` (Number) Preference
- Range: `0`-`4294967295`
- `service_tloc_color` (String) Service TLOC color
- `service_tloc_encapsulation` (String) Service TLOC encapsulation
- Choices: `ipsec`, `gre`
- `service_tloc_ip` (String) Service TLOC IP address
- `service_tloc_list_id` (String) Service TLOC list ID
- `service_tloc_list_version` (Number) Service TLOC list version
- `service_type` (String) Service type
- Choices: `FW`, `IDP`, `IDS`, `netsvc1`, `netsvc2`, `netsvc3`, `netsvc4`, `netsvc5`
- `service_vpn_id` (Number) Service VPN ID
- Range: `0`-`65536`
- `tloc_action` (String) TLOC action
- Choices: `strict`, `primary`, `backup`, `ecmp`
- `tloc_color` (String) TLOC color
- `tloc_encapsulation` (String) TLOC encapsulation
- Choices: `ipsec`, `gre`
- `tloc_ip` (String) TLOC IP address
- `tloc_list_id` (String) TLOC list ID
- `tloc_list_version` (Number) TLOC list version



<a id="nestedatt--sequences--match_entries"></a>
### Nested Schema for `sequences.match_entries`

Required:

- `type` (String) Type of match entry
- Choices: `colorList`, `community`, `expandedCommunity`, `ompTag`, `origin`, `originator`, `preference`, `siteList`, `pathType`, `tlocList`, `vpnList`, `prefixList`, `vpn`, `tloc`, `siteId`, `carrier`, `domainId`, `groupId`

Optional:

- `carrier` (String) Carrier
- Choices: `default`, `carrier1`, `carrier2`, `carrier3`, `carrier4`, `carrier5`, `carrier6`, `carrier7`, `carrier8`
- `color_list_id` (String) Color list ID
- `color_list_version` (Number) Color list version
- `community_list_id` (String) Community list ID
- `community_list_version` (Number) Community list version
- `domain_id` (Number) Domain ID
- Range: `0`-`4294967295`
- `expanded_community_list_id` (String) Expanded community list ID
- `expanded_community_list_version` (Number) Expanded community list version
- `group_id` (Number) Group ID
- Range: `0`-`4294967295`
- `omp_tag` (Number) OMP tag
- Range: `0`-`4294967295`
- `origin` (String) Origin
- Choices: `igp`, `egp`, `incomplete`
- `originator` (String) Originator IP
- `path_type` (String) Path type
- Choices: `hierarchical-path`, `direct-path`, `transport-gateway-path`
- `preference` (Number) Preference
- Range: `0`-`4294967295`
- `prefix_list_id` (String) Prefix list ID
- `prefix_list_version` (Number) Prefix list version
- `site_id` (Number) Site ID
- Range: `0`-`4294967295`
- `site_list_id` (String) Site list ID
- `site_list_version` (Number) Site list version
- `tloc_color` (String) TLOC color
- `tloc_encapsulation` (String) TLOC encapsulation
- Choices: `ipsec`, `gre`
- `tloc_ip` (String) TLOC IP address
- `tloc_list_id` (String) TLOC list ID
- `tloc_list_version` (Number) TLOC list version
- `vpn_id` (Number) VPN ID
- Range: `0`-`65536`
- `vpn_list_id` (String) VPN list ID
- `vpn_list_version` (Number) VPN list version

## Import

Import is supported using the following syntax:

```shell
terraform import sdwan_custom_control_topology_policy_definition.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "sdwan_custom_control_topology_policy_definition" "example" {
id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import sdwan_custom_control_topology_policy_definition.example "f6b2c44c-693c-4763-b010-895aa3d236bd"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "sdwan_custom_control_topology_policy_definition" "example" {
name = "Example"
description = "My description"
default_action = "reject"
sequences = [
{
id = 1
name = "Region1"
type = "route"
ip_type = "ipv4"
match_entries = [
{
type = "ompTag"
omp_tag = 100
}
]
action_entries = [
{
type = "set"
set_parameters = [
{
type = "preference"
preference = 100
}
]
}
]
}
]
}
Loading

0 comments on commit f44d39d

Please sign in to comment.