|
| 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 network, network interface, a public IP address and server resources. |
| 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 network, network interface, a public IP address and server resources. |
| 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`. |
0 commit comments