Skip to content

Commit

Permalink
[DCAAS] fix service_type attribute validation and virtual_interface d…
Browse files Browse the repository at this point in the history
…oc (#2398)

[DCAAS] fix service_type attribute validation and virtual_interface doc

Summary of the Pull Request
PR Checklist

 Refers to: #2394 and #2393
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Reviewed-by: Aloento
Reviewed-by: Artem Lifshits
  • Loading branch information
anton-sidelnikov committed Dec 27, 2023
1 parent b7431dd commit 5a8d0d8
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
19 changes: 10 additions & 9 deletions docs/resources/dс_virtual_interface_v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ resource "opentelekomcloud_dc_virtual_gateway_v2" "vgw_1" {
}
resource "opentelekomcloud_dc_virtual_interface_v2" "int_1" {
direct_connect_id = var.direct_connect_id
vgw_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
name = "vi_1"
description = "description"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 5
direct_connect_id = var.direct_connect_id
virtual_gateway_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
service_type = "vpc"
name = "vi_1"
description = "description"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 5
remote_ep_group_id = opentelekomcloud_dc_endpoint_group_v2.dc_endpoint_group.id
local_gateway_v4_ip = "180.1.1.1/24"
Expand All @@ -59,7 +60,7 @@ The following arguments are supported:
* `bandwidth` (Int, Required) - Specifies the virtual interface bandwidth.
* `remote_ep_group_id` (String, Required) - Specifies the ID of the remote endpoint group that records the CIDR blocks used by the on-premises network.
* `description` (String, Optional) - Provides supplementary information about the virtual interface.
* `service_type` (String, Optional, ForceNew) - Specifies what is to be accessed over the connection. The value can only be `vpc`.
* `service_type` (String, Required, ForceNew) - Specifies what is to be accessed over the connection. The value can only be `vpc`.
* `local_gateway_v4_ip` (String, Optional, ForceNew) - Specifies the IPv4 address of the local gateway.
* `remote_gateway_v4_ip` (String, Optional, ForceNew) - Specifies the IPv4 address of the remote gateway.
* `asn` (Int, Optional, ForceNew) - Specifies the AS number of the BGP peer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,15 @@ resource "opentelekomcloud_dc_virtual_gateway_v2" "vgw_1" {
}
resource "opentelekomcloud_dc_virtual_interface_v2" "int_1" {
direct_connect_id = "%s"
vgw_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
name = "%s"
description = "description"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 5
direct_connect_id = "%s"
virtual_gateway_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
service_type = "vpc"
name = "%s"
description = "description"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 5
remote_ep_group_id = opentelekomcloud_dc_endpoint_group_v2.dc_endpoint_group.id
local_gateway_v4_ip = "180.1.1.1/24"
Expand Down Expand Up @@ -173,14 +174,15 @@ resource "opentelekomcloud_dc_virtual_gateway_v2" "vgw_1" {
}
resource "opentelekomcloud_dc_virtual_interface_v2" "int_1" {
direct_connect_id = "%s"
vgw_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
name = "%s"
description = "description updated"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 10
direct_connect_id = "%s"
virtual_gateway_id = opentelekomcloud_dc_virtual_gateway_v2.vgw_1.id
service_type = "vpc"
name = "%s"
description = "description updated"
type = "private"
route_mode = "static"
vlan = 100
bandwidth = 10
remote_ep_group_id = opentelekomcloud_dc_endpoint_group_v2.dc_endpoint_group.id
local_gateway_v4_ip = "180.1.1.1/24"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,8 @@ func ResourceVirtualInterfaceV2() *schema.Resource {
},
"service_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Required: true,
ForceNew: true,
ValidateFunc: validation.StringInSlice([]string{
"VPC",
}, false),
},
"local_gateway_v4_ip": {
Type: schema.TypeString,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
**[DCAAS]** Fixes for `service_type` and `virtual_gateway_id` attributes documentation for ``resource/opentelekomcloud_dc_virtual_interface_v2`` (`#2398 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2398>`_)
- |
**[DCAAS]** Fix value validation for `service_type` for ``resource/opentelekomcloud_dc_virtual_interface_v2`` (`#2398 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2398>`_)

0 comments on commit 5a8d0d8

Please sign in to comment.