-
Notifications
You must be signed in to change notification settings - Fork 26
[UX2.0] Add policy object security_zone feature #607
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
Open
pavithran-rathinam
wants to merge
1
commit into
CiscoDevNet:main
Choose a base branch
from
pavithran-rathinam:pol-obj-security-zone
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| ``` |
4 changes: 4 additions & 0 deletions
4
examples/data-sources/sdwan_policy_object_security_zone/data-source.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } |
2 changes: 2 additions & 0 deletions
2
examples/resources/sdwan_policy_object_security_zone/import.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
10
examples/resources/sdwan_policy_object_security_zone/resource.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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
37
gen/definitions/profile_parcels/policy_object_security_zone.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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" | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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, andmin_listare being manually configured. Does the following not work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without specifying the
typeattribute, 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 1In the model ,

entrieshas aoneOfproperty and it's list.Model:
There was a problem hiding this comment.
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