From 7b66b17a3eec6df0bde361c043a4f75987362943 Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 20:39:33 -0700 Subject: [PATCH 1/7] POR-32339 CPS Documentation & Rules Engine Diff Correction 1) Ignore raw_value, raw_source, and raw_destination fields returned from Rules Engine API in diff 2) Update CPS import command doc to remove Account Number as it is not needed --- docs/resources/cps_certificate.md | 5 +- edgecast/resources/rulesengine/v4policy.go | 6 ++ .../resources/rulesengine/v4policy_test.go | 102 +++++++++++++++++- templates/resources/cps_certificate.md.tmpl | 5 +- 4 files changed, 111 insertions(+), 7 deletions(-) diff --git a/docs/resources/cps_certificate.md b/docs/resources/cps_certificate.md index 2e80c4f5..1b3558be 100644 --- a/docs/resources/cps_certificate.md +++ b/docs/resources/cps_certificate.md @@ -363,12 +363,11 @@ Manage an existing TLS certificate through Terraform by importing it as a resour } 1. Run the following command to attach a TLS certificate request to your resource configuration. - terraform import edgecast_cps_certificate. : + terraform import edgecast_cps_certificate. * `` - Replace this term with the name of the resource defined in step 1. - * `` - Replace this term with your customer account number. Find your account number in the upper right-hand corner of the MCC. * `` - Replace this term with the system-defined ID assigned to the desired TLS certificate request. You may retrieve a list of TLS certificate requests and their system-defined IDs through our [REST API](https://developer.edgecast.com/cdn/api/index.html#CPS/Get-All-Certificate-Requests.htm). **Example:** - terraform import edgecast_cps_certificate.sample_certificate 0001:123456 + terraform import edgecast_cps_certificate.sample_certificate 123456 -> Upon running the above command, a resource for that TLS certificate request will be recorded in the state file. diff --git a/edgecast/resources/rulesengine/v4policy.go b/edgecast/resources/rulesengine/v4policy.go index b3703c57..fabd4112 100644 --- a/edgecast/resources/rulesengine/v4policy.go +++ b/edgecast/resources/rulesengine/v4policy.go @@ -283,6 +283,8 @@ func cleanMatches(matches []interface{}) ([]map[string]interface{}, error) { } delete(cleanedMatch, "ordinal") + delete(cleanedMatch, "raw_value") + err := standardizeMatchFeature(cleanedMatch) if err != nil { return nil, fmt.Errorf("error standardizing match: %w", err) @@ -301,7 +303,11 @@ func cleanMatches(matches []interface{}) ([]map[string]interface{}, error) { cleanedFeatures := make([]map[string]interface{}, 0) for _, feature := range features { cleanedFeature := feature.(map[string]interface{}) + delete(cleanedFeature, "ordinal") + delete(cleanedFeature, "raw_source") + delete(cleanedFeature, "raw_destination") + err := standardizeMatchFeature(cleanedFeature) if err != nil { return nil, fmt.Errorf("error standardizing features: %w", err) diff --git a/edgecast/resources/rulesengine/v4policy_test.go b/edgecast/resources/rulesengine/v4policy_test.go index dae67d46..63572524 100644 --- a/edgecast/resources/rulesengine/v4policy_test.go +++ b/edgecast/resources/rulesengine/v4policy_test.go @@ -2,8 +2,10 @@ package rulesengine import ( "encoding/json" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "reflect" "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) type JSONMap map[string]any @@ -104,3 +106,101 @@ func Test_policyDiffSuppress(t *testing.T) { }) } } + +func Test_cleanMatches(t *testing.T) { + + policy := map[string]any{ + "@type": "Policy", + "name": "tf--staging-http_large-1727827247", + "policy_type": "customer", + "state": "locked", + "created_at": "2024-10-02T00:00:47Z", + "rules": []any{ + map[string]interface{}{ + "name": "CustOriginMatch", + "description": "Rule to match origin to test raw values", + "ordinal": 1, + "created_at": "2024-10-02T00:00:47Z", + "@id": "/rules-engine/v1.1/policies/4409533/rules/33753446", + "@type": "Rule", + "id": "33753446", + "updated_at": "2024-10-02T00:00:47Z", + "matches": []any{ + map[string]any{ + "type": "match.origin.customer-origin.literal", + "ordinal": 1, + "value": "/804FDBB/test/", + "raw_value": "/804FDBB/test/", + "features": []any{ + map[string]any{ + "type": "feature.url.url-redirect", + "ordinal": 1, + "code": "301", + "destination": "/804FDBB/test/testdest", + "raw_destination": "/804FDBB/test/testdest", + "source": "/804FDBB/test/testsource", + "raw_source": "/804FDBB/test/testsource", + }, + }, + }, + }, + }, + }, + "@id": "/rules-engine/v1.1/policies/4409533", + "id": "4409533", + "description": "This is a test policy of PolicyCreate.", + "platform": "http_large", + "updated_at": "2024-10-02T00:00:47Z", + "history": []any{}, + } + + cleanedPolicy := map[string]any{ + "name": "tf--staging-http_large-1727827247", + "rules": []map[string]interface{}{ + { + "name": "CustOriginMatch", + "description": "Rule to match origin to test raw values", + "matches": []map[string]interface{}{ + { + "type": "match.origin.customer-origin.literal", + "value": "/804FDBB/test/", + "features": []map[string]interface{}{ + { + "type": "feature.url.url-redirect", + "code": "301", + "destination": "/804FDBB/test/testdest", + "source": "/804FDBB/test/testsource", + }, + }, + }, + }, + }, + }, + "description": "This is a test policy of PolicyCreate.", + "platform": "http_large", + } + + tests := []struct { + name string + originalPolicy map[string]any + expectedPolicy map[string]any + }{ + { + name: "Unneeded Values Removed", + originalPolicy: policy, + expectedPolicy: cleanedPolicy, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := cleanPolicy(tt.originalPolicy) + if err != nil { + t.Errorf("cleanPolicy() function call errored unexpectedly %v", err) + } + + if !reflect.DeepEqual(tt.originalPolicy, tt.expectedPolicy) { + t.Errorf("cleanPolicy() = got %v, want %v", tt.originalPolicy, tt.expectedPolicy) + } + }) + } +} diff --git a/templates/resources/cps_certificate.md.tmpl b/templates/resources/cps_certificate.md.tmpl index 4f7bbf66..1ee97f2b 100644 --- a/templates/resources/cps_certificate.md.tmpl +++ b/templates/resources/cps_certificate.md.tmpl @@ -53,12 +53,11 @@ Manage an existing TLS certificate through Terraform by importing it as a resour } 1. Run the following command to attach a TLS certificate request to your resource configuration. - terraform import edgecast_cps_certificate. : + terraform import edgecast_cps_certificate. * `` - Replace this term with the name of the resource defined in step 1. - * `` - Replace this term with your customer account number. Find your account number in the upper right-hand corner of the MCC. * `` - Replace this term with the system-defined ID assigned to the desired TLS certificate request. You may retrieve a list of TLS certificate requests and their system-defined IDs through our [REST API](https://developer.edgecast.com/cdn/api/index.html#CPS/Get-All-Certificate-Requests.htm). **Example:** - terraform import edgecast_cps_certificate.sample_certificate 0001:123456 + terraform import edgecast_cps_certificate.sample_certificate 123456 -> Upon running the above command, a resource for that TLS certificate request will be recorded in the state file. From 16017fd26a61223f2b544c21f3c7076b95dec3da Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 20:48:34 -0700 Subject: [PATCH 2/7] Provider version bump --- Makefile | 2 +- README.md | 4 ++-- Taskfile.yaml | 2 +- edgecast/provider.go | 2 +- examples/data-sources/edgecast_cps_dns_txt_token/main.tf | 2 +- examples/data-sources/edgecast_cps_full_workflow/main.tf | 2 +- examples/data-sources/edgecast_cps_target_cname/main.tf | 2 +- .../edgecast_originv3_hostname_resolution_methods/main.tf | 2 +- .../edgecast_originv3_httplarge_datasource/main.tf | 2 +- examples/data-sources/edgecast_originv3_protocoltypes/main.tf | 2 +- examples/resources/edgecast_cps_appendix/main.tf | 2 +- examples/resources/edgecast_cps_certificate/main.tf | 2 +- examples/resources/edgecast_customer/main.tf | 2 +- examples/resources/edgecast_customer_user/main.tf | 2 +- examples/resources/edgecast_dns_group/main.tf | 2 +- examples/resources/edgecast_dns_masterservergroup/main.tf | 2 +- examples/resources/edgecast_dns_secondaryzonegroup/main.tf | 2 +- examples/resources/edgecast_dns_tsig/main.tf | 2 +- examples/resources/edgecast_dns_zone/main.tf | 2 +- examples/resources/edgecast_edgecname/main.tf | 2 +- examples/resources/edgecast_origin/main.tf | 2 +- examples/resources/edgecast_originv3_httplarge/main.tf | 2 +- examples/resources/edgecast_rules_engine_policy/main.tf | 2 +- examples/resources/edgecast_waf_access_rule/main.tf | 2 +- examples/resources/edgecast_waf_bot_manager/main.tf | 2 +- examples/resources/edgecast_waf_bot_rule_set/main.tf | 2 +- examples/resources/edgecast_waf_custom_rule_set/main.tf | 2 +- examples/resources/edgecast_waf_managed_rule/main.tf | 2 +- examples/resources/edgecast_waf_rate_rule/main.tf | 2 +- examples/resources/edgecast_waf_scopes/main.tf | 2 +- install_win.bat | 2 +- test/integration/README.md | 2 +- test/integration/resources/cps_certificate/main.tf | 2 +- test/integration/resources/customer/main.tf | 2 +- test/integration/resources/customer_user/main.tf | 2 +- test/integration/resources/dns_group/main.tf | 2 +- test/integration/resources/dns_masterservergroup/main.tf | 2 +- test/integration/resources/dns_secondaryzonegroup/main.tf | 2 +- test/integration/resources/dns_tsig/main.tf | 2 +- test/integration/resources/dns_zone/main.tf | 2 +- test/integration/resources/edgecname/main.tf | 2 +- test/integration/resources/origin/main.tf | 2 +- test/integration/resources/originv3_httplarge/main.tf | 2 +- test/integration/resources/rules_engine_policy/main.tf | 2 +- test/integration/resources/waf_access_rule/main.tf | 2 +- test/integration/resources/waf_bot_manager/main.tf | 2 +- test/integration/resources/waf_bot_rule_set/main.tf | 2 +- test/integration/resources/waf_custom_rule_set/main.tf | 2 +- test/integration/resources/waf_managed_rule/main.tf | 2 +- test/integration/resources/waf_rate_rule/main.tf | 2 +- test/integration/resources/waf_scopes/main.tf | 2 +- 51 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index d4500a30..1108aa98 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ HOSTNAME=github.com NAMESPACE=terraform-providers NAME=edgecast BINARY=terraform-provider-${NAME} -VERSION=1.3.4 +VERSION=1.3.5 OS_ARCH=darwin_amd64 default: install diff --git a/README.md b/README.md index e91699bf..7eea5da7 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Reference this provider in a Terraform Configuration file (e.g. `main.tf`): terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } @@ -121,7 +121,7 @@ Example: terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/Taskfile.yaml b/Taskfile.yaml index 041e9db9..ab65cb0d 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -11,7 +11,7 @@ vars: NAMESPACE: terraform-providers NAME: edgecast BINARY: terraform-provider-{{.NAME}} - VERSION: 1.3.4 + VERSION: 1.3.5 includes: diff --git a/edgecast/provider.go b/edgecast/provider.go index e51552cb..e11fb35c 100644 --- a/edgecast/provider.go +++ b/edgecast/provider.go @@ -28,7 +28,7 @@ const ( idsURLProd string = "https://id.vdms.io" // Version indicates the current version of this provider - Version string = "1.3.4" + Version string = "1.3.5" userAgentFormat = "edgecast/terraform-provider:%s" ) diff --git a/examples/data-sources/edgecast_cps_dns_txt_token/main.tf b/examples/data-sources/edgecast_cps_dns_txt_token/main.tf index add5e014..f69fae56 100644 --- a/examples/data-sources/edgecast_cps_dns_txt_token/main.tf +++ b/examples/data-sources/edgecast_cps_dns_txt_token/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/data-sources/edgecast_cps_full_workflow/main.tf b/examples/data-sources/edgecast_cps_full_workflow/main.tf index cea063ac..bc9e1cc1 100644 --- a/examples/data-sources/edgecast_cps_full_workflow/main.tf +++ b/examples/data-sources/edgecast_cps_full_workflow/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/data-sources/edgecast_cps_target_cname/main.tf b/examples/data-sources/edgecast_cps_target_cname/main.tf index 54480945..e3510e4f 100644 --- a/examples/data-sources/edgecast_cps_target_cname/main.tf +++ b/examples/data-sources/edgecast_cps_target_cname/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/data-sources/edgecast_originv3_hostname_resolution_methods/main.tf b/examples/data-sources/edgecast_originv3_hostname_resolution_methods/main.tf index 6b9f48a5..98ffa435 100644 --- a/examples/data-sources/edgecast_originv3_hostname_resolution_methods/main.tf +++ b/examples/data-sources/edgecast_originv3_hostname_resolution_methods/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/data-sources/edgecast_originv3_httplarge_datasource/main.tf b/examples/data-sources/edgecast_originv3_httplarge_datasource/main.tf index 6b9f48a5..98ffa435 100644 --- a/examples/data-sources/edgecast_originv3_httplarge_datasource/main.tf +++ b/examples/data-sources/edgecast_originv3_httplarge_datasource/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/data-sources/edgecast_originv3_protocoltypes/main.tf b/examples/data-sources/edgecast_originv3_protocoltypes/main.tf index 6b9f48a5..98ffa435 100644 --- a/examples/data-sources/edgecast_originv3_protocoltypes/main.tf +++ b/examples/data-sources/edgecast_originv3_protocoltypes/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_cps_appendix/main.tf b/examples/resources/edgecast_cps_appendix/main.tf index 0e666ee8..f9184d3e 100644 --- a/examples/resources/edgecast_cps_appendix/main.tf +++ b/examples/resources/edgecast_cps_appendix/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_cps_certificate/main.tf b/examples/resources/edgecast_cps_certificate/main.tf index 618a51f8..043257b6 100644 --- a/examples/resources/edgecast_cps_certificate/main.tf +++ b/examples/resources/edgecast_cps_certificate/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_customer/main.tf b/examples/resources/edgecast_customer/main.tf index f6a6c67b..1381b803 100644 --- a/examples/resources/edgecast_customer/main.tf +++ b/examples/resources/edgecast_customer/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_customer_user/main.tf b/examples/resources/edgecast_customer_user/main.tf index 1b38ed77..66eb972c 100644 --- a/examples/resources/edgecast_customer_user/main.tf +++ b/examples/resources/edgecast_customer_user/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_dns_group/main.tf b/examples/resources/edgecast_dns_group/main.tf index cbcc4214..de8a8f86 100644 --- a/examples/resources/edgecast_dns_group/main.tf +++ b/examples/resources/edgecast_dns_group/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_dns_masterservergroup/main.tf b/examples/resources/edgecast_dns_masterservergroup/main.tf index 52175b43..d1212523 100644 --- a/examples/resources/edgecast_dns_masterservergroup/main.tf +++ b/examples/resources/edgecast_dns_masterservergroup/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_dns_secondaryzonegroup/main.tf b/examples/resources/edgecast_dns_secondaryzonegroup/main.tf index 71113c02..aefedecd 100644 --- a/examples/resources/edgecast_dns_secondaryzonegroup/main.tf +++ b/examples/resources/edgecast_dns_secondaryzonegroup/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_dns_tsig/main.tf b/examples/resources/edgecast_dns_tsig/main.tf index 52175b43..d1212523 100644 --- a/examples/resources/edgecast_dns_tsig/main.tf +++ b/examples/resources/edgecast_dns_tsig/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_dns_zone/main.tf b/examples/resources/edgecast_dns_zone/main.tf index 39aa03ad..f5c5a3ca 100644 --- a/examples/resources/edgecast_dns_zone/main.tf +++ b/examples/resources/edgecast_dns_zone/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_edgecname/main.tf b/examples/resources/edgecast_edgecname/main.tf index e007eaea..474acd75 100644 --- a/examples/resources/edgecast_edgecname/main.tf +++ b/examples/resources/edgecast_edgecname/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_origin/main.tf b/examples/resources/edgecast_origin/main.tf index 1884da8e..d6eac69f 100644 --- a/examples/resources/edgecast_origin/main.tf +++ b/examples/resources/edgecast_origin/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_originv3_httplarge/main.tf b/examples/resources/edgecast_originv3_httplarge/main.tf index 251e5ecc..275588f4 100644 --- a/examples/resources/edgecast_originv3_httplarge/main.tf +++ b/examples/resources/edgecast_originv3_httplarge/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_rules_engine_policy/main.tf b/examples/resources/edgecast_rules_engine_policy/main.tf index 6a9e28c8..41e41d7e 100644 --- a/examples/resources/edgecast_rules_engine_policy/main.tf +++ b/examples/resources/edgecast_rules_engine_policy/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_access_rule/main.tf b/examples/resources/edgecast_waf_access_rule/main.tf index 6b1c03f5..30f0ce42 100644 --- a/examples/resources/edgecast_waf_access_rule/main.tf +++ b/examples/resources/edgecast_waf_access_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_bot_manager/main.tf b/examples/resources/edgecast_waf_bot_manager/main.tf index 618a51f8..043257b6 100644 --- a/examples/resources/edgecast_waf_bot_manager/main.tf +++ b/examples/resources/edgecast_waf_bot_manager/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_bot_rule_set/main.tf b/examples/resources/edgecast_waf_bot_rule_set/main.tf index bb6b9807..42de52b1 100644 --- a/examples/resources/edgecast_waf_bot_rule_set/main.tf +++ b/examples/resources/edgecast_waf_bot_rule_set/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_custom_rule_set/main.tf b/examples/resources/edgecast_waf_custom_rule_set/main.tf index bb6b9807..42de52b1 100644 --- a/examples/resources/edgecast_waf_custom_rule_set/main.tf +++ b/examples/resources/edgecast_waf_custom_rule_set/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_managed_rule/main.tf b/examples/resources/edgecast_waf_managed_rule/main.tf index bb6b9807..42de52b1 100644 --- a/examples/resources/edgecast_waf_managed_rule/main.tf +++ b/examples/resources/edgecast_waf_managed_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_rate_rule/main.tf b/examples/resources/edgecast_waf_rate_rule/main.tf index bb6b9807..42de52b1 100644 --- a/examples/resources/edgecast_waf_rate_rule/main.tf +++ b/examples/resources/edgecast_waf_rate_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/examples/resources/edgecast_waf_scopes/main.tf b/examples/resources/edgecast_waf_scopes/main.tf index eb09ebc5..64000147 100644 --- a/examples/resources/edgecast_waf_scopes/main.tf +++ b/examples/resources/edgecast_waf_scopes/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/install_win.bat b/install_win.bat index f509ce00..83333d74 100644 --- a/install_win.bat +++ b/install_win.bat @@ -9,7 +9,7 @@ set HOSTNAME=github.com set NAMESPACE=terraform-providers set NAME=edgecast set BINARY=terraform-provider-%NAME%.exe -set VERSION=1.3.4 +set VERSION=1.3.5 set OS_ARCH=windows_amd64 go build diff --git a/test/integration/README.md b/test/integration/README.md index 5ac784f6..42e5722f 100644 --- a/test/integration/README.md +++ b/test/integration/README.md @@ -62,7 +62,7 @@ Within the newly-created directory, perform the following steps: terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/test/integration/resources/cps_certificate/main.tf b/test/integration/resources/cps_certificate/main.tf index 417d4b31..31fe0faa 100644 --- a/test/integration/resources/cps_certificate/main.tf +++ b/test/integration/resources/cps_certificate/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/customer/main.tf b/test/integration/resources/customer/main.tf index 69dc48f9..7672e275 100644 --- a/test/integration/resources/customer/main.tf +++ b/test/integration/resources/customer/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/customer_user/main.tf b/test/integration/resources/customer_user/main.tf index f11ee355..b85c8fb3 100644 --- a/test/integration/resources/customer_user/main.tf +++ b/test/integration/resources/customer_user/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/dns_group/main.tf b/test/integration/resources/dns_group/main.tf index 0c2999fe..bafe1f66 100644 --- a/test/integration/resources/dns_group/main.tf +++ b/test/integration/resources/dns_group/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/dns_masterservergroup/main.tf b/test/integration/resources/dns_masterservergroup/main.tf index 4df3b4b1..77d5050f 100644 --- a/test/integration/resources/dns_masterservergroup/main.tf +++ b/test/integration/resources/dns_masterservergroup/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/dns_secondaryzonegroup/main.tf b/test/integration/resources/dns_secondaryzonegroup/main.tf index 6662241b..030b7d85 100644 --- a/test/integration/resources/dns_secondaryzonegroup/main.tf +++ b/test/integration/resources/dns_secondaryzonegroup/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/dns_tsig/main.tf b/test/integration/resources/dns_tsig/main.tf index 0c2999fe..bafe1f66 100644 --- a/test/integration/resources/dns_tsig/main.tf +++ b/test/integration/resources/dns_tsig/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/dns_zone/main.tf b/test/integration/resources/dns_zone/main.tf index 5f3c78fd..2627adc8 100644 --- a/test/integration/resources/dns_zone/main.tf +++ b/test/integration/resources/dns_zone/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/edgecname/main.tf b/test/integration/resources/edgecname/main.tf index f5bad859..a7fdcbc6 100644 --- a/test/integration/resources/edgecname/main.tf +++ b/test/integration/resources/edgecname/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/origin/main.tf b/test/integration/resources/origin/main.tf index 7e6155ef..0c370be7 100644 --- a/test/integration/resources/origin/main.tf +++ b/test/integration/resources/origin/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/originv3_httplarge/main.tf b/test/integration/resources/originv3_httplarge/main.tf index 00bfd030..d8bac3d1 100644 --- a/test/integration/resources/originv3_httplarge/main.tf +++ b/test/integration/resources/originv3_httplarge/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/rules_engine_policy/main.tf b/test/integration/resources/rules_engine_policy/main.tf index 6d804a7a..4807b3f9 100644 --- a/test/integration/resources/rules_engine_policy/main.tf +++ b/test/integration/resources/rules_engine_policy/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_access_rule/main.tf b/test/integration/resources/waf_access_rule/main.tf index 61d073d6..51eddd22 100644 --- a/test/integration/resources/waf_access_rule/main.tf +++ b/test/integration/resources/waf_access_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_bot_manager/main.tf b/test/integration/resources/waf_bot_manager/main.tf index a5edd63f..68ff2bc8 100644 --- a/test/integration/resources/waf_bot_manager/main.tf +++ b/test/integration/resources/waf_bot_manager/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "Edgio/edgecast" } } diff --git a/test/integration/resources/waf_bot_rule_set/main.tf b/test/integration/resources/waf_bot_rule_set/main.tf index 61d073d6..51eddd22 100644 --- a/test/integration/resources/waf_bot_rule_set/main.tf +++ b/test/integration/resources/waf_bot_rule_set/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_custom_rule_set/main.tf b/test/integration/resources/waf_custom_rule_set/main.tf index 61d073d6..51eddd22 100644 --- a/test/integration/resources/waf_custom_rule_set/main.tf +++ b/test/integration/resources/waf_custom_rule_set/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_managed_rule/main.tf b/test/integration/resources/waf_managed_rule/main.tf index 61d073d6..51eddd22 100644 --- a/test/integration/resources/waf_managed_rule/main.tf +++ b/test/integration/resources/waf_managed_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_rate_rule/main.tf b/test/integration/resources/waf_rate_rule/main.tf index 61d073d6..51eddd22 100644 --- a/test/integration/resources/waf_rate_rule/main.tf +++ b/test/integration/resources/waf_rate_rule/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } diff --git a/test/integration/resources/waf_scopes/main.tf b/test/integration/resources/waf_scopes/main.tf index b70297c2..9c011a6a 100644 --- a/test/integration/resources/waf_scopes/main.tf +++ b/test/integration/resources/waf_scopes/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { edgecast = { - version = "1.3.4" + version = "1.3.5" source = "github.com/terraform-providers/edgecast" } } From 6982649b86dd4bdcfbf2ec255a676c92c7ee11d6 Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 20:56:43 -0700 Subject: [PATCH 3/7] goreleaser fix. --rm-dist deprecated, use --clean now --- .github/workflows/pull.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index a665f208..9f4672e8 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -24,4 +24,4 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: build --rm-dist --snapshot + args: build --clean --snapshot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8edc4d09..ec33b7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --rm-dist + args: release --clean env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 95c4634c9aa639b78a8636a969b9c9ae82dc6d2f Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 21:04:58 -0700 Subject: [PATCH 4/7] Set goreleaser config version 2 to see what it needs changed. --- .github/workflows/pull.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 9f4672e8..e712a4b2 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -23,5 +23,5 @@ jobs: - name: Build uses: goreleaser/goreleaser-action@v2 with: - version: latest + version: 2 args: build --clean --snapshot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec33b7b4..acc755f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: - version: latest + version: 2 args: release --clean env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} From b76060f381bf4cd717c6bfc7636d73189a22da38 Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 21:33:04 -0700 Subject: [PATCH 5/7] Really fix goreleaser this time. --- .github/workflows/pull.yml | 2 +- .github/workflows/release.yml | 2 +- .goreleaser.yml | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index e712a4b2..9f4672e8 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -23,5 +23,5 @@ jobs: - name: Build uses: goreleaser/goreleaser-action@v2 with: - version: 2 + version: latest args: build --clean --snapshot diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index acc755f1..ec33b7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: - version: 2 + version: latest args: release --clean env: GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.goreleaser.yml b/.goreleaser.yml index da82a806..26c96faf 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,8 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. + +version: 2 + before: hooks: # this is just an example and not a requirement for provider building/publishing @@ -51,4 +54,4 @@ release: # If you want to manually examine the release before its live, uncomment this line: # draft: true changelog: - skip: true + disable: true From c4b0cab022e7f3cf4d0b983cc09e9a54e70ef1bc Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Tue, 1 Oct 2024 21:41:17 -0700 Subject: [PATCH 6/7] Fix typo in test method name --- edgecast/resources/rulesengine/v4policy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edgecast/resources/rulesengine/v4policy_test.go b/edgecast/resources/rulesengine/v4policy_test.go index 63572524..1d8fff13 100644 --- a/edgecast/resources/rulesengine/v4policy_test.go +++ b/edgecast/resources/rulesengine/v4policy_test.go @@ -107,7 +107,7 @@ func Test_policyDiffSuppress(t *testing.T) { } } -func Test_cleanMatches(t *testing.T) { +func Test_cleanPolicy(t *testing.T) { policy := map[string]any{ "@type": "Policy", From d47ae6f0416ac0884c3334813cd96b239fd95266 Mon Sep 17 00:00:00 2001 From: Frank Contreras Date: Wed, 2 Oct 2024 10:20:53 -0700 Subject: [PATCH 7/7] Adding raw_value removal to feature cleanup. --- edgecast/resources/rulesengine/v4policy.go | 1 + edgecast/resources/rulesengine/v4policy_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/edgecast/resources/rulesengine/v4policy.go b/edgecast/resources/rulesengine/v4policy.go index fabd4112..7a14b4f2 100644 --- a/edgecast/resources/rulesengine/v4policy.go +++ b/edgecast/resources/rulesengine/v4policy.go @@ -307,6 +307,7 @@ func cleanMatches(matches []interface{}) ([]map[string]interface{}, error) { delete(cleanedFeature, "ordinal") delete(cleanedFeature, "raw_source") delete(cleanedFeature, "raw_destination") + delete(cleanedFeature, "raw_value") err := standardizeMatchFeature(cleanedFeature) if err != nil { diff --git a/edgecast/resources/rulesengine/v4policy_test.go b/edgecast/resources/rulesengine/v4policy_test.go index 1d8fff13..17965ca7 100644 --- a/edgecast/resources/rulesengine/v4policy_test.go +++ b/edgecast/resources/rulesengine/v4policy_test.go @@ -140,6 +140,8 @@ func Test_cleanPolicy(t *testing.T) { "raw_destination": "/804FDBB/test/testdest", "source": "/804FDBB/test/testsource", "raw_source": "/804FDBB/test/testsource", + "value": "Good test value", + "raw_value": "Good test value", }, }, }, @@ -170,6 +172,7 @@ func Test_cleanPolicy(t *testing.T) { "code": "301", "destination": "/804FDBB/test/testdest", "source": "/804FDBB/test/testsource", + "value": "Good test value", }, }, },