Skip to content

Commit

Permalink
Add ip to sgt mapping resources (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz authored Oct 28, 2023
1 parent 466a354 commit 982c216
Show file tree
Hide file tree
Showing 23 changed files with 1,734 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docs/data-sources/trustsec_ip_to_sgt_mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_trustsec_ip_to_sgt_mapping Data Source - terraform-provider-ise"
subcategory: "TrustSec"
description: |-
This data source can read the TrustSec IP to SGT Mapping.
---

# ise_trustsec_ip_to_sgt_mapping (Data Source)

This data source can read the TrustSec IP to SGT Mapping.

## Example Usage

```terraform
data "ise_trustsec_ip_to_sgt_mapping" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
```

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

### Required

- `id` (String) The id of the object

### Read-Only

- `deploy_to` (String) Mandatory unless mappingGroup is set or unless `deployType=ALL`
- `deploy_type` (String) Deploy Type
- `description` (String) Description
- `host_ip` (String) Mandatory if hostName is empty -- valid IP
- `host_name` (String) Mandatory if hostIp is empty
- `mapping_group` (String) IP to SGT Mapping Group ID. Mandatory unless sgt and deployTo and deployType are set
- `name` (String) The name of the IP to SGT mapping
- `sgt` (String) Trustsec Security Group ID. Mandatory unless mappingGroup is set
34 changes: 34 additions & 0 deletions docs/data-sources/trustsec_ip_to_sgt_mapping_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_trustsec_ip_to_sgt_mapping_group Data Source - terraform-provider-ise"
subcategory: "TrustSec"
description: |-
This data source can read the TrustSec IP to SGT Mapping Group.
---

# ise_trustsec_ip_to_sgt_mapping_group (Data Source)

This data source can read the TrustSec IP to SGT Mapping Group.

## Example Usage

```terraform
data "ise_trustsec_ip_to_sgt_mapping_group" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
```

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

### Required

- `id` (String) The id of the object

### Read-Only

- `deploy_to` (String) Mandatory unless `deployType=ALL`
- `deploy_type` (String) Deploy Type
- `description` (String) Description
- `name` (String) The name of the IP to SGT mapping Group
- `sgt` (String) Trustsec Security Group ID
52 changes: 52 additions & 0 deletions docs/resources/trustsec_ip_to_sgt_mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_trustsec_ip_to_sgt_mapping Resource - terraform-provider-ise"
subcategory: "TrustSec"
description: |-
This resource can manage a TrustSec IP to SGT Mapping.
---

# ise_trustsec_ip_to_sgt_mapping (Resource)

This resource can manage a TrustSec IP to SGT Mapping.

## Example Usage

```terraform
resource "ise_trustsec_ip_to_sgt_mapping" "example" {
name = "10.0.0.1/32"
deploy_type = "ALL"
host_ip = "10.0.0.1/32"
sgt = "93e1bf00-8c01-11e6-996c-525400b48521"
}
```

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

### Required

- `name` (String) The name of the IP to SGT mapping

### Optional

- `deploy_to` (String) Mandatory unless mappingGroup is set or unless `deployType=ALL`
- `deploy_type` (String) Deploy Type
- Choices: `ALL`, `ND`, `NDG`
- `description` (String) Description
- `host_ip` (String) Mandatory if hostName is empty -- valid IP
- `host_name` (String) Mandatory if hostIp is empty
- `mapping_group` (String) IP to SGT Mapping Group ID. Mandatory unless sgt and deployTo and deployType are set
- `sgt` (String) Trustsec Security Group ID. Mandatory unless mappingGroup is set

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import ise_trustsec_ip_to_sgt_mapping.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
```
48 changes: 48 additions & 0 deletions docs/resources/trustsec_ip_to_sgt_mapping_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_trustsec_ip_to_sgt_mapping_group Resource - terraform-provider-ise"
subcategory: "TrustSec"
description: |-
This resource can manage a TrustSec IP to SGT Mapping Group.
---

# ise_trustsec_ip_to_sgt_mapping_group (Resource)

This resource can manage a TrustSec IP to SGT Mapping Group.

## Example Usage

```terraform
resource "ise_trustsec_ip_to_sgt_mapping_group" "example" {
name = "groupA"
deploy_type = "ALL"
sgt = "93e1bf00-8c01-11e6-996c-525400b48521"
}
```

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

### Required

- `deploy_type` (String) Deploy Type
- Choices: `ALL`, `ND`, `NDG`
- `name` (String) The name of the IP to SGT mapping Group
- `sgt` (String) Trustsec Security Group ID

### Optional

- `deploy_to` (String) Mandatory unless `deployType=ALL`
- `description` (String) Description

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import ise_trustsec_ip_to_sgt_mapping_group.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "ise_trustsec_ip_to_sgt_mapping" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "ise_trustsec_ip_to_sgt_mapping_group" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import ise_trustsec_ip_to_sgt_mapping.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
6 changes: 6 additions & 0 deletions examples/resources/ise_trustsec_ip_to_sgt_mapping/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "ise_trustsec_ip_to_sgt_mapping" "example" {
name = "10.0.0.1/32"
deploy_type = "ALL"
host_ip = "10.0.0.1/32"
sgt = "93e1bf00-8c01-11e6-996c-525400b48521"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import ise_trustsec_ip_to_sgt_mapping_group.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "ise_trustsec_ip_to_sgt_mapping_group" "example" {
name = "groupA"
deploy_type = "ALL"
sgt = "93e1bf00-8c01-11e6-996c-525400b48521"
}
63 changes: 63 additions & 0 deletions gen/definitions/trustsec_ip_to_sgt_mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: TrustSec IP to SGT Mapping
rest_endpoint: /ers/config/sgmapping
doc_category: TrustSec
id_path: response.id
attributes:
- model_name: name
data_path: [SGMapping]
type: String
mandatory: true
description: The name of the IP to SGT mapping
example: 10.0.0.1/32
- model_name: description
data_path: [SGMapping]
type: String
description: Description
exclude_test: true
- model_name: deployTo
data_path: [SGMapping]
type: String
description: "Mandatory unless mappingGroup is set or unless `deployType=ALL`"
exclude_test: true
example: "All Locations"
- model_name: deployType
data_path: [SGMapping]
type: String
enum_values: [ALL, ND, NDG]
example: "ALL"
minimum_test_value: '"ALL"'
description: "Deploy Type"
- model_name: hostName
data_path: [SGMapping]
type: String
description: Mandatory if hostIp is empty
example: "server1.cisco.com"
exclude_test: true
- model_name: hostIp
data_path: [SGMapping]
type: String
description: Mandatory if hostName is empty -- valid IP
example: "10.0.0.1/32"
minimum_test_value: '"10.0.0.1/32"'
- model_name: sgt
data_path: [SGMapping]
type: String
example: "93e1bf00-8c01-11e6-996c-525400b48521"
minimum_test_value: ise_trustsec_security_group.test.id
description: Trustsec Security Group ID. Mandatory unless mappingGroup is set
- model_name: mappingGroup
data_path: [SGMapping]
type: String
example: "48fc1ac2-d500-493d-99ad-8d8fab0ef11f"
description: IP to SGT Mapping Group ID. Mandatory unless sgt and deployTo and deployType are set
exclude_test: true

test_prerequisites: |
resource "ise_trustsec_security_group" "test" {
name = "SGT1234"
description = "My SGT"
value = 1234
propogate_to_apic = true
is_read_only = false
}
46 changes: 46 additions & 0 deletions gen/definitions/trustsec_ip_to_sgt_mapping_group.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: TrustSec IP to SGT Mapping Group
rest_endpoint: /ers/config/sgmappinggroup
doc_category: TrustSec
id_path: response.id
attributes:
- model_name: name
data_path: [SGMappingGroup]
type: String
mandatory: true
description: The name of the IP to SGT mapping Group
example: groupA
- model_name: description
data_path: [SGMappingGroup]
type: String
description: Description
exclude_test: true
- model_name: deployTo
data_path: [SGMappingGroup]
type: String
description: "Mandatory unless `deployType=ALL`"
exclude_test: true
example: "All Locations"
- model_name: deployType
data_path: [SGMappingGroup]
type: String
enum_values: [ALL, ND, NDG]
example: "ALL"
description: "Deploy Type"
mandatory: true
- model_name: sgt
data_path: [SGMappingGroup]
type: String
example: "93e1bf00-8c01-11e6-996c-525400b48521"
mandatory: true
minimum_test_value: ise_trustsec_security_group.test.id
description: Trustsec Security Group ID

test_prerequisites: |
resource "ise_trustsec_security_group" "test" {
name = "SGT1234"
description = "My SGT"
value = 1234
propogate_to_apic = true
is_read_only = false
}
Loading

0 comments on commit 982c216

Please sign in to comment.