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

[vpnaas] set admin_state_up default to true #293

Merged
merged 2 commits into from
Apr 3, 2020
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
5 changes: 2 additions & 3 deletions huaweicloud/resource_huaweicloud_vpnaas_service_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/huaweicloud/golangsdk"
"github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/vpnaas/services"
"strconv"
)

func TestAccVpnServiceV2_basic(t *testing.T) {
Expand All @@ -24,7 +23,7 @@ func TestAccVpnServiceV2_basic(t *testing.T) {
testAccCheckVpnServiceV2Exists(
"huaweicloud_vpnaas_service_v2.service_1", &service),
resource.TestCheckResourceAttrPtr("huaweicloud_vpnaas_service_v2.service_1", "router_id", &service.RouterID),
resource.TestCheckResourceAttr("huaweicloud_vpnaas_service_v2.service_1", "admin_state_up", strconv.FormatBool(service.AdminStateUp)),
resource.TestCheckResourceAttr("huaweicloud_vpnaas_service_v2.service_1", "admin_state_up", "true"),
),
},
},
Expand Down Expand Up @@ -88,7 +87,7 @@ var testAccVpnServiceV2_basic = fmt.Sprintf(`
external_network_id = "%s"
}
resource "huaweicloud_vpnaas_service_v2" "service_1" {
name = "vpngw-acctest"
router_id = "${huaweicloud_networking_router_v2.router_1.id}"
admin_state_up = "false"
}
`, OS_EXTGW_ID)
2 changes: 1 addition & 1 deletion huaweicloud/resource_huaweicloud_vpnaas_site_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func resourceVpnSiteConnectionV2() *schema.Resource {
"admin_state_up": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Default: true,
},
"psk": {
Type: schema.TypeString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
"github.com/huaweicloud/golangsdk"
"github.com/huaweicloud/golangsdk/openstack/networking/v2/extensions/vpnaas/siteconnections"
"strconv"
)

func TestAccVpnSiteConnectionV2_basic(t *testing.T) {
Expand All @@ -24,7 +23,7 @@ func TestAccVpnSiteConnectionV2_basic(t *testing.T) {
testAccCheckSiteConnectionV2Exists(
"huaweicloud_vpnaas_site_connection_v2.conn_1", &conn),
resource.TestCheckResourceAttrPtr("huaweicloud_vpnaas_site_connection_v2.conn_1", "ikepolicy_id", &conn.IKEPolicyID),
resource.TestCheckResourceAttr("huaweicloud_vpnaas_site_connection_v2.conn_1", "admin_state_up", strconv.FormatBool(conn.AdminStateUp)),
resource.TestCheckResourceAttr("huaweicloud_vpnaas_site_connection_v2.conn_1", "admin_state_up", "true"),
resource.TestCheckResourceAttrPtr("huaweicloud_vpnaas_site_connection_v2.conn_1", "ipsecpolicy_id", &conn.IPSecPolicyID),
resource.TestCheckResourceAttrPtr("huaweicloud_vpnaas_site_connection_v2.conn_1", "vpnservice_id", &conn.VPNServiceID),
resource.TestCheckResourceAttrPtr("huaweicloud_vpnaas_site_connection_v2.conn_1", "local_ep_group_id", &conn.LocalEPGroupID),
Expand Down Expand Up @@ -110,8 +109,8 @@ var testAccSiteConnectionV2_basic = fmt.Sprintf(`
}

resource "huaweicloud_vpnaas_service_v2" "service_1" {
name = "vpngw-acctest"
router_id = "${huaweicloud_networking_router_v2.router_1.id}"
admin_state_up = "false"
}

resource "huaweicloud_vpnaas_ipsec_policy_v2" "policy_1" {
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/vpnaas_service_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ The following arguments are supported:
* `description` - (Optional) The human-readable description for the service.
Changing this updates the description of the existing service.

* `admin_state_up` - (Optional) The administrative state of the resource. Can either be up(true) or down(false).
* `admin_state_up` - (Optional) The administrative state of the resource.
Can either be up(true) or down (false). Defaults to `true`.
Changing this updates the administrative state of the existing service.

* `subnet_id` - (Optional) SubnetID is the ID of the subnet. Default is null.
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/vpnaas_site_connection_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ The following arguments are supported:
* `description` - (Optional) The human-readable description for the connection.
Changing this updates the description of the existing connection.

* `admin_state_up` - (Optional) The administrative state of the resource. Can either be up(true) or down(false).
* `admin_state_up` - (Optional) The administrative state of the resource.
Can either be up(true) or down(false). Defaults to `true`.
Changing this updates the administrative state of the existing connection.

* `ikepolicy_id` - (Required) The ID of the IKE policy. Changing this creates a new connection.
Expand Down