Skip to content
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

d/aws_networkmanager_core_network_policy_document allow segments block bools to set specified values #25789

Merged
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
3 changes: 3 additions & 0 deletions .changelog/25789.txt
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
Expand All @@ -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 {
Expand Down Expand Up @@ -249,7 +249,7 @@ data "aws_networkmanager_core_network_policy_document" "test" {
action {
association_method = "constant"
segment = "GoodSegmentSpecification"
require_acceptance = true
require_acceptance = false
}
}

Expand Down Expand Up @@ -314,6 +314,7 @@ func testAccPolicyDocumentExpectedJSON() string {
"us-east-1",
"eu-west-1"
],
"isolate-attachments": false,
"require-attachment-acceptance": true
},
{
Expand All @@ -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
}
],
Expand All @@ -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": [
{
Expand Down Expand Up @@ -435,7 +443,7 @@ func testAccPolicyDocumentExpectedJSON() string {
"action": {
"association-method": "constant",
"segment": "GoodSegmentSpecification",
"require-acceptance": true
"require-acceptance": false
},
"conditions": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down