Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_advanced_malware_protection` to `20.15.0`
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_tls_ssl_decryption` to `20.15.0`
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_tls_ssl_profile` to `20.15.0`
- Add `sdwan_policy_object_security_zone` resource and data source

## 0.9.0

Expand Down
43 changes: 43 additions & 0 deletions docs/data-sources/policy_object_security_zone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_policy_object_security_zone Data Source - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This data source can read the Policy Object Security Zone Policy_object.
---

# sdwan_policy_object_security_zone (Data Source)

This data source can read the Policy Object Security Zone Policy_object.

## Example Usage

```terraform
data "sdwan_policy_object_security_zone" "example" {
id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
}
```

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

### Required

- `feature_profile_id` (String) Feature Profile ID
- `id` (String) The id of the Policy_object

### Read-Only

- `description` (String) The description of the Policy_object
- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
- `name` (String) The name of the Policy_object
- `version` (Number) The version of the Policy_object

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

Read-Only:

- `interface` (String)
- `vpn` (String)
1 change: 1 addition & 0 deletions docs/guides/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ description: |-
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_advanced_malware_protection` to `20.15.0`
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_tls_ssl_decryption` to `20.15.0`
- BREAKING CHANGE: Bump the minimum supported version of `sdwan_policy_object_unified_tls_ssl_profile` to `20.15.0`
- Add `sdwan_policy_object_security_zone` resource and data source

## 0.9.0

Expand Down
65 changes: 65 additions & 0 deletions docs/resources/policy_object_security_zone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "sdwan_policy_object_security_zone Resource - terraform-provider-sdwan"
subcategory: "Policy Objects"
description: |-
This resource can manage a Policy Object Security Zone Policy_object.
Minimum SD-WAN Manager version: 20.15.0
---

# sdwan_policy_object_security_zone (Resource)

This resource can manage a Policy Object Security Zone Policy_object.
- Minimum SD-WAN Manager version: `20.15.0`

## Example Usage

```terraform
resource "sdwan_policy_object_security_zone" "example" {
name = "Example"
description = "My Example"
feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
entries = [
{
vpn = "Guest"
}
]
}
```

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

### Required

- `entries` (Attributes List) (see [below for nested schema](#nestedatt--entries))
- `feature_profile_id` (String) Feature Profile ID
- `name` (String) The name of the Policy_object

### Optional

- `description` (String) The description of the Policy_object

### Read-Only

- `id` (String) The id of the Policy_object
- `version` (Number) The version of the Policy_object

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

Optional:

- `interface` (String)
- `vpn` (String)

## Import

Import is supported using the following syntax:

The [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import) can be used, for example:

```shell
# Expected import identifier with the format: "policy_object_security_zone_id,feature_profile_id"
terraform import sdwan_policy_object_security_zone.example "f6b2c44c-693c-4763-b010-895aa3d236bd,f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "sdwan_policy_object_security_zone" "example" {
id = "f6b2c44c-693c-4763-b010-895aa3d236bd"
feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Expected import identifier with the format: "policy_object_security_zone_id,feature_profile_id"
terraform import sdwan_policy_object_security_zone.example "f6b2c44c-693c-4763-b010-895aa3d236bd,f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
10 changes: 10 additions & 0 deletions examples/resources/sdwan_policy_object_security_zone/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "sdwan_policy_object_security_zone" "example" {
name = "Example"
description = "My Example"
feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac"
entries = [
{
vpn = "Guest"
}
]
}
37 changes: 37 additions & 0 deletions gen/definitions/profile_parcels/policy_object_security_zone.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Policy Object Security Zone
rest_endpoint: /v1/feature-profile/sdwan/policy-object/%v/security-zone
minimum_version: 20.15.0
test_tags: [SDWAN_2015]
skip_minimum_test: true
parcel_type: policy_object
full_update: true
attributes:
- tf_name: feature_profile_id
reference: true
type: String
mandatory: true
description: Feature Profile ID
example: f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac
test_value: sdwan_policy_object_feature_profile.test.id
- model_name: entries
mandatory: true
type: List
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an issue with the generator or some other reason why the type, descriptions, and min_list are being manually configured. Does the following not work?

  - model_name: entries
    mandatory: true
    attributes:
      - model_name: vpn
        example: Guest
      - model_name: interface
        exclude_test: true
        example: GigabitEthernet1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without specifying the type attribute, the object type cannot be determined, resulting in the following error:

internal/provider/model_sdwan_policy_object_security_zone.go:42:17: expected 'IDENT', found tfsdk:"entries" exit status 2 main.go:34: running "go": exit status 1
image

In the model , entries has a oneOf property and it's list.
Model:
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before approving I will have a look at the model and try to see why the generator is not working properly

min_list: 1
description: List of entries
attributes:
- model_name: vpn
type: String
tf_name: vpn
example: Guest
- model_name: interface
exclude_test: true
type: String
tf_name: interface
example: GigabitEthernet1

test_prerequisites: |
resource "sdwan_policy_object_feature_profile" "test" {
name = "POLICY_OBJECT_FP_1"
description = "My policy object feature profile 1"
}
Loading