Skip to content

Commit 77862a6

Browse files
authored
feat(ELB): add attributes to elb loadbalancer copy resource (#6574)
1 parent d0c7830 commit 77862a6

File tree

3 files changed

+43
-2
lines changed

3 files changed

+43
-2
lines changed

docs/resources/elb_loadbalancer_copy.md

+18
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,24 @@ In addition to all arguments above, the following attributes are exported:
142142

143143
* `vpc_id` - Indicates the ID of the VPC where the load balancer resides.
144144

145+
* `elb_virsubnet_type` - Indicates the type of the subnet on the downstream plane. The value can be:
146+
+ **ipv4**: IPv4 subnet
147+
+ **dualstack**: subnet that supports IPv4/IPv6 dual stack
148+
149+
* `frozen_scene` - Indicates the scenario where the load balancer is frozen. Multiple values are separated using commas (,).
150+
The value can be:
151+
+ **POLICE**: The load balancer is frozen due to security reasons.
152+
+ **ILLEGAL**: The load balancer is frozen due to violation of laws and regulations.
153+
+ **VERIFY**: Your account has not completed real-name authentication.
154+
+ **PARTNER**: The load balancer is frozen by the partner.
155+
+ **ARREAR**: Your account is in arrears.
156+
157+
* `operating_status` - Indicates the operating status of the load balancer. The value can be:
158+
+ **ONLINE**: indicates that the load balancer is running normally.
159+
+ **FROZEN**: indicates that the load balancer is frozen.
160+
161+
* `public_border_group` - Indicates the AZ group to which the load balancer belongs.
162+
145163
* `charge_mode` - Indicates the billing mode. The value can be:
146164
+ **flavor**: Billed by the specifications you will select.
147165
+ **lcu**: Billed by LCU usage.

huaweicloud/services/acceptance/elb/resource_huaweicloud_elb_loadbalancer_copy_test.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ func TestAccElbLoadBalancerCopy_basic(t *testing.T) {
9292
resource.TestCheckResourceAttr(resourceName, "charging_mode", "postPaid"),
9393
resource.TestCheckResourceAttr(resourceName, "tags.key", "value"),
9494
resource.TestCheckResourceAttr(resourceName, "tags.owner", "terraform"),
95-
resource.TestCheckResourceAttrSet(resourceName, "charge_mode"),
95+
resource.TestCheckResourceAttrSet(resourceName, "vpc_id"),
96+
resource.TestCheckResourceAttrSet(resourceName, "elb_virsubnet_type"),
97+
resource.TestCheckResourceAttrSet(resourceName, "operating_status"),
98+
resource.TestCheckResourceAttrSet(resourceName, "public_border_group"),
9699
resource.TestCheckResourceAttrSet(resourceName, "created_at"),
97100
resource.TestCheckResourceAttrSet(resourceName, "updated_at"),
98101
),

huaweicloud/services/elb/resource_huaweicloud_elb_loadbalancer_copy.go

+21-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ var loadBalancerCopyNonUpdatableParams = []string{
4242
// @API EPS POST /v1.0/enterprise-projects/{enterprise_project_id}/resources-migrat
4343
// @API BSS GET /v2/orders/customer-orders/details/{order_id}
4444
// @API BSS POST /v2/orders/suscriptions/resources/query
45-
// @API BSS POST /v2/orders/subscriptions/resources/unsubscribe
4645
// @API BSS POST /v2/orders/subscriptions/resources/autorenew/{instance_id}
4746
// @API BSS DELETE /v2/orders/subscriptions/resources/autorenew/{instance_id}
4847
func ResourceLoadBalancerCopy() *schema.Resource {
@@ -227,6 +226,22 @@ func ResourceLoadBalancerCopy() *schema.Resource {
227226
Type: schema.TypeString,
228227
Computed: true,
229228
},
229+
"elb_virsubnet_type": {
230+
Type: schema.TypeString,
231+
Computed: true,
232+
},
233+
"frozen_scene": {
234+
Type: schema.TypeString,
235+
Computed: true,
236+
},
237+
"operating_status": {
238+
Type: schema.TypeString,
239+
Computed: true,
240+
},
241+
"public_border_group": {
242+
Type: schema.TypeString,
243+
Computed: true,
244+
},
230245
"charge_mode": {
231246
Type: schema.TypeString,
232247
Computed: true,
@@ -431,6 +446,11 @@ func resourceLoadBalancerCopyRead(_ context.Context, d *schema.ResourceData, met
431446
d.Set("created_at", utils.PathSearch("loadbalancer.created_at", getRespBody, nil)),
432447
d.Set("updated_at", utils.PathSearch("loadbalancer.updated_at", getRespBody, nil)),
433448
d.Set("waf_failure_action", utils.PathSearch("loadbalancer.waf_failure_action", getRespBody, nil)),
449+
d.Set("vpc_id", utils.PathSearch("loadbalancer.vpc_id", getRespBody, nil)),
450+
d.Set("elb_virsubnet_type", utils.PathSearch("loadbalancer.elb_virsubnet_type", getRespBody, nil)),
451+
d.Set("frozen_scene", utils.PathSearch("loadbalancer.frozen_scene", getRespBody, nil)),
452+
d.Set("operating_status", utils.PathSearch("loadbalancer.operating_status", getRespBody, nil)),
453+
d.Set("public_border_group", utils.PathSearch("loadbalancer.public_border_group", getRespBody, nil)),
434454
d.Set("deletion_protection_enable", strconv.FormatBool(
435455
utils.PathSearch("loadbalancer.deletion_protection_enable", getRespBody, false).(bool))),
436456
)

0 commit comments

Comments
 (0)