From 7f4deae060fd485e6c1b4fa3ceb28f22ca7e4d64 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Sat, 7 Sep 2024 10:35:26 +0100 Subject: [PATCH] Regenerate files --- ...lication_priority_traffic_policy_policy.md | 9 +++- ...lication_priority_traffic_policy_policy.md | 44 ++++++++++++++++++- .../traffic_data_policy_definition.md | 2 +- .../data-source.tf | 0 .../import.sh | 0 .../resource.tf | 0 .../resource.tf | 2 +- .../traffic_data_policy_definition.yaml | 2 +- .../application_priority_traffic_policy.yaml | 9 ++-- ...ication_priority_traffic_policy_policy.go} | 0 ...on_priority_traffic_policy_policy_test.go} | 9 ++-- ...wan_traffic_data_policy_definition_test.go | 4 +- ...ication_priority_traffic_policy_policy.go} | 0 ...ication_priority_traffic_policy_policy.go} | 0 ...on_priority_traffic_policy_policy_test.go} | 9 ++-- ...wan_traffic_data_policy_definition_test.go | 4 +- 16 files changed, 75 insertions(+), 19 deletions(-) rename examples/data-sources/{sdwan_application_priority_traffic_policy_profile_parcel => sdwan_application_priority_traffic_policy_policy}/data-source.tf (100%) rename examples/resources/{sdwan_application_priority_traffic_policy_profile_parcel => sdwan_application_priority_traffic_policy_policy}/import.sh (100%) rename examples/resources/{sdwan_application_priority_traffic_policy_profile_parcel => sdwan_application_priority_traffic_policy_policy}/resource.tf (100%) rename internal/provider/{data_source_sdwan_application_priority_traffic_policy_profile_parcel.go => data_source_sdwan_application_priority_traffic_policy_policy.go} (100%) rename internal/provider/{data_source_sdwan_application_priority_traffic_policy_profile_parcel_test.go => data_source_sdwan_application_priority_traffic_policy_policy_test.go} (94%) rename internal/provider/{model_sdwan_application_priority_traffic_policy_profile_parcel.go => model_sdwan_application_priority_traffic_policy_policy.go} (100%) rename internal/provider/{resource_sdwan_application_priority_traffic_policy_profile_parcel.go => resource_sdwan_application_priority_traffic_policy_policy.go} (100%) rename internal/provider/{resource_sdwan_application_priority_traffic_policy_profile_parcel_test.go => resource_sdwan_application_priority_traffic_policy_policy_test.go} (94%) diff --git a/docs/data-sources/application_priority_traffic_policy_policy.md b/docs/data-sources/application_priority_traffic_policy_policy.md index d82f708f7..9d67d7f6a 100644 --- a/docs/data-sources/application_priority_traffic_policy_policy.md +++ b/docs/data-sources/application_priority_traffic_policy_policy.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "sdwan_application_priority_traffic_policy_policy Data Source - terraform-provider-sdwan" -subcategory: "Policy" +subcategory: "Policies" description: |- This data source can read the Application Priority Traffic Policy Policy. --- @@ -10,7 +10,14 @@ description: |- This data source can read the Application Priority Traffic Policy Policy. +## Example Usage +```terraform +data "sdwan_application_priority_traffic_policy_policy" "example" { + id = "f6b2c44c-693c-4763-b010-895aa3d236bd" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" +} +``` ## Schema diff --git a/docs/resources/application_priority_traffic_policy_policy.md b/docs/resources/application_priority_traffic_policy_policy.md index f238c8657..cf6165e7a 100644 --- a/docs/resources/application_priority_traffic_policy_policy.md +++ b/docs/resources/application_priority_traffic_policy_policy.md @@ -1,7 +1,7 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "sdwan_application_priority_traffic_policy_policy Resource - terraform-provider-sdwan" -subcategory: "Policy" +subcategory: "Policies" description: |- This resource can manage a Application Priority Traffic Policy Policy. Minimum SD-WAN Manager version: 20.12.0 @@ -12,7 +12,39 @@ description: |- This resource can manage a Application Priority Traffic Policy Policy. - Minimum SD-WAN Manager version: `20.12.0` - +## Example Usage + +```terraform +resource "sdwan_application_priority_traffic_policy_policy" "example" { + name = "Example" + description = "My Example" + feature_profile_id = "f6dd22c8-0b4f-496c-9a0b-6813d1f8b8ac" + default_action = "accept" + vpn = ["edge_basic_vpn1"] + direction = "all" + sequences = [ + { + sequence_id = 1 + sequence_name = "traffic" + base_action = "accept" + protocol = "ipv4" + matches = [ + { + dscp = 1 + } + ] + actions = [ + { + sets = [ + { + } + ] + } + ] + } + ] +} +``` ## Schema @@ -165,3 +197,11 @@ Optional: - Choices: `gold-voip-telephony`, `gold-broadcast-video`, `gold-real-time-interactive`, `gold-multimedia-conferencing`, `gold-multimedia-streaming`, `gold-network-control`, `gold-signaling`, `gold-ops-admin-mgmt`, `gold-transactional-data`, `gold-bulk-data`, `silver`, `bronze` - `traffic_to` (String) Traffic to - Choices: `core`, `service`, `access` + +## Import + +Import is supported using the following syntax: + +```shell +terraform import sdwan_application_priority_traffic_policy_policy.example "f6b2c44c-693c-4763-b010-895aa3d236bd" +``` diff --git a/docs/resources/traffic_data_policy_definition.md b/docs/resources/traffic_data_policy_definition.md index acf122da1..979680d6c 100644 --- a/docs/resources/traffic_data_policy_definition.md +++ b/docs/resources/traffic_data_policy_definition.md @@ -16,7 +16,7 @@ This resource can manage a Traffic Data Policy Definition . resource "sdwan_traffic_data_policy_definition" "example" { name = "Example" description = "My description" - default_action = "accept" + default_action = "drop" sequences = [ { id = 1 diff --git a/examples/data-sources/sdwan_application_priority_traffic_policy_profile_parcel/data-source.tf b/examples/data-sources/sdwan_application_priority_traffic_policy_policy/data-source.tf similarity index 100% rename from examples/data-sources/sdwan_application_priority_traffic_policy_profile_parcel/data-source.tf rename to examples/data-sources/sdwan_application_priority_traffic_policy_policy/data-source.tf diff --git a/examples/resources/sdwan_application_priority_traffic_policy_profile_parcel/import.sh b/examples/resources/sdwan_application_priority_traffic_policy_policy/import.sh similarity index 100% rename from examples/resources/sdwan_application_priority_traffic_policy_profile_parcel/import.sh rename to examples/resources/sdwan_application_priority_traffic_policy_policy/import.sh diff --git a/examples/resources/sdwan_application_priority_traffic_policy_profile_parcel/resource.tf b/examples/resources/sdwan_application_priority_traffic_policy_policy/resource.tf similarity index 100% rename from examples/resources/sdwan_application_priority_traffic_policy_profile_parcel/resource.tf rename to examples/resources/sdwan_application_priority_traffic_policy_policy/resource.tf diff --git a/examples/resources/sdwan_traffic_data_policy_definition/resource.tf b/examples/resources/sdwan_traffic_data_policy_definition/resource.tf index 5c394663d..df75b43bc 100644 --- a/examples/resources/sdwan_traffic_data_policy_definition/resource.tf +++ b/examples/resources/sdwan_traffic_data_policy_definition/resource.tf @@ -1,7 +1,7 @@ resource "sdwan_traffic_data_policy_definition" "example" { name = "Example" description = "My description" - default_action = "accept" + default_action = "drop" sequences = [ { id = 1 diff --git a/gen/definitions/generic/traffic_data_policy_definition.yaml b/gen/definitions/generic/traffic_data_policy_definition.yaml index fab883611..29e9c00db 100644 --- a/gen/definitions/generic/traffic_data_policy_definition.yaml +++ b/gen/definitions/generic/traffic_data_policy_definition.yaml @@ -27,7 +27,7 @@ attributes: type: String enum_values: [accept, drop] description: Default action, either `accept` or `drop` - example: accept + example: drop - model_name: sequences tf_name: sequences type: List diff --git a/gen/definitions/profile_parcels/application_priority_traffic_policy.yaml b/gen/definitions/profile_parcels/application_priority_traffic_policy.yaml index e3f582da8..7ef8f21ef 100644 --- a/gen/definitions/profile_parcels/application_priority_traffic_policy.yaml +++ b/gen/definitions/profile_parcels/application_priority_traffic_policy.yaml @@ -477,17 +477,20 @@ attributes: # example: zScaler test_prerequisites: | - variable "policy_object_feature_template_id" {} + resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST_POLICY_OBJECT" + description = "My policy object feature profile 1" + } resource "sdwan_application_priority_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" } - resource "sdwan_policy_object_policer_profile_parcel" "test" { + resource "sdwan_policy_object_policer" "test" { name = "TF_TEST_POLICER" description = "My Example" - feature_profile_id = var.policy_object_feature_template_id + feature_profile_id = sdwan_policy_object_feature_profile.test.id entries = [ { burst_bytes = 56500 diff --git a/internal/provider/data_source_sdwan_application_priority_traffic_policy_profile_parcel.go b/internal/provider/data_source_sdwan_application_priority_traffic_policy_policy.go similarity index 100% rename from internal/provider/data_source_sdwan_application_priority_traffic_policy_profile_parcel.go rename to internal/provider/data_source_sdwan_application_priority_traffic_policy_policy.go diff --git a/internal/provider/data_source_sdwan_application_priority_traffic_policy_profile_parcel_test.go b/internal/provider/data_source_sdwan_application_priority_traffic_policy_policy_test.go similarity index 94% rename from internal/provider/data_source_sdwan_application_priority_traffic_policy_profile_parcel_test.go rename to internal/provider/data_source_sdwan_application_priority_traffic_policy_policy_test.go index 3b5377c1b..c122f2ed1 100644 --- a/internal/provider/data_source_sdwan_application_priority_traffic_policy_profile_parcel_test.go +++ b/internal/provider/data_source_sdwan_application_priority_traffic_policy_policy_test.go @@ -56,17 +56,20 @@ func TestAccDataSourceSdwanApplicationPriorityTrafficPolicyProfileParcel(t *test // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites const testAccDataSourceSdwanApplicationPriorityTrafficPolicyPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} +resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST_POLICY_OBJECT" + description = "My policy object feature profile 1" +} resource "sdwan_application_priority_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" } -resource "sdwan_policy_object_policer_profile_parcel" "test" { +resource "sdwan_policy_object_policer" "test" { name = "TF_TEST_POLICER" description = "My Example" - feature_profile_id = var.policy_object_feature_template_id + feature_profile_id = sdwan_policy_object_feature_profile.test.id entries = [ { burst_bytes = 56500 diff --git a/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go b/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go index 9a45f96cd..fe4468ce5 100644 --- a/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go +++ b/internal/provider/data_source_sdwan_traffic_data_policy_definition_test.go @@ -31,7 +31,7 @@ func TestAccDataSourceSdwanTrafficDataPolicyDefinition(t *testing.T) { var checks []resource.TestCheckFunc checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "name", "Example")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "description", "My description")) - checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "default_action", "accept")) + checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "default_action", "drop")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "sequences.0.id", "1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "sequences.0.name", "Seq1")) checks = append(checks, resource.TestCheckResourceAttr("data.sdwan_traffic_data_policy_definition.test", "sequences.0.type", "applicationFirewall")) @@ -75,7 +75,7 @@ func testAccDataSourceSdwanTrafficDataPolicyDefinitionConfig() string { config += `resource "sdwan_traffic_data_policy_definition" "test" {` + "\n" config += ` name = "Example"` + "\n" config += ` description = "My description"` + "\n" - config += ` default_action = "accept"` + "\n" + config += ` default_action = "drop"` + "\n" config += ` sequences = [{` + "\n" config += ` id = 1` + "\n" config += ` name = "Seq1"` + "\n" diff --git a/internal/provider/model_sdwan_application_priority_traffic_policy_profile_parcel.go b/internal/provider/model_sdwan_application_priority_traffic_policy_policy.go similarity index 100% rename from internal/provider/model_sdwan_application_priority_traffic_policy_profile_parcel.go rename to internal/provider/model_sdwan_application_priority_traffic_policy_policy.go diff --git a/internal/provider/resource_sdwan_application_priority_traffic_policy_profile_parcel.go b/internal/provider/resource_sdwan_application_priority_traffic_policy_policy.go similarity index 100% rename from internal/provider/resource_sdwan_application_priority_traffic_policy_profile_parcel.go rename to internal/provider/resource_sdwan_application_priority_traffic_policy_policy.go diff --git a/internal/provider/resource_sdwan_application_priority_traffic_policy_profile_parcel_test.go b/internal/provider/resource_sdwan_application_priority_traffic_policy_policy_test.go similarity index 94% rename from internal/provider/resource_sdwan_application_priority_traffic_policy_profile_parcel_test.go rename to internal/provider/resource_sdwan_application_priority_traffic_policy_policy_test.go index a57574fc2..5ea42b756 100644 --- a/internal/provider/resource_sdwan_application_priority_traffic_policy_profile_parcel_test.go +++ b/internal/provider/resource_sdwan_application_priority_traffic_policy_policy_test.go @@ -57,17 +57,20 @@ func TestAccSdwanApplicationPriorityTrafficPolicyProfileParcel(t *testing.T) { // Section below is generated&owned by "gen/generator.go". //template:begin testPrerequisites const testAccSdwanApplicationPriorityTrafficPolicyPrerequisitesProfileParcelConfig = ` -variable "policy_object_feature_template_id" {} +resource "sdwan_policy_object_feature_profile" "test" { + name = "TF_TEST_POLICY_OBJECT" + description = "My policy object feature profile 1" +} resource "sdwan_application_priority_feature_profile" "test" { name = "TF_TEST" description = "Terraform test" } -resource "sdwan_policy_object_policer_profile_parcel" "test" { +resource "sdwan_policy_object_policer" "test" { name = "TF_TEST_POLICER" description = "My Example" - feature_profile_id = var.policy_object_feature_template_id + feature_profile_id = sdwan_policy_object_feature_profile.test.id entries = [ { burst_bytes = 56500 diff --git a/internal/provider/resource_sdwan_traffic_data_policy_definition_test.go b/internal/provider/resource_sdwan_traffic_data_policy_definition_test.go index b8c0756a2..99314af9c 100644 --- a/internal/provider/resource_sdwan_traffic_data_policy_definition_test.go +++ b/internal/provider/resource_sdwan_traffic_data_policy_definition_test.go @@ -31,7 +31,7 @@ func TestAccSdwanTrafficDataPolicyDefinition(t *testing.T) { var checks []resource.TestCheckFunc checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "name", "Example")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "description", "My description")) - checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "default_action", "accept")) + checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "default_action", "drop")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "sequences.0.id", "1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "sequences.0.name", "Seq1")) checks = append(checks, resource.TestCheckResourceAttr("sdwan_traffic_data_policy_definition.test", "sequences.0.type", "applicationFirewall")) @@ -74,7 +74,7 @@ func testAccSdwanTrafficDataPolicyDefinitionConfig_all() string { config := `resource "sdwan_traffic_data_policy_definition" "test" {` + "\n" config += ` name = "Example"` + "\n" config += ` description = "My description"` + "\n" - config += ` default_action = "accept"` + "\n" + config += ` default_action = "drop"` + "\n" config += ` sequences = [{` + "\n" config += ` id = 1` + "\n" config += ` name = "Seq1"` + "\n"