Skip to content

Commit f3994d9

Browse files
Merge remote-tracking branch 'upstream/main'
2 parents 7beb13e + 3185abd commit f3994d9

File tree

22 files changed

+884
-53
lines changed

22 files changed

+884
-53
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_alb_certificate Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
ALB TLS Certificate data source schema. Must have a region specified in the provider configuration.
7+
---
8+
9+
# stackit_alb_certificate (Data Source)
10+
11+
ALB TLS Certificate data source schema. Must have a region specified in the provider configuration.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_alb_certificate" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
cert_id = "example-certificate-v1-dfa816b3184f63f43d918ea5f9493f5359f6c2404b69afbb0b60fb1af69d0bc0"
19+
}
20+
```
21+
22+
<!-- schema generated by tfplugindocs -->
23+
## Schema
24+
25+
### Required
26+
27+
- `cert_id` (String) The ID of the certificate.
28+
- `project_id` (String) STACKIT project ID to which the certificate is associated.
29+
30+
### Read-Only
31+
32+
- `id` (String) Terraform's internal resource ID. It is structured as `project_id`,`region`,`name`.
33+
- `name` (String) Certificate name.
34+
- `private_key` (String) The PEM encoded private key part
35+
- `public_key` (String) The PEM encoded public key part
36+
- `region` (String) The resource region (e.g. eu01). If not defined, the provider region is used.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Note: AWS specific checks must be skipped as they do not work on STACKIT. For de
163163

164164
### Optional
165165

166+
- `alb_certificates_custom_endpoint` (String) Custom endpoint for the Application Load Balancer TLS Certificate service
166167
- `alb_custom_endpoint` (String) Custom endpoint for the Application Load Balancer service
167168
- `authorization_custom_endpoint` (String) Custom endpoint for the Membership service
168169
- `cdn_custom_endpoint` (String) Custom endpoint for the CDN service

docs/resources/alb_certificate.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_alb_certificate Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Setting up supporting infrastructure
7+
The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the the automatic creation of a TLS certificate resource.
8+
---
9+
10+
# stackit_alb_certificate (Resource)
11+
12+
## Setting up supporting infrastructure
13+
14+
15+
The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the the automatic creation of a TLS certificate resource.
16+
17+
## Example Usage
18+
19+
```terraform
20+
variable "project_id" {
21+
description = "The STACKIT Project ID"
22+
type = string
23+
default = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
24+
}
25+
26+
# Create a RAS key pair
27+
resource "tls_private_key" "example" {
28+
algorithm = "RSA"
29+
rsa_bits = 2048
30+
}
31+
32+
# Create a TLS certificate
33+
resource "tls_self_signed_cert" "example" {
34+
private_key_pem = tls_private_key.example.private_key_pem
35+
36+
subject {
37+
common_name = "localhost"
38+
organization = "Stackit Test"
39+
}
40+
41+
validity_period_hours = 12
42+
43+
allowed_uses = [
44+
"key_encipherment",
45+
"digital_signature",
46+
"server_auth",
47+
]
48+
}
49+
50+
# Create a ALB certificate
51+
resource "stackit_alb_certificate" "certificate" {
52+
project_id = var.project_id
53+
name = "example-certificate"
54+
private_key = tls_private_key.example.private_key_pem
55+
public_key = tls_self_signed_cert.example.cert_pem
56+
}
57+
```
58+
59+
<!-- schema generated by tfplugindocs -->
60+
## Schema
61+
62+
### Required
63+
64+
- `name` (String) Certificate name.
65+
- `private_key` (String, Sensitive) The PEM encoded private key part
66+
- `project_id` (String) STACKIT project ID to which the certificate is associated.
67+
- `public_key` (String) The PEM encoded public key part
68+
69+
### Optional
70+
71+
- `region` (String) The resource region (e.g. eu01). If not defined, the provider region is used.
72+
73+
### Read-Only
74+
75+
- `cert_id` (String) The ID of the certificate.
76+
- `id` (String) Terraform's internal resource ID. It is structured as `project_id`,`region`,`cert_id`.

docs/resources/application_load_balancer.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,38 @@ resource "stackit_loadbalancer_observability_credential" "observability" {
115115
username = "username"
116116
}
117117
118+
# Create a RAS key pair
119+
resource "tls_private_key" "example" {
120+
algorithm = "RSA"
121+
rsa_bits = 2048
122+
}
123+
124+
# Create a TLS certificate
125+
resource "tls_self_signed_cert" "example" {
126+
private_key_pem = tls_private_key.example.private_key_pem
127+
128+
subject {
129+
common_name = "localhost"
130+
organization = "Stackit Test"
131+
}
132+
133+
validity_period_hours = 12
134+
135+
allowed_uses = [
136+
"key_encipherment",
137+
"digital_signature",
138+
"server_auth",
139+
]
140+
}
141+
142+
# Create a ALB certificate
143+
resource "stackit_alb_certificate" "certificate" {
144+
project_id = var.project_id
145+
name = "example-certificate"
146+
private_key = tls_private_key.example.private_key_pem
147+
public_key = tls_self_signed_cert.example.cert_pem
148+
}
149+
118150
# Create a Application Load Balancer
119151
resource "stackit_application_load_balancer" "example" {
120152
project_id = var.project_id
@@ -156,9 +188,7 @@ resource "stackit_application_load_balancer" "example" {
156188
https = {
157189
certificate_config = {
158190
certificate_ids = [
159-
# Currently no TF provider available, needs to be added with API
160-
# https://docs.api.stackit.cloud/documentation/certificates/version/v2
161-
"name-v1-8c81bd317af8a03b8ef0851ccb074eb17d1ad589b540446244a5e593f78ef820"
191+
stackit_alb_certificate.certificate.cert_id
162192
]
163193
}
164194
}

docs/resources/authorization_folder_role_assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343

4444
- `resource_id` (String) folder Resource to assign the role to.
4545
- `role` (String) Role to be assigned. Available roles can be queried using stackit-cli: `stackit curl https://authorization.api.stackit.cloud/v2/permissions`
46-
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients
46+
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
4747

4848
### Read-Only
4949

docs/resources/authorization_organization_role_assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636

3737
- `resource_id` (String) organization Resource to assign the role to.
3838
- `role` (String) Role to be assigned. Available roles can be queried using stackit-cli: `stackit curl https://authorization.api.stackit.cloud/v2/permissions`
39-
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients
39+
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
4040

4141
### Read-Only
4242

docs/resources/authorization_project_role_assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import {
4343

4444
- `resource_id` (String) project Resource to assign the role to.
4545
- `role` (String) Role to be assigned. Available roles can be queried using stackit-cli: `stackit curl https://authorization.api.stackit.cloud/v2/permissions`
46-
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients
46+
- `subject` (String) Identifier of user, service account or client. Usually email address or name in case of clients. All letters must be lowercased.
4747

4848
### Read-Only
4949

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
data "stackit_alb_certificate" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
cert_id = "example-certificate-v1-dfa816b3184f63f43d918ea5f9493f5359f6c2404b69afbb0b60fb1af69d0bc0"
4+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
variable "project_id" {
2+
description = "The STACKIT Project ID"
3+
type = string
4+
default = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5+
}
6+
7+
# Create a RAS key pair
8+
resource "tls_private_key" "example" {
9+
algorithm = "RSA"
10+
rsa_bits = 2048
11+
}
12+
13+
# Create a TLS certificate
14+
resource "tls_self_signed_cert" "example" {
15+
private_key_pem = tls_private_key.example.private_key_pem
16+
17+
subject {
18+
common_name = "localhost"
19+
organization = "Stackit Test"
20+
}
21+
22+
validity_period_hours = 12
23+
24+
allowed_uses = [
25+
"key_encipherment",
26+
"digital_signature",
27+
"server_auth",
28+
]
29+
}
30+
31+
# Create a ALB certificate
32+
resource "stackit_alb_certificate" "certificate" {
33+
project_id = var.project_id
34+
name = "example-certificate"
35+
private_key = tls_private_key.example.private_key_pem
36+
public_key = tls_self_signed_cert.example.cert_pem
37+
}

examples/resources/stackit_application_load_balancer/resource.tf

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,38 @@ resource "stackit_loadbalancer_observability_credential" "observability" {
9696
username = "username"
9797
}
9898

99+
# Create a RAS key pair
100+
resource "tls_private_key" "example" {
101+
algorithm = "RSA"
102+
rsa_bits = 2048
103+
}
104+
105+
# Create a TLS certificate
106+
resource "tls_self_signed_cert" "example" {
107+
private_key_pem = tls_private_key.example.private_key_pem
108+
109+
subject {
110+
common_name = "localhost"
111+
organization = "Stackit Test"
112+
}
113+
114+
validity_period_hours = 12
115+
116+
allowed_uses = [
117+
"key_encipherment",
118+
"digital_signature",
119+
"server_auth",
120+
]
121+
}
122+
123+
# Create a ALB certificate
124+
resource "stackit_alb_certificate" "certificate" {
125+
project_id = var.project_id
126+
name = "example-certificate"
127+
private_key = tls_private_key.example.private_key_pem
128+
public_key = tls_self_signed_cert.example.cert_pem
129+
}
130+
99131
# Create a Application Load Balancer
100132
resource "stackit_application_load_balancer" "example" {
101133
project_id = var.project_id
@@ -137,9 +169,7 @@ resource "stackit_application_load_balancer" "example" {
137169
https = {
138170
certificate_config = {
139171
certificate_ids = [
140-
# Currently no TF provider available, needs to be added with API
141-
# https://docs.api.stackit.cloud/documentation/certificates/version/v2
142-
"name-v1-8c81bd317af8a03b8ef0851ccb074eb17d1ad589b540446244a5e593f78ef820"
172+
stackit_alb_certificate.certificate.cert_id
143173
]
144174
}
145175
}

0 commit comments

Comments
 (0)