Skip to content

Commit 557939c

Browse files
committed
feat: implement sa access key resource
1 parent c04ee6f commit 557939c

File tree

7 files changed

+602
-12
lines changed

7 files changed

+602
-12
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_service_account_key Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
Schema for a STACKIT service account access key resource.
7+
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources.
8+
Example Usage
9+
Automatically rotate access tokens
10+
11+
resource "stackit_service_account" "sa" {
12+
project_id = var.stackit_project_id
13+
name = "sa01"
14+
}
15+
16+
resource "time_rotating" "rotate" {
17+
rotation_days = 80
18+
}
19+
20+
resource "stackit_service_account_key" "sakey" {
21+
project_id = var.stackit_project_id
22+
service_account_email = stackit_service_account.sa.email
23+
ttl_days = 90
24+
}
25+
---
26+
27+
# stackit_service_account_key (Resource)
28+
29+
Schema for a STACKIT service account access key resource.
30+
31+
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
32+
## Example Usage
33+
34+
35+
### Automatically rotate access tokens
36+
```terraform
37+
resource "stackit_service_account" "sa" {
38+
project_id = var.stackit_project_id
39+
name = "sa01"
40+
}
41+
42+
resource "time_rotating" "rotate" {
43+
rotation_days = 80
44+
}
45+
46+
resource "stackit_service_account_key" "sakey" {
47+
project_id = var.stackit_project_id
48+
service_account_email = stackit_service_account.sa.email
49+
ttl_days = 90
50+
}
51+
52+
```
53+
54+
55+
56+
<!-- schema generated by tfplugindocs -->
57+
## Schema
58+
59+
### Required
60+
61+
- `project_id` (String) The STACKIT project ID associated with the service account key.
62+
- `service_account_email` (String) The email address associated with the service account, used for account identification and communication.
63+
64+
### Optional
65+
66+
- `public_key` (String) Specifies the certificate file (certificate.pem) required for generating the public and private keys. If not provided, a default certificate from STACKIT will be used.
67+
- `rotate_when_changed` (Map of String) A map of arbitrary key/value pairs designed to force key recreation when they change, facilitating key rotation based on external factors such as a changing timestamp. Modifying this map triggers the creation of a new resource.
68+
- `ttl_days` (Number) Specifies the key's validity duration in days. If left unspecified, the key is considered valid until it is deleted
69+
70+
### Read-Only
71+
72+
- `id` (String) The unique internal identifier for the Terraform resource, formatted as a combination of 'project_id,key_id'.
73+
- `json` (String, Sensitive) The raw JSON representation of the API response, available for direct use.
74+
- `key_id` (String) The unique identifier for the key associated with the service account.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package key
2+
3+
const markdownDescription = `
4+
Schema for a STACKIT service account access key resource.` + "\n" + `
5+
~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources.
6+
## Example Usage` + "\n" + `
7+
8+
### Automatically rotate access tokens` + "\n" +
9+
"```terraform" + `
10+
resource "stackit_service_account" "sa" {
11+
project_id = var.stackit_project_id
12+
name = "sa01"
13+
}
14+
15+
resource "time_rotating" "rotate" {
16+
rotation_days = 80
17+
}
18+
19+
resource "stackit_service_account_key" "sakey" {
20+
project_id = var.stackit_project_id
21+
service_account_email = stackit_service_account.sa.email
22+
ttl_days = 90
23+
}
24+
` + "\n```"

0 commit comments

Comments
 (0)