-
Notifications
You must be signed in to change notification settings - Fork 52
STACKITLB-1837 | add ALB certificates to provider #1296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
david-mey-STACKIT
wants to merge
13
commits into
stackitcloud:main
Choose a base branch
from
david-mey-STACKIT:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0cac777
STACKITLB-798 | add ALB TF provider
david-mey-STACKIT ac05133
apply PR suggestions: https://github.com/stackitcloud/terraform-provi…
david-mey-STACKIT 0f6a8b4
Merge remote-tracking branch 'upstream/main'
david-mey-STACKIT 7dd76db
apply PR suggestions
david-mey-STACKIT d6f8b0d
Merge remote-tracking branch 'upstream/main'
david-mey-STACKIT 3e4c3db
apply PR suggestions
david-mey-STACKIT 363e809
Update stackit/internal/services/alb/applicationloadbalancer/resource.go
david-mey-STACKIT b7bf33e
apply PR suggestions
david-mey-STACKIT d69fb92
Merge remote-tracking branch 'upstream/main'
060b50d
Merge branch 'main' into main
Manuelvaas 7fd2b9f
STACKITLB-1837 | add ALB tls certificates provider
7beb13e
Merge remote-tracking branch 'upstream/main'
f3994d9
Merge remote-tracking branch 'upstream/main'
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "stackit_alb_certificate Data Source - stackit" | ||
| subcategory: "" | ||
| description: |- | ||
| ALB TLS Certificate data source schema. Must have a region specified in the provider configuration. | ||
| --- | ||
|
|
||
| # stackit_alb_certificate (Data Source) | ||
|
|
||
| ALB TLS Certificate data source schema. Must have a region specified in the provider configuration. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| data "stackit_alb_certificate" "example" { | ||
| project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
| cert_id = "example-certificate-v1-dfa816b3184f63f43d918ea5f9493f5359f6c2404b69afbb0b60fb1af69d0bc0" | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `cert_id` (String) The ID of the certificate. | ||
| - `project_id` (String) STACKIT project ID to which the certificate is associated. | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `id` (String) Terraform's internal resource ID. It is structured as `project_id`,`region`,`name`. | ||
| - `name` (String) Certificate name. | ||
| - `private_key` (String) The PEM encoded private key part | ||
| - `public_key` (String) The PEM encoded public key part | ||
| - `region` (String) The resource region (e.g. eu01). If not defined, the provider region is used. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "stackit_alb_certificate Resource - stackit" | ||
| subcategory: "" | ||
| description: |- | ||
| Setting up supporting infrastructure | ||
| The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the the automatic creation of a TLS certificate resource. | ||
| --- | ||
|
|
||
| # stackit_alb_certificate (Resource) | ||
|
|
||
| ## Setting up supporting infrastructure | ||
|
|
||
|
|
||
| The example below creates the supporting infrastructure using the STACKIT Terraform provider, including the the automatic creation of a TLS certificate resource. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```terraform | ||
| 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 | ||
| } | ||
| ``` | ||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) Certificate name. | ||
| - `private_key` (String, Sensitive) The PEM encoded private key part | ||
| - `project_id` (String) STACKIT project ID to which the certificate is associated. | ||
| - `public_key` (String) The PEM encoded public key part | ||
|
|
||
| ### Optional | ||
|
|
||
| - `region` (String) The resource region (e.g. eu01). If not defined, the provider region is used. | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `cert_id` (String) The ID of the certificate. | ||
| - `id` (String) Terraform's internal resource ID. It is structured as `project_id`,`region`,`cert_id`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| data "stackit_alb_certificate" "example" { | ||
| project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
| cert_id = "example-certificate-v1-dfa816b3184f63f43d918ea5f9493f5359f6c2404b69afbb0b60fb1af69d0bc0" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.