diff --git a/CHANGELOG.md b/CHANGELOG.md index b5bd4d68..f8bfa0e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,8 +13,8 @@ - Fix issue with `sdwan_traffic_data_policy_definition` not supporting local and restrict options - Add `sdwan_dns_security_policy_definition` resource and data source - Add `sdwan_system_global_profile_parcel` resource and data source -- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` -- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` +- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` and update attributes +- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` and update attributes - Add `sdwan_ipv6_acl_policy_definition` resource and data source - Add `sdwan_ipv6_device_acl_policy_definition` resource and data source diff --git a/docs/data-sources/ipv4_acl_policy_definition.md b/docs/data-sources/ipv4_acl_policy_definition.md index a222ba15..12c52b0c 100644 --- a/docs/data-sources/ipv4_acl_policy_definition.md +++ b/docs/data-sources/ipv4_acl_policy_definition.md @@ -78,16 +78,16 @@ Read-Only: - `class_map_id` (String) Class map ID - `class_map_version` (Number) Class map version -- `destination_data_prefix_list_id` (String) Destination data prefix list ID -- `destination_data_prefix_list_version` (Number) Destination data prefix list version +- `destination_data_ipv4_prefix_list_id` (String) Destination data IPv4 prefix list ID +- `destination_data_ipv4_prefix_list_version` (Number) Destination data IPv4 prefix list version - `destination_ip` (String) Destination IP prefix - `destination_port` (Number) Destination port - `dscp` (Number) DSCP value - `packet_length` (Number) Packet length - `priority` (String) PLP - priority - `protocol` (String) Single value (0-255) or multiple values separated by spaces -- `source_data_prefix_list_id` (String) Source data prefix list ID -- `source_data_prefix_list_version` (Number) Source data prefix list version +- `source_data_ipv4_prefix_list_id` (String) Source data IPv4 prefix list ID +- `source_data_ipv4_prefix_list_version` (Number) Source data IPv4 prefix list version - `source_ip` (String) Source IP prefix - `source_port` (Number) Source port - `tcp` (String) TCP parameters diff --git a/docs/data-sources/ipv4_device_acl_policy_definition.md b/docs/data-sources/ipv4_device_acl_policy_definition.md index bb8a9227..79a86083 100644 --- a/docs/data-sources/ipv4_device_acl_policy_definition.md +++ b/docs/data-sources/ipv4_device_acl_policy_definition.md @@ -58,12 +58,12 @@ Read-Only: Read-Only: -- `destination_data_prefix_list_id` (String) Destination data prefix list ID -- `destination_data_prefix_list_version` (Number) Destination data prefix list version +- `destination_data_ipv4_prefix_list_id` (String) Destination data IPv4 prefix list ID +- `destination_data_ipv4_prefix_list_version` (Number) Destination data IPv4 prefix list version - `destination_ip` (String) Destination IP prefix - `destination_port` (Number) Destination port, only `22` and `161` supported -- `source_data_prefix_list_id` (String) Source data prefix list ID -- `source_data_prefix_list_version` (Number) Source data prefix list version +- `source_data_ipv4_prefix_list_id` (String) Source data IPv4 prefix list ID +- `source_data_ipv4_prefix_list_version` (Number) Source data IPv4 prefix list version - `source_ip` (String) Source IP prefix - `source_port` (Number) Source port - `type` (String) Type of match entry diff --git a/docs/guides/changelog.md b/docs/guides/changelog.md index ebd2bc30..6e3160fb 100644 --- a/docs/guides/changelog.md +++ b/docs/guides/changelog.md @@ -22,8 +22,8 @@ description: |- - Fix issue with `sdwan_traffic_data_policy_definition` not supporting local and restrict options - Add `sdwan_dns_security_policy_definition` resource and data source - Add `sdwan_system_global_profile_parcel` resource and data source -- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` -- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` +- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` and update attributes +- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` and update attributes - Add `sdwan_ipv6_acl_policy_definition` resource and data source - Add `sdwan_ipv6_device_acl_policy_definition` resource and data source diff --git a/docs/resources/ipv4_acl_policy_definition.md b/docs/resources/ipv4_acl_policy_definition.md index 4ed64527..ea2d72d2 100644 --- a/docs/resources/ipv4_acl_policy_definition.md +++ b/docs/resources/ipv4_acl_policy_definition.md @@ -127,8 +127,8 @@ Optional: - `class_map_id` (String) Class map ID - `class_map_version` (Number) Class map version -- `destination_data_prefix_list_id` (String) Destination data prefix list ID -- `destination_data_prefix_list_version` (Number) Destination data prefix list version +- `destination_data_ipv4_prefix_list_id` (String) Destination data IPv4 prefix list ID +- `destination_data_ipv4_prefix_list_version` (Number) Destination data IPv4 prefix list version - `destination_ip` (String) Destination IP prefix - `destination_port` (Number) Destination port - Range: `0`-`65535` @@ -139,8 +139,8 @@ Optional: - `priority` (String) PLP - priority - Choices: `high`, `low` - `protocol` (String) Single value (0-255) or multiple values separated by spaces -- `source_data_prefix_list_id` (String) Source data prefix list ID -- `source_data_prefix_list_version` (Number) Source data prefix list version +- `source_data_ipv4_prefix_list_id` (String) Source data IPv4 prefix list ID +- `source_data_ipv4_prefix_list_version` (Number) Source data IPv4 prefix list version - `source_ip` (String) Source IP prefix - `source_port` (Number) Source port - Range: `0`-`65535` diff --git a/docs/resources/ipv4_device_acl_policy_definition.md b/docs/resources/ipv4_device_acl_policy_definition.md index f0eabfcc..4a83f202 100644 --- a/docs/resources/ipv4_device_acl_policy_definition.md +++ b/docs/resources/ipv4_device_acl_policy_definition.md @@ -97,13 +97,13 @@ Required: Optional: -- `destination_data_prefix_list_id` (String) Destination data prefix list ID -- `destination_data_prefix_list_version` (Number) Destination data prefix list version +- `destination_data_ipv4_prefix_list_id` (String) Destination data IPv4 prefix list ID +- `destination_data_ipv4_prefix_list_version` (Number) Destination data IPv4 prefix list version - `destination_ip` (String) Destination IP prefix - `destination_port` (Number) Destination port, only `22` and `161` supported - Range: `0`-`65535` -- `source_data_prefix_list_id` (String) Source data prefix list ID -- `source_data_prefix_list_version` (Number) Source data prefix list version +- `source_data_ipv4_prefix_list_id` (String) Source data IPv4 prefix list ID +- `source_data_ipv4_prefix_list_version` (Number) Source data IPv4 prefix list version - `source_ip` (String) Source IP prefix - `source_port` (Number) Source port - Range: `0`-`65535` diff --git a/gen/definitions/generic/ipv4_acl_policy_definition.yaml b/gen/definitions/generic/ipv4_acl_policy_definition.yaml index d2603c11..ca5a54ab 100644 --- a/gen/definitions/generic/ipv4_acl_policy_definition.yaml +++ b/gen/definitions/generic/ipv4_acl_policy_definition.yaml @@ -175,32 +175,32 @@ attributes: max_int: 65535 example: 9000 - model_name: ref - tf_name: source_data_prefix_list_id + tf_name: source_data_ipv4_prefix_list_id conditional_attribute: name: type value: sourceDataPrefixList type: String - description: Source data prefix list ID + description: Source data IPv4 prefix list ID exclude_test: true example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d - - tf_name: source_data_prefix_list_version + - tf_name: source_data_ipv4_prefix_list_version tf_only: true type: Version - description: Source data prefix list version + description: Source data IPv4 prefix list version exclude_test: true - model_name: ref - tf_name: destination_data_prefix_list_id + tf_name: destination_data_ipv4_prefix_list_id conditional_attribute: name: type value: destinationDataPrefixList type: String - description: Destination data prefix list ID + description: Destination data IPv4 prefix list ID exclude_test: true example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d - - tf_name: destination_data_prefix_list_version + - tf_name: destination_data_ipv4_prefix_list_version tf_only: true type: Version - description: Destination data prefix list version + description: Destination data IPv4 prefix list version exclude_test: true - model_name: value tf_name: protocol diff --git a/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml b/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml index f4107f42..fefd5b12 100644 --- a/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml +++ b/gen/definitions/generic/ipv4_device_acl_policy_definition.yaml @@ -121,32 +121,32 @@ attributes: max_int: 65535 example: 22 - model_name: ref - tf_name: source_data_prefix_list_id + tf_name: source_data_ipv4_prefix_list_id conditional_attribute: name: type value: sourceDataPrefixList type: String - description: Source data prefix list ID + description: Source data IPv4 prefix list ID exclude_test: true example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d - - tf_name: source_data_prefix_list_version + - tf_name: source_data_ipv4_prefix_list_version tf_only: true type: Version - description: Source data prefix list version + description: Source data IPv4 prefix list version exclude_test: true - model_name: ref - tf_name: destination_data_prefix_list_id + tf_name: destination_data_ipv4_prefix_list_id conditional_attribute: name: type value: destinationDataPrefixList type: String - description: Destination data prefix list ID + description: Destination data IPv4 prefix list ID exclude_test: true example: 2081c2f4-3f9f-4fee-8078-dcc8904e368d - - tf_name: destination_data_prefix_list_version + - tf_name: destination_data_ipv4_prefix_list_version tf_only: true type: Version - description: Destination data prefix list version + description: Destination data IPv4 prefix list version exclude_test: true - model_name: actions tf_name: action_entries diff --git a/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go b/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go index 7fefb5a8..bd35e488 100644 --- a/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/data_source_sdwan_ipv4_acl_policy_definition.go @@ -135,20 +135,20 @@ func (d *IPv4ACLPolicyDefinitionDataSource) Schema(ctx context.Context, req data MarkdownDescription: "Destination port", Computed: true, }, - "source_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: "Source data prefix list ID", + "source_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: "Source data IPv4 prefix list ID", Computed: true, }, - "source_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: "Source data prefix list version", + "source_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: "Source data IPv4 prefix list version", Computed: true, }, - "destination_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: "Destination data prefix list ID", + "destination_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: "Destination data IPv4 prefix list ID", Computed: true, }, - "destination_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: "Destination data prefix list version", + "destination_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: "Destination data IPv4 prefix list version", Computed: true, }, "protocol": schema.StringAttribute{ diff --git a/internal/provider/data_source_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/data_source_sdwan_ipv4_device_acl_policy_definition.go index 35609f37..8735bf56 100644 --- a/internal/provider/data_source_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/data_source_sdwan_ipv4_device_acl_policy_definition.go @@ -115,20 +115,20 @@ func (d *IPv4DeviceACLPolicyDefinitionDataSource) Schema(ctx context.Context, re MarkdownDescription: "Destination port, only `22` and `161` supported", Computed: true, }, - "source_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: "Source data prefix list ID", + "source_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: "Source data IPv4 prefix list ID", Computed: true, }, - "source_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: "Source data prefix list version", + "source_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: "Source data IPv4 prefix list version", Computed: true, }, - "destination_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: "Destination data prefix list ID", + "destination_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: "Destination data IPv4 prefix list ID", Computed: true, }, - "destination_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: "Destination data prefix list version", + "destination_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: "Destination data IPv4 prefix list version", Computed: true, }, }, diff --git a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go index f3fdf5ca..333c97c5 100644 --- a/internal/provider/model_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_acl_policy_definition.go @@ -46,22 +46,22 @@ type IPv4ACLPolicyDefinitionSequences struct { } type IPv4ACLPolicyDefinitionSequencesMatchEntries struct { - Type types.String `tfsdk:"type"` - Dscp types.Int64 `tfsdk:"dscp"` - SourceIp types.String `tfsdk:"source_ip"` - DestinationIp types.String `tfsdk:"destination_ip"` - ClassMapId types.String `tfsdk:"class_map_id"` - ClassMapVersion types.Int64 `tfsdk:"class_map_version"` - PacketLength types.Int64 `tfsdk:"packet_length"` - Priority types.String `tfsdk:"priority"` - SourcePort types.Int64 `tfsdk:"source_port"` - DestinationPort types.Int64 `tfsdk:"destination_port"` - SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"` - SourceDataPrefixListVersion types.Int64 `tfsdk:"source_data_prefix_list_version"` - DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"` - DestinationDataPrefixListVersion types.Int64 `tfsdk:"destination_data_prefix_list_version"` - Protocol types.String `tfsdk:"protocol"` - Tcp types.String `tfsdk:"tcp"` + Type types.String `tfsdk:"type"` + Dscp types.Int64 `tfsdk:"dscp"` + SourceIp types.String `tfsdk:"source_ip"` + DestinationIp types.String `tfsdk:"destination_ip"` + ClassMapId types.String `tfsdk:"class_map_id"` + ClassMapVersion types.Int64 `tfsdk:"class_map_version"` + PacketLength types.Int64 `tfsdk:"packet_length"` + Priority types.String `tfsdk:"priority"` + SourcePort types.Int64 `tfsdk:"source_port"` + DestinationPort types.Int64 `tfsdk:"destination_port"` + SourceDataIpv4PrefixListId types.String `tfsdk:"source_data_ipv4_prefix_list_id"` + SourceDataIpv4PrefixListVersion types.Int64 `tfsdk:"source_data_ipv4_prefix_list_version"` + DestinationDataIpv4PrefixListId types.String `tfsdk:"destination_data_ipv4_prefix_list_id"` + DestinationDataIpv4PrefixListVersion types.Int64 `tfsdk:"destination_data_ipv4_prefix_list_version"` + Protocol types.String `tfsdk:"protocol"` + Tcp types.String `tfsdk:"tcp"` } type IPv4ACLPolicyDefinitionSequencesActionEntries struct { Type types.String `tfsdk:"type"` @@ -139,11 +139,11 @@ func (data IPv4ACLPolicyDefinition) toBody(ctx context.Context) string { if !childItem.DestinationPort.IsNull() && childItem.Type.ValueString() == "destinationPort" { itemChildBody, _ = sjson.Set(itemChildBody, "value", fmt.Sprint(childItem.DestinationPort.ValueInt64())) } - if !childItem.SourceDataPrefixListId.IsNull() && childItem.Type.ValueString() == "sourceDataPrefixList" { - itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.SourceDataPrefixListId.ValueString()) + if !childItem.SourceDataIpv4PrefixListId.IsNull() && childItem.Type.ValueString() == "sourceDataPrefixList" { + itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.SourceDataIpv4PrefixListId.ValueString()) } - if !childItem.DestinationDataPrefixListId.IsNull() && childItem.Type.ValueString() == "destinationDataPrefixList" { - itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DestinationDataPrefixListId.ValueString()) + if !childItem.DestinationDataIpv4PrefixListId.IsNull() && childItem.Type.ValueString() == "destinationDataPrefixList" { + itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DestinationDataIpv4PrefixListId.ValueString()) } if !childItem.Protocol.IsNull() && childItem.Type.ValueString() == "protocol" { itemChildBody, _ = sjson.Set(itemChildBody, "value", fmt.Sprint(childItem.Protocol.ValueString())) @@ -291,14 +291,14 @@ func (data *IPv4ACLPolicyDefinition) fromBody(ctx context.Context, res gjson.Res cItem.DestinationPort = types.Int64Null() } if ccValue := cv.Get("ref"); ccValue.Exists() && cItem.Type.ValueString() == "sourceDataPrefixList" { - cItem.SourceDataPrefixListId = types.StringValue(ccValue.String()) + cItem.SourceDataIpv4PrefixListId = types.StringValue(ccValue.String()) } else { - cItem.SourceDataPrefixListId = types.StringNull() + cItem.SourceDataIpv4PrefixListId = types.StringNull() } if ccValue := cv.Get("ref"); ccValue.Exists() && cItem.Type.ValueString() == "destinationDataPrefixList" { - cItem.DestinationDataPrefixListId = types.StringValue(ccValue.String()) + cItem.DestinationDataIpv4PrefixListId = types.StringValue(ccValue.String()) } else { - cItem.DestinationDataPrefixListId = types.StringNull() + cItem.DestinationDataIpv4PrefixListId = types.StringNull() } if ccValue := cv.Get("value"); ccValue.Exists() && cItem.Type.ValueString() == "protocol" { cItem.Protocol = types.StringValue(ccValue.String()) @@ -441,10 +441,10 @@ func (data *IPv4ACLPolicyDefinition) hasChanges(ctx context.Context, state *IPv4 if !data.Sequences[i].MatchEntries[ii].DestinationPort.Equal(state.Sequences[i].MatchEntries[ii].DestinationPort) { hasChanges = true } - if !data.Sequences[i].MatchEntries[ii].SourceDataPrefixListId.Equal(state.Sequences[i].MatchEntries[ii].SourceDataPrefixListId) { + if !data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId.Equal(state.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId) { hasChanges = true } - if !data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId.Equal(state.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId) { + if !data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId.Equal(state.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId) { hasChanges = true } if !data.Sequences[i].MatchEntries[ii].Protocol.Equal(state.Sequences[i].MatchEntries[ii].Protocol) { @@ -528,14 +528,14 @@ func (data *IPv4ACLPolicyDefinition) updateVersions(ctx context.Context, state * data.Sequences[i].MatchEntries[ii].ClassMapVersion = types.Int64Null() } if cStateIndex > -1 { - data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].SourceDataPrefixListVersion + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].SourceDataIpv4PrefixListVersion } else { - data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = types.Int64Null() + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = types.Int64Null() } if cStateIndex > -1 { - data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].DestinationDataPrefixListVersion + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].DestinationDataIpv4PrefixListVersion } else { - data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = types.Int64Null() + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = types.Int64Null() } } for ii := range data.Sequences[i].ActionEntries { diff --git a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go index bd035a1d..7657c0e7 100644 --- a/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/model_sdwan_ipv4_device_acl_policy_definition.go @@ -46,15 +46,15 @@ type IPv4DeviceACLPolicyDefinitionSequences struct { } type IPv4DeviceACLPolicyDefinitionSequencesMatchEntries struct { - Type types.String `tfsdk:"type"` - SourceIp types.String `tfsdk:"source_ip"` - DestinationIp types.String `tfsdk:"destination_ip"` - SourcePort types.Int64 `tfsdk:"source_port"` - DestinationPort types.Int64 `tfsdk:"destination_port"` - SourceDataPrefixListId types.String `tfsdk:"source_data_prefix_list_id"` - SourceDataPrefixListVersion types.Int64 `tfsdk:"source_data_prefix_list_version"` - DestinationDataPrefixListId types.String `tfsdk:"destination_data_prefix_list_id"` - DestinationDataPrefixListVersion types.Int64 `tfsdk:"destination_data_prefix_list_version"` + Type types.String `tfsdk:"type"` + SourceIp types.String `tfsdk:"source_ip"` + DestinationIp types.String `tfsdk:"destination_ip"` + SourcePort types.Int64 `tfsdk:"source_port"` + DestinationPort types.Int64 `tfsdk:"destination_port"` + SourceDataIpv4PrefixListId types.String `tfsdk:"source_data_ipv4_prefix_list_id"` + SourceDataIpv4PrefixListVersion types.Int64 `tfsdk:"source_data_ipv4_prefix_list_version"` + DestinationDataIpv4PrefixListId types.String `tfsdk:"destination_data_ipv4_prefix_list_id"` + DestinationDataIpv4PrefixListVersion types.Int64 `tfsdk:"destination_data_ipv4_prefix_list_version"` } type IPv4DeviceACLPolicyDefinitionSequencesActionEntries struct { Type types.String `tfsdk:"type"` @@ -106,11 +106,11 @@ func (data IPv4DeviceACLPolicyDefinition) toBody(ctx context.Context) string { if !childItem.DestinationPort.IsNull() && childItem.Type.ValueString() == "destinationPort" { itemChildBody, _ = sjson.Set(itemChildBody, "value", fmt.Sprint(childItem.DestinationPort.ValueInt64())) } - if !childItem.SourceDataPrefixListId.IsNull() && childItem.Type.ValueString() == "sourceDataPrefixList" { - itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.SourceDataPrefixListId.ValueString()) + if !childItem.SourceDataIpv4PrefixListId.IsNull() && childItem.Type.ValueString() == "sourceDataPrefixList" { + itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.SourceDataIpv4PrefixListId.ValueString()) } - if !childItem.DestinationDataPrefixListId.IsNull() && childItem.Type.ValueString() == "destinationDataPrefixList" { - itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DestinationDataPrefixListId.ValueString()) + if !childItem.DestinationDataIpv4PrefixListId.IsNull() && childItem.Type.ValueString() == "destinationDataPrefixList" { + itemChildBody, _ = sjson.Set(itemChildBody, "ref", childItem.DestinationDataIpv4PrefixListId.ValueString()) } itemBody, _ = sjson.SetRaw(itemBody, "match.entries.-1", itemChildBody) } @@ -200,14 +200,14 @@ func (data *IPv4DeviceACLPolicyDefinition) fromBody(ctx context.Context, res gjs cItem.DestinationPort = types.Int64Null() } if ccValue := cv.Get("ref"); ccValue.Exists() && cItem.Type.ValueString() == "sourceDataPrefixList" { - cItem.SourceDataPrefixListId = types.StringValue(ccValue.String()) + cItem.SourceDataIpv4PrefixListId = types.StringValue(ccValue.String()) } else { - cItem.SourceDataPrefixListId = types.StringNull() + cItem.SourceDataIpv4PrefixListId = types.StringNull() } if ccValue := cv.Get("ref"); ccValue.Exists() && cItem.Type.ValueString() == "destinationDataPrefixList" { - cItem.DestinationDataPrefixListId = types.StringValue(ccValue.String()) + cItem.DestinationDataIpv4PrefixListId = types.StringValue(ccValue.String()) } else { - cItem.DestinationDataPrefixListId = types.StringNull() + cItem.DestinationDataIpv4PrefixListId = types.StringNull() } item.MatchEntries = append(item.MatchEntries, cItem) return true @@ -281,10 +281,10 @@ func (data *IPv4DeviceACLPolicyDefinition) hasChanges(ctx context.Context, state if !data.Sequences[i].MatchEntries[ii].DestinationPort.Equal(state.Sequences[i].MatchEntries[ii].DestinationPort) { hasChanges = true } - if !data.Sequences[i].MatchEntries[ii].SourceDataPrefixListId.Equal(state.Sequences[i].MatchEntries[ii].SourceDataPrefixListId) { + if !data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId.Equal(state.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListId) { hasChanges = true } - if !data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId.Equal(state.Sequences[i].MatchEntries[ii].DestinationDataPrefixListId) { + if !data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId.Equal(state.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListId) { hasChanges = true } } @@ -330,14 +330,14 @@ func (data *IPv4DeviceACLPolicyDefinition) updateVersions(ctx context.Context, s } } if cStateIndex > -1 { - data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].SourceDataPrefixListVersion + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].SourceDataIpv4PrefixListVersion } else { - data.Sequences[i].MatchEntries[ii].SourceDataPrefixListVersion = types.Int64Null() + data.Sequences[i].MatchEntries[ii].SourceDataIpv4PrefixListVersion = types.Int64Null() } if cStateIndex > -1 { - data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].DestinationDataPrefixListVersion + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = state.Sequences[stateIndex].MatchEntries[cStateIndex].DestinationDataIpv4PrefixListVersion } else { - data.Sequences[i].MatchEntries[ii].DestinationDataPrefixListVersion = types.Int64Null() + data.Sequences[i].MatchEntries[ii].DestinationDataIpv4PrefixListVersion = types.Int64Null() } } } diff --git a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go index f1d6ef21..340ad44b 100644 --- a/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_acl_policy_definition.go @@ -174,20 +174,20 @@ func (r *IPv4ACLPolicyDefinitionResource) Schema(ctx context.Context, req resour int64validator.Between(0, 65535), }, }, - "source_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Source data prefix list ID").String, + "source_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Source data IPv4 prefix list ID").String, Optional: true, }, - "source_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Source data prefix list version").String, + "source_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: helpers.NewAttributeDescription("Source data IPv4 prefix list version").String, Optional: true, }, - "destination_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Destination data prefix list ID").String, + "destination_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Destination data IPv4 prefix list ID").String, Optional: true, }, - "destination_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Destination data prefix list version").String, + "destination_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: helpers.NewAttributeDescription("Destination data IPv4 prefix list version").String, Optional: true, }, "protocol": schema.StringAttribute{ diff --git a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go index a4dd8d59..03dd6946 100644 --- a/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go +++ b/internal/provider/resource_sdwan_ipv4_device_acl_policy_definition.go @@ -145,20 +145,20 @@ func (r *IPv4DeviceACLPolicyDefinitionResource) Schema(ctx context.Context, req int64validator.Between(0, 65535), }, }, - "source_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Source data prefix list ID").String, + "source_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Source data IPv4 prefix list ID").String, Optional: true, }, - "source_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Source data prefix list version").String, + "source_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: helpers.NewAttributeDescription("Source data IPv4 prefix list version").String, Optional: true, }, - "destination_data_prefix_list_id": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Destination data prefix list ID").String, + "destination_data_ipv4_prefix_list_id": schema.StringAttribute{ + MarkdownDescription: helpers.NewAttributeDescription("Destination data IPv4 prefix list ID").String, Optional: true, }, - "destination_data_prefix_list_version": schema.Int64Attribute{ - MarkdownDescription: helpers.NewAttributeDescription("Destination data prefix list version").String, + "destination_data_ipv4_prefix_list_version": schema.Int64Attribute{ + MarkdownDescription: helpers.NewAttributeDescription("Destination data IPv4 prefix list version").String, Optional: true, }, }, diff --git a/templates/guides/changelog.md.tmpl b/templates/guides/changelog.md.tmpl index ebd2bc30..6e3160fb 100644 --- a/templates/guides/changelog.md.tmpl +++ b/templates/guides/changelog.md.tmpl @@ -22,8 +22,8 @@ description: |- - Fix issue with `sdwan_traffic_data_policy_definition` not supporting local and restrict options - Add `sdwan_dns_security_policy_definition` resource and data source - Add `sdwan_system_global_profile_parcel` resource and data source -- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` -- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` +- BREAKING CHANGE: Rename `sdwan_acl_policy_definition` resource and data source to `sdwan_ipv4_acl_policy_definition` and update attributes +- BREAKING CHANGE: Rename `sdwan_device_acl_policy_definition` resource and data source to `sdwan_ipv4_device_acl_policy_definition` and update attributes - Add `sdwan_ipv6_acl_policy_definition` resource and data source - Add `sdwan_ipv6_device_acl_policy_definition` resource and data source