From eaea461d0c9512d812bbb6f830a4249fffec2d18 Mon Sep 17 00:00:00 2001 From: michaelfmnk Date: Wed, 31 Jul 2024 13:27:44 +0200 Subject: [PATCH 1/2] Added connect_auth field support in user_group datasource --- cloudconnexa/data_source_user_group.go | 6 ++++++ docs/data-sources/user_group.md | 1 + 2 files changed, 7 insertions(+) diff --git a/cloudconnexa/data_source_user_group.go b/cloudconnexa/data_source_user_group.go index 35b6fb1..8bc071c 100644 --- a/cloudconnexa/data_source_user_group.go +++ b/cloudconnexa/data_source_user_group.go @@ -49,6 +49,11 @@ func dataSourceUserGroup() *schema.Resource { }, Description: "The IPV4 and IPV6 addresses of the subnets associated with this user group.", }, + "connect_auth": { + Type: schema.TypeString, + Computed: true, + Description: "The type of connection authentication. Valid values are `AUTH`, `AUTO`, or `STRICT_AUTH`.", + }, }, } } @@ -70,5 +75,6 @@ func dataSourceUserGroupRead(ctx context.Context, d *schema.ResourceData, m inte d.Set("internet_access", userGroup.InternetAccess) d.Set("max_device", userGroup.MaxDevice) d.Set("system_subnets", userGroup.SystemSubnets) + d.Set("connect_auth", userGroup.ConnectAuth) return diags } diff --git a/docs/data-sources/user_group.md b/docs/data-sources/user_group.md index bc78035..f9a1def 100644 --- a/docs/data-sources/user_group.md +++ b/docs/data-sources/user_group.md @@ -27,3 +27,4 @@ Use an `cloudconnexa_user_group` data source to read an CloudConnexa user group. - `system_subnets` (List of String) The IPV4 and IPV6 addresses of the subnets associated with this user group. - `user_group_id` (String) The user group ID. - `vpn_region_ids` (List of String) The list of VPN region IDs this user group is associated with. +- `connect_auth` (String) The type of connection authentication. Valid values are `AUTH`, `AUTO`, or `STRICT_AUTH`. From ef6a502a60d491236bcdac883ae07f573849e608 Mon Sep 17 00:00:00 2001 From: Michael Fomenko Date: Wed, 31 Jul 2024 15:16:51 +0200 Subject: [PATCH 2/2] Added connection_status field support in user datasource (#37) * Added connection_status field support in user datasource * updated client lib --- cloudconnexa/data_source_user.go | 6 ++++++ docs/data-sources/user.md | 4 ++++ go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cloudconnexa/data_source_user.go b/cloudconnexa/data_source_user.go index c5f1a97..f4f1789 100644 --- a/cloudconnexa/data_source_user.go +++ b/cloudconnexa/data_source_user.go @@ -58,6 +58,11 @@ func dataSourceUser() *schema.Resource { Computed: true, Description: "The user's status.", }, + "connection_status": { + Type: schema.TypeString, + Computed: true, + Description: "The user's connection status.", + }, "devices": { Type: schema.TypeList, Computed: true, @@ -118,6 +123,7 @@ func dataSourceUserRead(ctx context.Context, d *schema.ResourceData, m interface d.Set("group_id", user.GroupId) d.Set("status", user.Status) d.Set("devices", getUserDevicesSlice(&user.Devices)) + d.Set("connection_status", user.ConnectionStatus) return diags } diff --git a/docs/data-sources/user.md b/docs/data-sources/user.md index 13b1357..67bfb63 100644 --- a/docs/data-sources/user.md +++ b/docs/data-sources/user.md @@ -13,6 +13,7 @@ Use a `cloudconnexa_user` data source to read a specific CloudConnexa user. + ## Schema ### Required @@ -31,8 +32,11 @@ Use a `cloudconnexa_user` data source to read a specific CloudConnexa user. - `last_name` (String) The user's last name. - `status` (String) The user's status. - `user_id` (String) The ID of this resource. +- `connection_status` (String) The user's connection status. Valid values are `OFFLINE`, `ONLINE`, + or `ONLINE_WITH_ISSUES`. + ### Nested Schema for `devices` Read-Only: diff --git a/go.mod b/go.mod index 46b40fd..f016f5e 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gruntwork-io/terratest v0.46.1 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/terraform-plugin-sdk/v2 v2.33.0 - github.com/openvpn/cloudconnexa-go-client/v2 v2.0.11 + github.com/openvpn/cloudconnexa-go-client/v2 v2.0.12 github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index 3908bb0..1908c42 100644 --- a/go.sum +++ b/go.sum @@ -485,8 +485,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= -github.com/openvpn/cloudconnexa-go-client/v2 v2.0.11 h1:NZ5cdmKhhjIYRbmyHXvRsCUTOI4tOtPlBaXpO/PgSnI= -github.com/openvpn/cloudconnexa-go-client/v2 v2.0.11/go.mod h1:udq5IDkgXvMO6mQUEFsLHzEyGGAduhO0jJvlb9f4JkE= +github.com/openvpn/cloudconnexa-go-client/v2 v2.0.12 h1:qUgOw8ppxtUj741XqfVCbtSNHBM81J6cEQkr3hgs9Jg= +github.com/openvpn/cloudconnexa-go-client/v2 v2.0.12/go.mod h1:udq5IDkgXvMO6mQUEFsLHzEyGGAduhO0jJvlb9f4JkE= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=