|
| 1 | +--- |
| 2 | +page_title: "Scaleway: scaleway_lb_certificate" |
| 3 | +description: |- |
| 4 | +Manages Scaleway Load-Balancer Certificates. |
| 5 | +--- |
| 6 | + |
| 7 | +# scaleway_lb_certificate |
| 8 | + |
| 9 | +Get information about Scaleway Load-Balancer Certificates. |
| 10 | + |
| 11 | +This data source can prove useful when a module accepts an LB Certificate as an input variable and needs to, for example, determine the security a certificate for your LB Frontend associated with your domain, etc. |
| 12 | + |
| 13 | +For more information, see [the documentation](https://developers.scaleway.com/en/products/lb/zoned_api/#certificate-330754). |
| 14 | + |
| 15 | +## Examples |
| 16 | + |
| 17 | +### Let's Encrypt |
| 18 | + |
| 19 | +```hcl |
| 20 | +resource scaleway_lb_ip main { |
| 21 | +} |
| 22 | +
|
| 23 | +resource scaleway_lb main { |
| 24 | + ip_id = scaleway_lb_ip.main.id |
| 25 | + name = "data-test-lb-cert" |
| 26 | + type = "LB-S" |
| 27 | +} |
| 28 | +
|
| 29 | +resource scaleway_lb_certificate main { |
| 30 | + lb_id = scaleway_lb.main.id |
| 31 | + name = "data-test-lb-cert" |
| 32 | + letsencrypt { |
| 33 | + common_name = "${replace(scaleway_lb.main.ip_address, ".", "-")}.lb.${scaleway_lb.main.region}.scw.cloud" |
| 34 | + } |
| 35 | +} |
| 36 | +
|
| 37 | +data "scaleway_lb_certificate" "byID" { |
| 38 | + certificate_id = "${scaleway_lb_certificate.main.id}" |
| 39 | +} |
| 40 | +
|
| 41 | +data "scaleway_lb_certificate" "byName" { |
| 42 | + name = "${scaleway_lb_certificate.main.name}" |
| 43 | + lb_id = "${scaleway_lb.main.id}" |
| 44 | +} |
| 45 | +``` |
| 46 | + |
| 47 | +## Arguments Reference |
| 48 | + |
| 49 | +The following arguments are supported: |
| 50 | + |
| 51 | +- `certificate_id` - (Optional) The certificate id. |
| 52 | + - Only one of `name` and `certificate_id` should be specified. |
| 53 | + |
| 54 | +- `name` - (Optional) The name of the certificate backend. |
| 55 | + - When using a certificate `name` you should specify the `lb-id` |
| 56 | + |
| 57 | +- `lb_id` - (Required) The load-balancer ID this certificate is attached to. |
| 58 | + |
| 59 | +## Attributes Reference |
| 60 | + |
| 61 | +See the [LB Certificate Resource](../resources/lb_certificate.md) for details on the returned attributes - they are identical. |
0 commit comments