Skip to content

Commit

Permalink
WIP(ELB): Synchronized and renamed ELB resources and data sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zippo-Wang committed Jan 27, 2024
1 parent ba09928 commit 33ef55a
Show file tree
Hide file tree
Showing 57 changed files with 2,742 additions and 750 deletions.
44 changes: 44 additions & 0 deletions docs/data-sources/lb_certificate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
subcategory: "Elastic Load Balance (ELB)"
---

# flexibleengine_lb_certificate_v2

Use this data source to get the certificate details in FlexibleEngine Elastic Load Balance (ELB).

## Example Usage

The following example shows how one might accept a certificate name as a variable to fetch this data source.

```hcl
variable "cert_name" {}
data "flexibleengine_lb_certificate_v2" "by_name" {
name = var.cert_name
}
```

## Argument Reference

The arguments of this data source act as filters for querying the available Certificates in the current region.
The given filters must match exactly one Certificate whose data will be exported as attributes.

* `id` - (Optional, String) The id of the specific Certificate to retrieve.

* `name` - (Optional, String) Human-readable name for the Certificate. Does not have to be unique.

* `description` - (Optional, String) Human-readable description for the LB Certificate.

* `domain` - (Optional, String) The domain of the Certificate.

## Attribute Reference

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

* `private_key` - The private encrypted key of the Certificate, PEM format.

* `certificate` - The public encrypted key of the Certificate, PEM format.

* `update_time` - Indicates the update time.

* `create_time` - Indicates the creation time.
4 changes: 3 additions & 1 deletion docs/data-sources/lb_certificate_v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
subcategory: "Elastic Load Balance (ELB)"
subcategory: "Deprecated"
description: ""
page_title: "flexibleengine_lb_certificate_v2"
---

# flexibleengine_lb_certificate_v2
Expand Down
72 changes: 72 additions & 0 deletions docs/data-sources/lb_listeners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
subcategory: "Elastic Load Balance (ELB)"
---

# flexibleengine_lb_listeners_v2

Use this data source to query the list of ELB listeners.

## Example Usage

```hcl
variable "protocol" {}
data "flexibleengine_lb_listeners_v2" "test" {
protocol = var.protocol
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String) Specifies the region in which to query the data source.
If omitted, the provider-level region will be used.

* `name` - (Optional, String) The listener name.

* `protocol` - (Optional, String) The listener protocol.
The valid values are **TCP**, **UDP**, **HTTP** and **TERMINATED_HTTPS**.

* `protocol_port` - (Optional, String) The front-end listening port of the listener.
The valid value is range from `1` to `65535`.

## Attribute Reference

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

* `id` - The resource ID.

* `listeners` - Listener list.
The [listeners](#listeners_listeners) structure is documented below.

<a name="listeners_listeners"></a>
The `listeners` block supports:

* `id` - The ELB listener ID.

* `name` - The listener name.

* `protocol` - The listener protocol.

* `protocol_port` - The front-end listening port of the listener.

* `default_pool_id` - The ID of the default pool with which the ELB listener is associated.

* `description` - The description of the ELB listener.

* `connection_limit` - The maximum number of connections allowed for the listener.

* `http2_enable` - Whether the ELB listener uses HTTP/2.

* `default_tls_container_ref` - The ID of the server certificate used by the listener.

* `sni_container_refs` - List of the SNI certificate (server certificates with a domain name) IDs used by the listener.

* `loadbalancers` - Listener list.
The [loadbalancers](#listeners_loadbalancers) structure is documented below.

<a name="listeners_loadbalancers"></a>
The `loadbalancers` block supports:

* `id` - The ELB loadbalancer ID.
4 changes: 3 additions & 1 deletion docs/data-sources/lb_listeners_v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
subcategory: "Elastic Load Balance (ELB)"
subcategory: "Deprecated"
description: ""
page_title: "flexibleengine_lb_listeners_v2"
---

# flexibleengine_lb_listeners_v2
Expand Down
47 changes: 47 additions & 0 deletions docs/data-sources/lb_loadbalancer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
subcategory: "Elastic Load Balance (ELB)"
---

# flexibleengine_lb_loadbalancer

Use this data source to get a specific elb loadbalancer within FlexibleEngine.

## Example Usage

```hcl
variable "lb_name" {}
data "flexibleengine_lb_loadbalancer" "test" {
name = var.lb_name
}
```

## Argument Reference

* `region` - (Optional, String) Specifies the region in which to obtain the load balancer. If omitted, the
provider-level region will be used.

* `name` - (Optional, String) Specifies the name of the load balancer.

* `id` - (Optional, String) Specifies the data source ID of the load balancer in UUID format.

* `status` - (Optional, String) Specifies the operating status of the load balancer. Valid values are *ONLINE* and
*FROZEN*.

* `description` - (Optional, String) Specifies the supplementary information about the load balancer.

* `vip_address` - (Optional, String) Specifies the private IP address of the load balancer.

* `vip_subnet_id` - (Optional, String) Specifies the **IPv4 subnet ID** of the subnet where the load balancer works.

* `enterprise_project_id` - (Optional, String) Specifies the enterprise project id of the load balancer.

## Attribute Reference

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

* `tags` - The tags associated with the load balancer.

* `vip_port_id` - The ID of the port bound to the private IP address of the load balancer.

* `public_ip` - The EIP address that is associated to the Load Balancer instance.
4 changes: 3 additions & 1 deletion docs/data-sources/lb_loadbalancer_v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
subcategory: "Elastic Load Balance (ELB)"
subcategory: "Deprecated"
description: ""
page_title: "flexibleengine_lb_loadbalancer_v2"
---

# flexibleengine_lb_loadbalancer_v2
Expand Down
8 changes: 4 additions & 4 deletions docs/resources/as_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,22 @@ resource "flexibleengine_vpc_subnet_v1" "example_subnet" {
vpc_id = flexibleengine_vpc_v1.example_vpc.id
}
resource "flexibleengine_lb_loadbalancer_v2" "lb_1" {
resource "flexibleengine_lb_loadbalancer" "lb_1" {
vip_subnet_id = flexibleengine_vpc_subnet_v1.example_subnet.ipv4_subnet_id
}
resource "flexibleengine_lb_listener_v2" "listener_1" {
resource "flexibleengine_lb_listener" "listener_1" {
protocol = "HTTP"
protocol_port = 8080
loadbalancer_id = flexibleengine_lb_loadbalancer_v2.lb_1.id
loadbalancer_id = flexibleengine_lb_loadbalancer.lb_1.id
}
resource "flexibleengine_as_group" "my_as_group_with_elb" {
scaling_group_name = "my_as_group_with_elb"
desire_instance_number = 2
min_instance_number = 0
max_instance_number = 10
lb_listener_id = flexibleengine_lb_listener_v2.listener_1.id
lb_listener_id = flexibleengine_lb_listener.listener_1.id
scaling_configuration_id = "37e310f5-db9d-446e-9135-c625f9c2bbfc"
vpc_id = flexibleengine_vpc_v1.example_vpc.id
delete_publicip = true
Expand Down
90 changes: 90 additions & 0 deletions docs/resources/lb_l7policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
subcategory: "Elastic Load Balance (ELB)"
description: ""
page_title: "flexibleengine_lb_l7policy"
---

# flexibleengine_lb_l7policy

Manages an **enhanced** load balancer L7 Policy resource within FlexibleEngine.

## Example Usage

```hcl
resource "flexibleengine_lb_loadbalancer" "loadbalancer_1" {
name = "loadbalancer_1"
vip_subnet_id = flexibleengine_vpc_subnet_v1.example_subnet.ipv4_subnet_id
}
resource "flexibleengine_lb_listener" "listener_1" {
name = "listener_1"
protocol = "HTTP"
protocol_port = 8080
loadbalancer_id = flexibleengine_lb_loadbalancer.loadbalancer_1.id
}
resource "flexibleengine_lb_pool" "pool_1" {
name = "pool_1"
protocol = "HTTP"
lb_method = "ROUND_ROBIN"
loadbalancer_id = flexibleengine_lb_loadbalancer.loadbalancer_1.id
}
resource "flexibleengine_lb_l7policy" "l7policy_1" {
name = "test"
action = "REDIRECT_TO_POOL"
description = "test l7 policy"
position = 1
listener_id = flexibleengine_lb_listener.listener_1.id
redirect_pool_id = flexibleengine_lb_pool.pool_1.id
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String, ForceNew) The region in which to obtain the V2 Networking client.
A Networking client is needed to create an . If omitted, the
`region` argument of the provider is used. Changing this creates a new L7 Policy.

* `name` - (Optional, String) Human-readable name for the L7 Policy. Does not have to be unique.

* `description` - (Optional, String) Human-readable description for the L7 Policy.

* `action` - (Required, String, ForceNew) The L7 Policy action - can either be REDIRECT_TO_POOL,
or REDIRECT_TO_LISTENER. Changing this creates a new L7 Policy.

* `listener_id` - (Required, String, ForceNew) The Listener on which the L7 Policy will be associated with.
Changing this creates a new L7 Policy.

* `position` - (Optional, Int, ForceNew) The position of this policy on the listener. Positions start at 1.
Changing this creates a new L7 Policy.

* `redirect_pool_id` - (Optional, String) Requests matching this policy will be redirected to
the pool with this ID. Only valid if action is REDIRECT_TO_POOL.

* `redirect_listener_id` - (Optional, String) Requests matching this policy will be redirected to
the listener with this ID. Only valid if action is REDIRECT_TO_LISTENER.

## Attribute Reference

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

* `id` - The unique ID for the L7 policy.

## Timeouts

This resource provides the following timeouts configuration options:

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

## Import

Load Balancer L7 Policy can be imported using the L7 Policy ID, e.g.:

```shell
terraform import flexibleengine_lb_l7policy.l7policy_1 8a7a79c2-cf17-4e65-b2ae-ddc8bfcf6c74
```
2 changes: 1 addition & 1 deletion docs/resources/lb_l7policy_v2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
subcategory: "Elastic Load Balance (ELB)"
subcategory: "Deprecated"
description: ""
page_title: "flexibleengine_lb_l7policy_v2"
---
Expand Down
Loading

0 comments on commit 33ef55a

Please sign in to comment.