Skip to content

Commit 6047267

Browse files
authored
Merge branch 'main' into postgresflex-sdk-update
2 parents 346af56 + 13a6f35 commit 6047267

File tree

309 files changed

+4033
-752
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+4033
-752
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ROOT_DIR ?= $(shell git rev-parse --show-toplevel)
22
SCRIPTS_BASE ?= $(ROOT_DIR)/scripts
3+
GOLANG_CI_YAML_PATH ?= ${ROOT_DIR}/golang-ci.yaml
4+
GOLANG_CI_ARGS ?= --allow-parallel-runners --config=${GOLANG_CI_YAML_PATH}
35

46
# SETUP AND TOOL INITIALIZATION TASKS
57
project-help:
@@ -11,7 +13,7 @@ project-tools:
1113
# LINT
1214
lint-golangci-lint:
1315
@echo "Linting with golangci-lint"
14-
@$(SCRIPTS_BASE)/lint-golangci-lint.sh
16+
@go tool golangci-lint run ${GOLANG_CI_ARGS}
1517

1618
lint-tf:
1719
@echo "Linting terraform files"
@@ -29,7 +31,7 @@ build:
2931

3032
fmt:
3133
@gofmt -s -w .
32-
@go tool goimports -w .
34+
@go tool golangci-lint fmt --config=${GOLANG_CI_YAML_PATH}
3335
@terraform fmt -diff -recursive
3436

3537
# TEST
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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`,`cert_id`".
33+
- `name` (String) Certificate name.
34+
- `public_key` (String) The PEM encoded public key part
35+
- `region` (String) The resource region (e.g. eu01). If not defined, the provider region is used.

docs/data-sources/loadbalancer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ data "stackit_loadbalancer" "example" {
4343
- `private_address` (String) Transient private Load Balancer IP address. It can change any time.
4444
- `security_group_id` (String) The ID of the egress security group assigned to the Load Balancer's internal machines. This ID is essential for allowing traffic from the Load Balancer to targets in different networks or STACKIT Network areas (SNA). To enable this, create a security group rule for your target VMs and set the `remote_security_group_id` of that rule to this value. This is typically used when `disable_security_group_assignment` is set to `true`.
4545
- `target_pools` (Attributes List) List of all target pools which will be used in the Load Balancer. Limited to 20. (see [below for nested schema](#nestedatt--target_pools))
46+
- `version` (String) Load balancer resource version.
4647

4748
<a id="nestedatt--listeners"></a>
4849
### Nested Schema for `listeners`

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 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 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: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,46 @@ resource "stackit_server" "server" {
107107
}
108108
109109
# Create example credentials for observability of the ALB
110-
# Create real credentials in your stackit observability
110+
# Create real credentials in your STACKIT observability
111111
resource "stackit_loadbalancer_observability_credential" "observability" {
112112
project_id = var.project_id
113113
display_name = "my-cred"
114114
password = "password"
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/loadbalancer.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ import {
247247
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`","region","`name`".
248248
- `private_address` (String) Transient private Load Balancer IP address. It can change any time.
249249
- `security_group_id` (String) The ID of the egress security group assigned to the Load Balancer's internal machines. This ID is essential for allowing traffic from the Load Balancer to targets in different networks or STACKIT network areas (SNA). To enable this, create a security group rule for your target VMs and set the `remote_security_group_id` of that rule to this value. This is typically used when `disable_security_group_assignment` is set to `true`.
250+
- `version` (String) Load balancer resource version. This is needed to have concurrency safe updates.
250251

251252
<a id="nestedatt--listeners"></a>
252253
### Nested Schema for `listeners`
@@ -365,7 +366,7 @@ Optional:
365366
Optional:
366367

367368
- `credentials_ref` (String) Credentials reference for logs. Not changeable after creation.
368-
- `push_url` (String) Credentials reference for logs. Not changeable after creation.
369+
- `push_url` (String) The ARGUS/Loki remote write Push URL to ship the logs to. Not changeable after creation.
369370

370371

371372
<a id="nestedatt--options--observability--metrics"></a>
@@ -374,4 +375,4 @@ Optional:
374375
Optional:
375376

376377
- `credentials_ref` (String) Credentials reference for metrics. Not changeable after creation.
377-
- `push_url` (String) Credentials reference for metrics. Not changeable after creation.
378+
- `push_url` (String) The ARGUS/Prometheus remote write Push URL to ship the metrics to. Not changeable after creation.
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: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,46 @@ resource "stackit_server" "server" {
8888
}
8989

9090
# Create example credentials for observability of the ALB
91-
# Create real credentials in your stackit observability
91+
# Create real credentials in your STACKIT observability
9292
resource "stackit_loadbalancer_observability_credential" "observability" {
9393
project_id = var.project_id
9494
display_name = "my-cred"
9595
password = "password"
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)