diff --git a/.changelog/25789.txt b/.changelog/25789.txt new file mode 100644 index 00000000000..fdf2e6098b2 --- /dev/null +++ b/.changelog/25789.txt @@ -0,0 +1,3 @@ +```release-note:bug +data-source/aws_networkmanager_core_network_policy_document: Fix bug where bool values in `segments` blocks weren't being included in json payloads +``` diff --git a/internal/service/networkmanager/core_network_policy_document_data_source_test.go b/internal/service/networkmanager/core_network_policy_document_data_source_test.go index 98ce77bf041..e2062f0e6b2 100644 --- a/internal/service/networkmanager/core_network_policy_document_data_source_test.go +++ b/internal/service/networkmanager/core_network_policy_document_data_source_test.go @@ -76,7 +76,7 @@ data "aws_networkmanager_core_network_policy_document" "test" { segments { name = "AnotherGoodSegmentSpecification" description = "A good segment." - require_attachment_acceptance = true + require_attachment_acceptance = false isolate_attachments = false allow_filter = ["AllowThisSegment"] } @@ -99,12 +99,12 @@ data "aws_networkmanager_core_network_policy_document" "test" { segments { name = "b" require_attachment_acceptance = true - isolate_attachments = false + isolate_attachments = true } segments { name = "c" - require_attachment_acceptance = true isolate_attachments = false + require_attachment_acceptance = true } segment_actions { @@ -249,7 +249,7 @@ data "aws_networkmanager_core_network_policy_document" "test" { action { association_method = "constant" segment = "GoodSegmentSpecification" - require_acceptance = true + require_acceptance = false } } @@ -314,6 +314,7 @@ func testAccPolicyDocumentExpectedJSON() string { "us-east-1", "eu-west-1" ], + "isolate-attachments": false, "require-attachment-acceptance": true }, { @@ -322,29 +323,35 @@ func testAccPolicyDocumentExpectedJSON() string { "allow-filter": [ "AllowThisSegment" ], - "require-attachment-acceptance": true + "isolate-attachments": false, + "require-attachment-acceptance": false }, { "name": "AllowThisSegment", "deny-filter": [ "DenyThisSegment" ], + "isolate-attachments": false, "require-attachment-acceptance": true }, { "name": "DenyThisSegment", + "isolate-attachments": false, "require-attachment-acceptance": true }, { "name": "a", + "isolate-attachments": false, "require-attachment-acceptance": true }, { "name": "b", + "isolate-attachments": true, "require-attachment-acceptance": true }, { "name": "c", + "isolate-attachments": false, "require-attachment-acceptance": true } ], @@ -353,7 +360,8 @@ func testAccPolicyDocumentExpectedJSON() string { "rule-number": 1, "action": { "association-method": "tag", - "tag-value-of-key": "segment" + "tag-value-of-key": "segment", + "require-acceptance": false }, "conditions": [ { @@ -435,7 +443,7 @@ func testAccPolicyDocumentExpectedJSON() string { "action": { "association-method": "constant", "segment": "GoodSegmentSpecification", - "require-acceptance": true + "require-acceptance": false }, "conditions": [ { diff --git a/internal/service/networkmanager/core_network_policy_model.go b/internal/service/networkmanager/core_network_policy_model.go index 5695c47ed5a..dffa5494516 100644 --- a/internal/service/networkmanager/core_network_policy_model.go +++ b/internal/service/networkmanager/core_network_policy_model.go @@ -35,7 +35,7 @@ type CoreNetworkAttachmentPolicyAction struct { AssociationMethod string `json:"association-method,omitempty"` Segment string `json:"segment,omitempty"` TagValueOfKey string `json:"tag-value-of-key,omitempty"` - RequireAcceptance bool `json:"require-acceptance,omitempty"` + RequireAcceptance bool `json:"require-acceptance"` } type CoreNetworkAttachmentPolicyCondition struct { @@ -51,8 +51,8 @@ type CoreNetworkPolicySegment struct { AllowFilter interface{} `json:"allow-filter,omitempty"` DenyFilter interface{} `json:"deny-filter,omitempty"` EdgeLocations interface{} `json:"edge-locations,omitempty"` - IsolateAttachments bool `json:"isolate-attachments,omitempty"` - RequireAttachmentAcceptance bool `json:"require-attachment-acceptance,omitempty"` + IsolateAttachments bool `json:"isolate-attachments"` + RequireAttachmentAcceptance bool `json:"require-attachment-acceptance"` } type CoreNetworkPolicyCoreNetworkConfiguration struct {