Skip to content

Commit 8f56bcc

Browse files
committed
feat(docs): add data-source-lb-certificate
1 parent 5b7644e commit 8f56bcc

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

docs/data-sources/lb_certificate.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 Resource](../resources/lb_certificate.md) for details on the returned attributes - they are identical.

scaleway/data_source_lb_certificate.go

-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ func dataSourceScalewayLbCertificate() *schema.Resource {
2525
ValidateFunc: validationUUIDorUUIDWithLocality(),
2626
ConflictsWith: []string{"name"},
2727
}
28-
/* dsSchema["lb_id"] = &schema.Schema{
29-
Type: schema.TypeString,
30-
Optional: true,
31-
Description: "The ID of the load-balancer",
32-
ValidateFunc: validationUUIDorUUIDWithLocality(),
33-
}*/
3428

3529
return &schema.Resource{
3630
ReadContext: dataSourceScalewayLbCertificateRead,

0 commit comments

Comments
 (0)