Skip to content

Commit 89c440b

Browse files
committed
feat(kms): add wrapping key resource and datasource
relates to STACKITTPR-416
1 parent 5e8c7a7 commit 89c440b

File tree

13 files changed

+1345
-2
lines changed

13 files changed

+1345
-2
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_kms_wrapping_key Data Source - stackit"
4+
subcategory: ""
5+
description: |-
6+
KMS wrapping key datasource schema.
7+
---
8+
9+
# stackit_kms_wrapping_key (Data Source)
10+
11+
KMS wrapping key datasource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
data "stackit_kms_wrapping_key" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
keyring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
wrapping_key_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
20+
}
21+
```
22+
23+
<!-- schema generated by tfplugindocs -->
24+
## Schema
25+
26+
### Required
27+
28+
- `keyring_id` (String) The ID of the associated keyring
29+
- `project_id` (String) STACKIT project ID to which the keyring is associated.
30+
- `wrapping_key_id` (String) The ID of the wrapping key
31+
32+
### Optional
33+
34+
- `region` (String) The resource region. If not defined, the provider region is used.
35+
36+
### Read-Only
37+
38+
- `access_scope` (String) The access scope of the key. Default is `PUBLIC`. Possible values are: `PUBLIC`, `SNA`.
39+
- `algorithm` (String) The wrapping algorithm used to wrap the key to import. Possible values are: `rsa_2048_oaep_sha256`, `rsa_3072_oaep_sha256`, `rsa_4096_oaep_sha256`, `rsa_4096_oaep_sha512`, `rsa_2048_oaep_sha256_aes_256_key_wrap`, `rsa_3072_oaep_sha256_aes_256_key_wrap`, `rsa_4096_oaep_sha256_aes_256_key_wrap`, `rsa_4096_oaep_sha512_aes_256_key_wrap`.
40+
- `description` (String) A user chosen description to distinguish multiple wrapping keys.
41+
- `display_name` (String) The display name to distinguish multiple wrapping keys.
42+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`keyring_id`,`wrapping_key_id`".
43+
- `protection` (String) The underlying system that is responsible for protecting the key material. Possible values are: `software`.
44+
- `public_key` (String) The public key of the wrapping key.
45+
- `purpose` (String) The purpose for which the key will be used. Possible values are: `wrap_symmetric_key`, `wrap_asymmetric_key`.

docs/resources/kms_keyring.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ KMS Keyring resource schema. Uses the `default_region` specified in the provider
1818
```terraform
1919
resource "stackit_kms_keyring" "example" {
2020
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
21-
display_name = "example name"
21+
display_name = "example-name"
2222
description = "example description"
2323
}
2424
```

docs/resources/kms_wrapping_key.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "stackit_kms_wrapping_key Resource - stackit"
4+
subcategory: ""
5+
description: |-
6+
KMS wrapping key resource schema.
7+
---
8+
9+
# stackit_kms_wrapping_key (Resource)
10+
11+
KMS wrapping key resource schema.
12+
13+
## Example Usage
14+
15+
```terraform
16+
resource "stackit_kms_wrapping_key" "example" {
17+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
18+
keyring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
19+
display_name = "example-name"
20+
protection = "software"
21+
algorithm = "rsa_2048_oaep_sha256"
22+
purpose = "wrap_symmetric_key"
23+
}
24+
```
25+
26+
<!-- schema generated by tfplugindocs -->
27+
## Schema
28+
29+
### Required
30+
31+
- `algorithm` (String) The wrapping algorithm used to wrap the key to import. Possible values are: `rsa_2048_oaep_sha256`, `rsa_3072_oaep_sha256`, `rsa_4096_oaep_sha256`, `rsa_4096_oaep_sha512`, `rsa_2048_oaep_sha256_aes_256_key_wrap`, `rsa_3072_oaep_sha256_aes_256_key_wrap`, `rsa_4096_oaep_sha256_aes_256_key_wrap`, `rsa_4096_oaep_sha512_aes_256_key_wrap`.
32+
- `display_name` (String) The display name to distinguish multiple wrapping keys.
33+
- `keyring_id` (String) The ID of the associated keyring
34+
- `project_id` (String) STACKIT project ID to which the keyring is associated.
35+
- `protection` (String) The underlying system that is responsible for protecting the key material. Possible values are: `software`.
36+
- `purpose` (String) The purpose for which the key will be used. Possible values are: `wrap_symmetric_key`, `wrap_asymmetric_key`.
37+
38+
### Optional
39+
40+
- `access_scope` (String) The access scope of the key. Default is `PUBLIC`. Possible values are: `PUBLIC`, `SNA`.
41+
- `description` (String) A user chosen description to distinguish multiple wrapping keys.
42+
- `region` (String) The resource region. If not defined, the provider region is used.
43+
44+
### Read-Only
45+
46+
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`keyring_id`,`wrapping_key_id`".
47+
- `public_key` (String) The public key of the wrapping key.
48+
- `wrapping_key_id` (String) The ID of the wrapping key
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data "stackit_kms_wrapping_key" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
keyring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
wrapping_key_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
5+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "stackit_kms_keyring" "example" {
22
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3-
display_name = "example name"
3+
display_name = "example-name"
44
description = "example description"
55
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resource "stackit_kms_wrapping_key" "example" {
2+
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
3+
keyring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
4+
display_name = "example-name"
5+
protection = "software"
6+
algorithm = "rsa_2048_oaep_sha256"
7+
purpose = "wrap_symmetric_key"
8+
}

0 commit comments

Comments
 (0)