Skip to content

Commit

Permalink
docs(elb): udpate the doc of loadbalancer (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Zhang9309 authored Sep 28, 2023
1 parent 07e6b32 commit f69ec89
Showing 1 changed file with 46 additions and 14 deletions.
60 changes: 46 additions & 14 deletions docs/resources/lb_loadbalancer_v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ The following arguments are supported:
* `vpc_id` - (Optional, String, ForceNew) The vpc on which to create the loadbalancer. Changing this creates a new
loadbalancer.

* `ipv4_subnet_id` - (Optional, String) The `ipv4_subnet_id` of the
VPC Subnet on which to allocate the loadbalancer's ipv4 address.
* `ipv4_subnet_id` - (Optional, String) The **IPv4 subnet ID** of the subnet on which to allocate the loadbalancer's
ipv4 address.

* `ipv6_network_id` - (Optional, String) The network on which to allocate the loadbalancer's ipv6 address.

Expand All @@ -176,27 +176,59 @@ The following arguments are supported:
* `ipv4_eip_id` - (Optional, String, ForceNew) The ID of the EIP. Changing this parameter will create a new resource.

-> **NOTE:** If the ipv4_eip_id parameter is configured, you do not need to configure the bandwidth parameters:
`iptype`, `bandwidth_charge_mode`, `bandwidth_size` and `share_type`.
`iptype`, `bandwidth_charge_mode`, `bandwidth_size`, `share_type` and `bandwidth_id`.

* `iptype` - (Optional, String, ForceNew) Elastic IP type. Changing this parameter will create a new resource.

* `bandwidth_charge_mode` - (Optional, String, ForceNew) Bandwidth billing type. Changing this parameter will create a
new resource.
* `bandwidth_charge_mode` - (Optional, String, ForceNew) Bandwidth billing type. Value options:
+ **bandwidth**: Billed by bandwidth.
+ **traffic**: Billed by traffic.

It is mandatory when `iptype` is set and `bandwidth_id` is empty.
Changing this parameter will create a new resource.

* `sharetype` - (Optional, String, ForceNew) Bandwidth sharing type. Value options:
+ **PER**: Dedicated bandwidth.
+ **WHOLE**: Shared bandwidth.

It is mandatory when `iptype` is set and `bandwidth_id` is empty.
Changing this parameter will create a new resource.

* `bandwidth_size` - (Optional, Int, ForceNew) Bandwidth size. It is mandatory when `iptype` is set and `bandwidth_id`
is empty. Changing this parameter will create a new resource.

* `sharetype` - (Optional, String, ForceNew) Bandwidth sharing type. Changing this parameter will create a new resource.
* `bandwidth_id` - (Optional, String, ForceNew) Bandwidth ID of the shared bandwidth. It is mandatory when `sharetype`
is **WHOLE**. Changing this parameter will create a new resource.

* `bandwidth_size` - (Optional, Int, ForceNew) Bandwidth size. Changing this parameter will create a new resource.
-> **NOTE:** If the `bandwidth_id` parameter is configured, you can not configure the parameters:
`bandwidth_charge_mode`, `bandwidth_size`.

* `l4_flavor_id` - (Optional, String) The L4 flavor id of the load balancer.

* `l7_flavor_id` - (Optional, String) The L7 flavor id of the load balancer.

* `backend_subnets` - (Optional, List) The IDs of subnets on the downstream plane.
+ If this parameter is not specified, select subnets as follows:
- If IPv6 is enabled for a load balancer, the ID of subnet specified in `ipv6_network_id` will be used.
- If IPv4 is enabled for a load balancer, the ID of subnet specified in `ipv4_subnet_id` will be used.
- If only public network is available for a load balancer, the ID of any subnet in the VPC where the load balancer
resides will be used. Subnets with more IP addresses are preferred.
+ If there is more than one subnet, the first subnet in the list will be used, and the subnets must be in the VPC
where the load balancer resides.

* `tags` - (Optional, Map) The key/value pairs to associate with the loadbalancer.

## Attributes Reference
* `autoscaling_enabled` - (Optional, Bool) Specifies whether autoscaling is enabled. Valid values are **true** and
**false**.

* `min_l7_flavor_id` - (Optional, String) Specifies the ID of the minimum Layer-7 flavor for elastic scaling.
This parameter cannot be left blank if there are HTTP or HTTPS listeners.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:

* `ipv4_port_id` - The ID of the port bound to the private IPv4 address of the loadbalancer.
* `ipv4_eip` - The ipv4 eip address of the Load Balancer.
* `ipv6_eip` - The ipv6 eip address of the Load Balancer.
* `ipv6_eip_id` - The ipv6 eip id of the Load Balancer.
Expand All @@ -206,9 +238,9 @@ In addition to all arguments above, the following attributes are exported:

This resource provides the following timeouts configuration options:

* `create` - Default is 10 minute.
* `update` - Default is 10 minute.
* `delete` - Default is 5 minute.
* `create` - Default is 10 minutes.
* `update` - Default is 10 minutes.
* `delete` - Default is 5 minutes.

## Import

Expand All @@ -218,9 +250,9 @@ ELB loadbalancer can be imported using the loadbalancer ID, e.g.
terraform import flexibleengine_lb_loadbalancer_v3.loadbalancer_1 5c20fdad-7288-11eb-b817-0255ac10158b
```

Note that the imported state may not be identical to your resource definition, due to some attrubutes missing from the
Note that the imported state may not be identical to your resource definition, due to some attributes missing from the
API response, security or some other reason. The missing attributes include: `ipv6_bandwidth_id`, `iptype`,
`bandwidth_charge_mode`, `sharetype` and `bandwidth_size`.
`bandwidth_charge_mode`, `sharetype`, `bandwidth_size` and `bandwidth_id`.
It is generally recommended running `terraform plan` after importing a loadbalancer.
You can then decide if changes should be applied to the loadbalancer, or the resource
definition should be updated to align with the loadbalancer. Also you can ignore changes as below.
Expand All @@ -230,7 +262,7 @@ resource "flexibleengine_lb_loadbalancer_v3" "loadbalancer_1" {
...
lifecycle {
ignore_changes = [
ipv6_bandwidth_id, iptype, bandwidth_charge_mode, sharetype, bandwidth_size,
ipv6_bandwidth_id, iptype, bandwidth_charge_mode, sharetype, bandwidth_size, bandwidth_id,
]
}
}
Expand Down

0 comments on commit f69ec89

Please sign in to comment.