-
Notifications
You must be signed in to change notification settings - Fork 35
first steps for kms key-ring resource and datasource #897
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
base: main
Are you sure you want to change the base?
Changes from all commits
a7259ff
6f6d063
5b59eb6
185fed5
6bcc14a
d320073
bcd0528
99e2b7f
8c654ad
219adac
1186cee
cb23a4e
8d0da16
2732c4a
b483c13
248748e
d41ad9d
77a623e
7df0307
d87d60f
438da14
889b222
0ce560c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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_kms_key Data Source - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key resource schema. Must have a region specified in the provider configuration. | ||
--- | ||
|
||
# stackit_kms_key (Data Source) | ||
|
||
KMS Key resource schema. Must have a `region` specified in the provider configuration. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `algorithm` (String) The encryption algorithm that the key will use to encrypt data | ||
- `backend` (String) The backend that is used for KMS. Right now, only software is accepted. | ||
- `display_name` (String) The display name to distinguish multiple keys | ||
- `import_only` (Boolean) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
- `key_id` (String) | ||
- `key_ring_id` (String) The ID of the associated key ring | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
- `purpose` (String) The purpose for which the key will be used | ||
|
||
### Optional | ||
|
||
- `description` (String) A user chosen description to distinguish multiple keys | ||
- `region` (String) The resource region. If not defined, the provider region is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "stackit_kms_key_ring Data Source - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key Ring resource schema. | ||
--- | ||
|
||
# stackit_kms_key_ring (Data Source) | ||
|
||
KMS Key Ring resource schema. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `key_ring_id` (String) An auto generated unique id which identifies the key ring. | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
|
||
### Read-Only | ||
|
||
- `description` (String) A user chosen description to distinguish multiple key rings. | ||
- `display_name` (String) A user chosen description to distinguish multiple key rings. | ||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
- `region` (String) The resource region. If not defined, the provider region is used. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "stackit_kms_wrapping_key Data Source - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key resource schema. Must have a region specified in the provider configuration. | ||
--- | ||
|
||
# stackit_kms_wrapping_key (Data Source) | ||
|
||
KMS Key resource schema. Must have a `region` specified in the provider configuration. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `algorithm` (String) The encryption algorithm that the key will use to encrypt data | ||
- `backend` (String) The backend that is used for KMS. Right now, only software is accepted. | ||
- `display_name` (String) The display name to distinguish multiple keys | ||
- `key_ring_id` (String) The ID of the associated key ring | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
- `purpose` (String) The purpose for which the key will be used | ||
- `wrapping_key_id` (String) | ||
|
||
### Optional | ||
|
||
- `description` (String) A user chosen description to distinguish multiple keys | ||
- `region` (String) The resource region. If not defined, the provider region is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "stackit_kms_key Resource - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key resource schema. Must have a region specified in the provider configuration. | ||
--- | ||
|
||
# stackit_kms_key (Resource) | ||
|
||
KMS Key resource schema. Must have a `region` specified in the provider configuration. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "stackit_kms_key" "name" { | ||
algorithm = "example algorithm" | ||
backend = "software" | ||
description = "new descr" | ||
display_name = "example name" | ||
import_only = false | ||
key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
purpose = "example purpose" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `algorithm` (String) The encryption algorithm that the key will use to encrypt data | ||
- `backend` (String) The backend that is used for KMS. Right now, only software is accepted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think with the migration from v1beta -> v1, this was renamed to |
||
- `display_name` (String) The display name to distinguish multiple keys | ||
- `import_only` (Boolean) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Description of |
||
- `key_ring_id` (String) The ID of the associated key ring | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
- `purpose` (String) The purpose for which the key will be used | ||
|
||
### Optional | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding the api spec |
||
- `description` (String) A user chosen description to distinguish multiple keys | ||
- `region` (String) The resource region. If not defined, the provider region is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
- `key_id` (String) The ID of the key |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "stackit_kms_key_ring Resource - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key Ring resource schema. Must have a region specified in the provider configuration. | ||
--- | ||
|
||
# stackit_kms_key_ring (Resource) | ||
|
||
KMS Key Ring resource schema. Must have a `region` specified in the provider configuration. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "stackit_kms_key_ring" "example" { | ||
description = "example description" | ||
display_name = "example name" | ||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
region_id = "eu01" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `display_name` (String) A user chosen description to distinguish multiple key rings. | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
|
||
### Optional | ||
|
||
- `description` (String) A user chosen description to distinguish multiple key rings. | ||
- `region` (String) The resource region. If not defined, the provider region is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
- `key_ring_id` (String) An auto generated unique id which identifies the key ring. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "stackit_kms_wrapping_key Resource - stackit" | ||
subcategory: "" | ||
description: |- | ||
KMS Key resource schema. Must have a region specified in the provider configuration. | ||
--- | ||
|
||
# stackit_kms_wrapping_key (Resource) | ||
|
||
KMS Key resource schema. Must have a `region` specified in the provider configuration. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "stackit_kms_wrapping_key" "name" { | ||
algorithm = "example algorithm" | ||
backend = "software" | ||
description = "new descr" | ||
display_name = "example name" | ||
key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||
purpose = "example purpose" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `algorithm` (String) The encryption algorithm that the key will use to encrypt data | ||
- `backend` (String) The backend that is used for KMS. Right now, only software is accepted. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here also renamed to |
||
- `display_name` (String) The display name to distinguish multiple keys | ||
- `key_ring_id` (String) The ID of the associated key ring | ||
- `project_id` (String) STACKIT project ID to which the key ring is associated. | ||
- `purpose` (String) The purpose for which the key will be used | ||
|
||
### Optional | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
- `description` (String) A user chosen description to distinguish multiple keys | ||
- `region` (String) The resource region. If not defined, the provider region is used. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`". | ||
- `wrapping_key_id` (String) The ID of the wrapping key |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,10 @@ | ||||||||||||||||||||||||||||||||
resource "stackit_kms_key" "name" { | ||||||||||||||||||||||||||||||||
algorithm = "example algorithm" | ||||||||||||||||||||||||||||||||
backend = "software" | ||||||||||||||||||||||||||||||||
description = "new descr" | ||||||||||||||||||||||||||||||||
display_name = "example name" | ||||||||||||||||||||||||||||||||
import_only = false | ||||||||||||||||||||||||||||||||
key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||||||||||||||||||||||||||||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||||||||||||||||||||||||||||||||
purpose = "example purpose" | ||||||||||||||||||||||||||||||||
Comment on lines
+2
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually have the
Suggested change
If you want you can also add an additional example, where the |
||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an example how the resource can be imported, like we have it here terraform-provider-stackit/docs/resources/ske_cluster.md Lines 41 to 45 in 813b8c0
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,6 @@ | ||||||||||||||||||||
resource "stackit_kms_key_ring" "example" { | ||||||||||||||||||||
description = "example description" | ||||||||||||||||||||
display_name = "example name" | ||||||||||||||||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||||||||||||||||||||
region_id = "eu01" | ||||||||||||||||||||
} | ||||||||||||||||||||
Comment on lines
+2
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change also the order here, so that project_id is first and remove region_id. Also add an import example
Suggested change
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||||||||||||||||||||||||||
resource "stackit_kms_wrapping_key" "name" { | ||||||||||||||||||||||||||||||
algorithm = "example algorithm" | ||||||||||||||||||||||||||||||
backend = "software" | ||||||||||||||||||||||||||||||
description = "new descr" | ||||||||||||||||||||||||||||||
display_name = "example name" | ||||||||||||||||||||||||||||||
key_ring_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||||||||||||||||||||||||||||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" | ||||||||||||||||||||||||||||||
purpose = "example purpose" | ||||||||||||||||||||||||||||||
Comment on lines
+2
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the order, so that project_id and key_ring_id are first. And add an import example
Suggested change
|
||||||||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,14 @@ require ( | |
github.com/stackitcloud/stackit-sdk-go/services/git v0.7.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/iaas v0.28.0 | ||
github.com/stackitcloud/stackit-sdk-go/services/iaasalpha v0.1.21-alpha | ||
github.com/stackitcloud/stackit-sdk-go/services/kms v0.5.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's probably our fault that this is quite old, but this can be update to v1.0.0. You should then get the change for Please try to avoid upgrading other modules than the one that are required for you PR. I think most of them should be already in our main branch, so a rebase would probably fix this :) |
||
github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.5.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/modelserving v0.5.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.5.2 | ||
github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.3.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/observability v0.9.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/observability v0.10.0 | ||
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.2.1 | ||
github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.1 | ||
|
@@ -37,7 +38,7 @@ require ( | |
github.com/stackitcloud/stackit-sdk-go/services/ske v1.3.0 | ||
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.1 | ||
github.com/teambition/rrule-go v1.8.2 | ||
golang.org/x/mod v0.26.0 | ||
golang.org/x/mod v0.27.0 | ||
) | ||
|
||
require github.com/hashicorp/go-retryablehttp v0.7.7 // indirect | ||
|
@@ -65,7 +66,7 @@ require ( | |
github.com/hashicorp/terraform-exec v0.23.0 // indirect | ||
github.com/hashicorp/terraform-json v0.25.0 // indirect | ||
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 // indirect | ||
github.com/hashicorp/terraform-registry-address v0.2.5 // indirect | ||
github.com/hashicorp/terraform-registry-address v0.3.0 // indirect | ||
github.com/hashicorp/terraform-svchost v0.1.1 // indirect | ||
github.com/hashicorp/yamux v0.1.2 // indirect | ||
github.com/kr/pretty v0.3.1 // indirect | ||
|
@@ -76,24 +77,24 @@ require ( | |
github.com/mitchellh/go-wordwrap v1.0.0 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/mitchellh/reflectwalk v1.0.2 // indirect | ||
github.com/oklog/run v1.1.0 // indirect | ||
github.com/oklog/run v1.2.0 // indirect | ||
github.com/rogpeppe/go-internal v1.13.1 // indirect | ||
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.8.1 | ||
github.com/stretchr/testify v1.8.4 // indirect | ||
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect | ||
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect | ||
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect | ||
github.com/zclconf/go-cty v1.16.3 // indirect | ||
golang.org/x/crypto v0.40.0 // indirect | ||
golang.org/x/net v0.42.0 // indirect | ||
golang.org/x/crypto v0.41.0 // indirect | ||
golang.org/x/net v0.43.0 // indirect | ||
golang.org/x/sync v0.16.0 // indirect | ||
golang.org/x/sys v0.34.0 // indirect | ||
golang.org/x/text v0.27.0 // indirect | ||
golang.org/x/sys v0.35.0 // indirect | ||
golang.org/x/text v0.28.0 // indirect | ||
golang.org/x/tools v0.35.0 // indirect | ||
google.golang.org/appengine v1.6.8 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect | ||
google.golang.org/grpc v1.73.0 // indirect | ||
google.golang.org/protobuf v1.36.6 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect | ||
google.golang.org/grpc v1.74.2 // indirect | ||
google.golang.org/protobuf v1.36.7 // indirect | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
) | ||
|
||
|
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.
In all three data sources the examples are missing. Please add them in examples/data-sources/<data-source-name>/data-source.tf like you did it for the resources