Skip to content

Commit

Permalink
[ignore] Add relations to EPG and VRF for NetflowExporterPol. Modify …
Browse files Browse the repository at this point in the history
…overwrites for NetflowExporterPol's attributes.
  • Loading branch information
gmicol committed Aug 20, 2024
1 parent 046562c commit 0e8aba3
Show file tree
Hide file tree
Showing 13 changed files with 2,453 additions and 141 deletions.
16 changes: 12 additions & 4 deletions docs/data-sources/netflow_exporter_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,23 @@ data "aci_netflow_exporter_policy" "example_tenant" {
* `id` - (string) The distinguished name (DN) of the Netflow Exporter Policy object.
* `annotation` (annotation) - (string) The annotation of the Netflow Exporter Policy object.
* `description` (descr) - (string) The description of the Netflow Exporter Policy object.
* `dscp` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object.
* `destination_address` (dstAddr) - (string) The destination IP address of the remote node.
* `qos_dscp_value` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object.
* `destination_ip_address` (dstAddr) - (string) The destination IP address of the remote node.
* `destination_port` (dstPort) - (string) The destination port of the remote node.
* `name_alias` (nameAlias) - (string) The name alias of the Netflow Exporter Policy object.
* `owner_key` (ownerKey) - (string) The key for enabling clients to own their data for entity correlation.
* `owner_tag` (ownerTag) - (string) A tag for enabling clients to add their own data. For example, to indicate who created this object.
* `source_ip_type` (sourceIpType) - (string) The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address.
* `source_address` (srcAddr) - (string) The source IP address.
* `version` (ver) - (string) The collector version.
* `source_ip_address` (srcAddr) - (string) The source IP address.
* `version` (ver) - (string) The NetFlow Exporter Version of the Netflow Exporter Policy object.

* `relation_to_vrf` - (list) A list of Relation To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)).
* `annotation` (annotation) - (string) The annotation of the Relation To VRF object.
* `target_dn` (tDn) - (string) The distinguished name of the target.

* `relation_to_epg` - (list) A list of Relation To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)) pointing to (ACI Object [fvEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEPg/overview)).
* `annotation` (annotation) - (string) The annotation of the Relation To EPG object.
* `target_dn` (tDn) - (string) The distinguished name of the target.

* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). This attribute is supported in ACI versions: 3.2(1l) and later.
* `key` (key) - (string) The key used to uniquely identify this configuration object.
Expand Down
74 changes: 53 additions & 21 deletions docs/resources/netflow_exporter_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ The configuration snippet below creates a Netflow Exporter Policy with only requ
```hcl
resource "aci_netflow_exporter_policy" "example_tenant" {
parent_dn = aci_tenant.example.id
destination_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
parent_dn = aci_tenant.example.id
destination_ip_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
}
```
Expand All @@ -53,19 +53,31 @@ The configuration snippet below shows all possible attributes of the Netflow Exp
```hcl
resource "aci_netflow_exporter_policy" "full_example_tenant" {
parent_dn = aci_tenant.example.id
annotation = "annotation"
description = "description_1"
dscp = "AF11"
destination_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
name_alias = "name_alias_1"
owner_key = "owner_key_1"
owner_tag = "owner_tag_1"
source_ip_type = "custom-src-ip"
source_address = "1.1.1.1/10"
version = "v9"
parent_dn = aci_tenant.example.id
annotation = "annotation"
description = "description_1"
qos_dscp_value = "AF11"
destination_ip_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
name_alias = "name_alias_1"
owner_key = "owner_key_1"
owner_tag = "owner_tag_1"
source_ip_type = "custom-src-ip"
source_ip_address = "1.1.1.1/10"
version = "v9"
relation_to_vrf = [
{
annotation = "annotation_1"
target_dn = "uni/tn-test_tenant/ctx-test_vrf"
}
]
relation_to_epg = [
{
annotation = "annotation_1"
target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg"
}
]
annotations = [
{
key = "key_0"
Expand All @@ -88,7 +100,7 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp

### Required ###

* `destination_address` (dstAddr) - (string) The destination IP address of the remote node.
* `destination_ip_address` (dstAddr) - (string) The destination IP address of the remote node.
* `destination_port` (dstPort) - (string) The destination port of the remote node.
- Valid Values: `dns`, `ftpData`, `http`, `https`, `pop3`, `rtsp`, `smtp`, `ssh`, `unspecified`.
* `name` (name) - (string) The name of the Netflow Exporter Policy object.
Expand All @@ -108,7 +120,7 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp
* `annotation` (annotation) - (string) The annotation of the Netflow Exporter Policy object.
- Default: `orchestrator:terraform`
* `description` (descr) - (string) The description of the Netflow Exporter Policy object.
* `dscp` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object.
* `qos_dscp_value` (dscp) - (string) The DSCP value of the Netflow Exporter Policy object.
- Default: `CS2`
- Valid Values: `AF11`, `AF12`, `AF13`, `AF21`, `AF22`, `AF23`, `AF31`, `AF32`, `AF33`, `AF41`, `AF42`, `AF43`, `CS0`, `CS1`, `CS2`, `CS3`, `CS4`, `CS5`, `CS6`, `CS7`, `EF`, `VA`.
* `name_alias` (nameAlias) - (string) The name alias of the Netflow Exporter Policy object.
Expand All @@ -117,11 +129,31 @@ All examples for the Netflow Exporter Policy resource can be found in the [examp
* `source_ip_type` (sourceIpType) - (string) The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address.
- Default: `custom-src-ip`
- Valid Values: `custom-src-ip`, `inband-mgmt-ip`, `oob-mgmt-ip`, `ptep`.
* `source_address` (srcAddr) - (string) The source IP address.
* `version` (ver) - (string) The collector version.
* `source_ip_address` (srcAddr) - (string) The source IP address.
* `version` (ver) - (string) The NetFlow Exporter Version of the Netflow Exporter Policy object.
- Default: `v9`
- Valid Values: `cisco-v1`, `v5`, `v9`.

* `relation_to_vrf` - (list) A list of Relation To VRF (ACI object [netflowRsExporterToCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToCtx/overview)) pointing to VRF (ACI Object [fvCtx](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvCtx/overview)) which can be configured using the [aci_vrf](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/vrf) resource.
- Max Items: 1


#### Optional ####

* `annotation` (annotation) - (string) The annotation of the Relation To VRF object.
- Default: `orchestrator:terraform`
* `target_dn` (tDn) - (string) The distinguished name of the target.

* `relation_to_epg` - (list) A list of Relation To EPG (ACI object [netflowRsExporterToEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/netflowRsExporterToEPg/overview)) pointing to (ACI Object [fvEPg](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/fvEPg/overview)).
- Max Items: 1


#### Optional ####

* `annotation` (annotation) - (string) The annotation of the Relation To EPG object.
- Default: `orchestrator:terraform`
* `target_dn` (tDn) - (string) The distinguished name of the target.

* `annotations` - (list) A list of Annotations (ACI object [tagAnnotation](https://pubhub.devnetcloud.com/media/model-doc-latest/docs/app/index.html#/objects/tagAnnotation/overview)). Annotations can also be configured using a separate [aci_annotation](https://registry.terraform.io/providers/CiscoDevNet/aci/latest/docs/resources/annotation) resource. This attribute is supported in ACI versions: 3.2(1l) and later.

#### Required ####
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@

resource "aci_netflow_exporter_policy" "full_example_tenant" {
parent_dn = aci_tenant.example.id
annotation = "annotation"
description = "description_1"
dscp = "AF11"
destination_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
name_alias = "name_alias_1"
owner_key = "owner_key_1"
owner_tag = "owner_tag_1"
source_ip_type = "custom-src-ip"
source_address = "1.1.1.1/10"
version = "v9"
parent_dn = aci_tenant.example.id
annotation = "annotation"
description = "description_1"
qos_dscp_value = "AF11"
destination_ip_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
name_alias = "name_alias_1"
owner_key = "owner_key_1"
owner_tag = "owner_tag_1"
source_ip_type = "custom-src-ip"
source_ip_address = "1.1.1.1/10"
version = "v9"
relation_to_vrf = [
{
annotation = "annotation_1"
target_dn = "uni/tn-test_tenant/ctx-test_vrf"
}
]
relation_to_epg = [
{
annotation = "annotation_1"
target_dn = "uni/tn-test_tenant/ap-test_ap/epg-test_epg"
}
]
annotations = [
{
key = "key_0"
Expand Down
8 changes: 4 additions & 4 deletions examples/resources/aci_netflow_exporter_policy/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

resource "aci_netflow_exporter_policy" "example_tenant" {
parent_dn = aci_tenant.example.id
destination_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
parent_dn = aci_tenant.example.id
destination_ip_address = "2.2.2.1"
destination_port = "https"
name = "netfow_exporter"
}
14 changes: 14 additions & 0 deletions gen/definitions/classes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,20 @@ netflowExporterPol:
- "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters"
sub_category: "Tenant Policies"

netflowRsExporterToEPg:
resource_name: "relation_to_epg"
ui_locations:
- "Tenants -> Policies -> NetFlow -> NetFlow Exporters"
- "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters"
sub_category: "Tenant Policies"

netflowRsExporterToCtx:
resource_name: "relation_to_vrf"
ui_locations:
- "Tenants -> Policies -> NetFlow -> NetFlow Exporters"
- "Fabric -> Access Policies -> Policies -> Interface -> NetFlow -> NetFlow Exporters"
sub_category: "Tenant Policies"

netflowRecordPol:
resource_name: "netflow_record_policy"
ui_locations:
Expand Down
43 changes: 33 additions & 10 deletions gen/definitions/properties.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -914,35 +914,36 @@ netflowExporterPol:
- dstAddr
- dstPort
overwrites:
dst_addr: "destination_address"
dst_addr: "destination_ip_address"
dst_port: "destination_port"
src_addr: "source_address"
src_addr: "source_ip_address"
ver: "version"
dscp: "qos_dscp_value"
documentation:
dstAddr: "The destination IP address of the remote node."
dstPort: "The destination port of the remote node."
dscp: "The DSCP value of the Netflow Exporter Policy object."
dscp: "The DSCP value of the %s object."
srcAddr: "The source IP address."
ver: "The collector version."
ver: "The NetFlow Exporter Version of the %s object."
sourceIpType: "The type of the source IP address: It can be one of the available management IP address for a given leaf or a custom IP Address."
default_values:
parent_dn: "uni/infra"
test_values:
default:
name: "netfow_exporter_default"
destination_address: "2.2.2.1"
source_address: "1.1.1.1/10"
destination_ip_address: "2.2.2.1"
source_ip_address: "1.1.1.1/10"
destination_port: "https"
all:
name: "netfow_exporter"
destination_address: "12.12.12.1"
source_address: "11.11.11.1/11"
destination_ip_address: "12.12.12.1"
source_ip_address: "11.11.11.1/11"
destination_port: "ssh"
version: "v9"
resource_required:
source_address: "1.1.1.1/10"
name: "netfow_exporter"
destination_address: "2.2.2.1"
source_ip_address: "1.1.1.1/10"
destination_ip_address: "2.2.2.1"
destination_port: "https"
datasource_required:
name: "netfow_exporter"
Expand All @@ -955,3 +956,25 @@ netflowExporterPol:
- class_name: "fvTenant"
parent_dependency: ""
parent_dn: "aci_tenant.test.id"

netflowRsExporterToEPg:
parents:
- class_name: "netflowExporterPol"
target_classes:
- "fvEPg"
targets:
- class_name: "fvAEPg"
target_dn: "uni/tn-test_tenant/ap-test_ap/epg-test_epg"
relation_resource_name: "epg"
static: true

netflowRsExporterToCtx:
parents:
- class_name: "netflowExporterPol"
target_classes:
- "fvCtx"
targets:
- class_name: "fvCtx"
target_dn: "uni/tn-test_tenant/ctx-test_vrf"
relation_resource_name: "vrf"
static: true
Loading

0 comments on commit 0e8aba3

Please sign in to comment.