-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathresource.tf
More file actions
37 lines (31 loc) · 847 Bytes
/
resource.tf
File metadata and controls
37 lines (31 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
variable "project_id" {
description = "The STACKIT Project ID"
type = string
default = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
# Create a RAS key pair
resource "tls_private_key" "example" {
algorithm = "RSA"
rsa_bits = 2048
}
# Create a TLS certificate
resource "tls_self_signed_cert" "example" {
private_key_pem = tls_private_key.example.private_key_pem
subject {
common_name = "localhost"
organization = "STACKIT Test"
}
validity_period_hours = 12
allowed_uses = [
"key_encipherment",
"digital_signature",
"server_auth",
]
}
# Create a ALB certificate
resource "stackit_alb_certificate" "certificate" {
project_id = var.project_id
name = "example-certificate"
private_key = tls_private_key.example.private_key_pem
public_key = tls_self_signed_cert.example.cert_pem
}