Skip to content

Commit

Permalink
Add ELB v3 listener (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
niuzhenguo authored May 18, 2021
1 parent 21d995a commit c0a0b92
Show file tree
Hide file tree
Showing 12 changed files with 1,232 additions and 89 deletions.
102 changes: 102 additions & 0 deletions docs/resources/elb_listener.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
subcategory: "Dedicated Load Balance (Dedicated ELB)"
---

# huaweicloud\_elb\_listener

Manages an ELB listener resource within HuaweiCloud.

## Example Usage

```hcl
resource "huaweicloud_elb_loadbalancer" "test" {
...
}
resource "huaweicloud_elb_listener" "basic" {
name = "basic"
description = "basic description"
protocol = "HTTP"
protocol_port = 8080
loadbalancer_id = huaweicloud_elb_loadbalancer.test.id
idle_timeout = 60
request_timeout = 60
response_timeout = 60
tags = {
key = "value"
}
}
```

## Argument Reference

The following arguments are supported:

* `region` - (Optional, String, ForceNew) The region in which to create the listener resource.
If omitted, the provider-level region will be used.
Changing this creates a new listener.

* `protocol` - (Required, String, ForceNew) The protocol can either be TCP, UDP, HTTP or HTTPS.
Changing this creates a new listener.

* `protocol_port` - (Required, Int, ForceNew) The port on which to listen for client traffic.
Changing this creates a new listener.

* `loadbalancer_id` - (Required, String, ForceNew) The load balancer on which to provision this
listener. Changing this creates a new listener.

* `name` - (Optional, String) Human-readable name for the listener.

* `default_pool_id` - (Optional, String) The ID of the default pool with which the
listener is associated. Changing this creates a new listener.

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

* `http2_enable` - (Optional, Bool) Specifies whether to use HTTP/2. The default value is false.
This parameter is valid only when the protocol is set to *HTTPS*.

* `forward_eip` - (Optional, Bool) Specifies whether transfer the load balancer EIP in
the X-Forward-EIP header to backend servers. The default value is false.
This parameter is valid only when the protocol is set to *HTTP* or *HTTPS*.

* `access_policy` - (Optional, String) Specifies the access policy for the listener. Valid options are *white* and *black*.

* `ip_group` - (Optional, String) Specifies the ip group id for the listener.

* `server_certificate` - (Optional, String) Specifies the ID of the server certificate
used by the listener. This parameter is mandatory when protocol is set to *HTTPS*.

* `sni_certificate` - (Optional, List) Lists the IDs of SNI certificates (server certificates
with a domain name) used by the listener. This parameter is valid when protocol is set to *HTTPS*.

* `ca_certificate` - (Optional, String) Specifies the ID of the CA certificate
used by the listener. This parameter is valid when protocol is set to *HTTPS*.

* `tls_ciphers_policy` - (Optional, String) Specifies the TLS cipher policy
for the listener. Valid options are: tls-1-0-inherit, tls-1-0, tls-1-1, tls-1-2,
tls-1-2-strict, tls-1-2-fs, tls-1-0-with-1-3, and tls-1-2-fs-with-1-3.
This parameter is valid when protocol is set to *HTTPS*.

* `idle_timeout` - (Optional, Int) Specifies the idle timeout for the listener. Value range: 0 to 4000.

* `request_timeout` - (Optional, Int) Specifies the request timeout for the listener. Value range: 1 to 300.
This parameter is valid when protocol is set to *HTTP* or *HTTPS*.

* `response_timeout` - (Optional, Int) Specifies the response timeout for the listener. Value range: 1 to 300.
This parameter is valid when protocol is set to *HTTP* or *HTTPS*.

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

## Attributes Reference

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

* `id` - The unique ID for the listener.

## Timeouts
This resource provides the following timeouts configuration options:
- `create` - Default is 10 minute.
- `update` - Default is 10 minute.
- `delete` - Default is 10 minute.
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ=
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/huaweicloud/golangsdk v0.0.0-20210510122110-66430a62b255 h1:2iW/eqhVyyvnFjXX9++3oKO3FPKGkFl49e/xnYaNUwc=
github.com/huaweicloud/golangsdk v0.0.0-20210510122110-66430a62b255/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0=
github.com/huaweicloud/golangsdk v0.0.0-20210514063328-40b1fa513422 h1:XwFK7LPY/bsGYUIg0b6d5JMb5oIPS39X2JplmB1HyHs=
github.com/huaweicloud/golangsdk v0.0.0-20210514063328-40b1fa513422/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0=
github.com/huaweicloud/golangsdk v0.0.0-20210515081555-068e23790b91 h1:0KuxeGQevny8MeM4vKSTJU+N2Ap/LOcloTFLVKbFfC4=
github.com/huaweicloud/golangsdk v0.0.0-20210515081555-068e23790b91/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0=
github.com/huaweicloud/golangsdk v0.0.0-20210517025840-92b32656bde0 h1:ap/m0dp+LvmAHQsQmSwYU0yOKxYz2b7iYpbgtUnXO0Y=
github.com/huaweicloud/golangsdk v0.0.0-20210517025840-92b32656bde0/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
Expand Down
1 change: 1 addition & 0 deletions huaweicloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ func Provider() terraform.ResourceProvider {
"huaweicloud_dns_recordset": ResourceDNSRecordSetV2(),
"huaweicloud_dns_zone": ResourceDNSZoneV2(),
"huaweicloud_dws_cluster": resourceDwsCluster(),
"huaweicloud_elb_listener": ResourceListenerV3(),
"huaweicloud_elb_loadbalancer": ResourceLoadBalancerV3(),
"huaweicloud_evs_snapshot": ResourceEvsSnapshotV2(),
"huaweicloud_evs_volume": ResourceEvsStorageVolumeV3(),
Expand Down
Loading

0 comments on commit c0a0b92

Please sign in to comment.