feat(resourcemanager): add folder resource/datasource (#975)

* feat(resourcemanager): add folder resource/datasource

* feat(resourcemanager): add created_at and updated_at attributes to resourcemanager project/folder

---------

Signed-off-by: Mauritz Uphoff <mauritz.uphoff@stackit.cloud>
This commit is contained in:
Mauritz Uphoff 2025-09-17 09:53:48 +02:00 committed by GitHub
parent 27e4ef0227
commit 813b8c0e81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 1844 additions and 171 deletions

View file

@ -0,0 +1,39 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_resourcemanager_folder Data Source - stackit"
subcategory: ""
description: |-
Resource Manager folder data source schema. To identify the folder, you need to provide the container_id.
~> This datasource 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.
---
# stackit_resourcemanager_folder (Data Source)
Resource Manager folder data source schema. To identify the folder, you need to provide the container_id.
~> This datasource 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.
## Example Usage
```terraform
data "stackit_resourcemanager_folder" "example" {
container_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `container_id` (String) Folder container ID. Globally unique, user-friendly identifier.
### Read-Only
- `creation_time` (String) Date-time at which the folder was created.
- `folder_id` (String) Folder UUID identifier. Globally unique folder identifier
- `id` (String) Terraform's internal resource ID. It is structured as "`container_id`".
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}.
- `name` (String) The name of the folder.
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported.
- `update_time` (String) Date-time at which the folder was last modified.

View file

@ -29,7 +29,9 @@ data "stackit_resourcemanager_project" "example" {
### Read-Only
- `creation_time` (String) Date-time at which the project was created.
- `id` (String) Terraform's internal data source. ID. It is structured as "`container_id`".
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}
- `name` (String) Project name.
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported
- `update_time` (String) Date-time at which the project was last modified.

View file

@ -0,0 +1,64 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "stackit_resourcemanager_folder Resource - stackit"
subcategory: ""
description: |-
Resource Manager folder resource schema.
~> 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.
---
# stackit_resourcemanager_folder (Resource)
Resource Manager folder resource schema.
~> 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.
## Example Usage
```terraform
resource "stackit_resourcemanager_folder" "example" {
name = "example-folder"
owner_email = "foo.bar@stackit.cloud"
parent_container_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
# Note:
# You can add projects under folders.
# However, when deleting a project, be aware:
# - Projects may remain "invisible" for up to 7 days after deletion
# - During this time, deleting the parent folder may fail because the project is still technically linked
resource "stackit_resourcemanager_project" "example_project" {
name = "example-project"
owner_email = "foo.bar@stackit.cloud"
parent_container_id = stackit_resourcemanager_folder.example.container_id
}
# Only use the import statement, if you want to import an existing resourcemanager folder
# Note: There will be a conflict which needs to be resolved manually.
# Must set a configuration value for the owner_email attribute as the provider has marked it as required.
import {
to = stackit_resourcemanager_folder.import-example
id = var.container_id
}
```
<!-- schema generated by tfplugindocs -->
## Schema
### Required
- `name` (String) The name of the folder.
- `owner_email` (String) Email address of the owner of the folder. This value is only considered during creation. Changing it afterwards will have no effect.
- `parent_container_id` (String) Parent resource identifier. Both container ID (user-friendly) and UUID are supported.
### Optional
- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. A label key must match the regex [A-ZÄÜÖa-zäüöß0-9_-]{1,64}. A label value must match the regex ^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}.
### Read-Only
- `container_id` (String) Folder container ID. Globally unique, user-friendly identifier.
- `creation_time` (String) Date-time at which the folder was created.
- `folder_id` (String) Folder UUID identifier. Globally unique folder identifier
- `id` (String) Terraform's internal resource ID. It is structured as "`container_id`".
- `update_time` (String) Date-time at which the folder was last modified.

View file

@ -3,13 +3,13 @@
page_title: "stackit_resourcemanager_project Resource - stackit"
subcategory: ""
description: |-
Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.
Resource Manager project resource schema.
-> In case you're getting started with an empty STACKIT organization and want to use this resource to create projects in it, check out this guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/stackit_org_service_account for how to create a service account which you can use for authentication in the STACKIT Terraform provider.
---
# stackit_resourcemanager_project (Resource)
Resource Manager project resource schema. To use this resource, it is required that you set the service account email in the provider configuration.
Resource Manager project resource schema.
-> In case you're getting started with an empty STACKIT organization and want to use this resource to create projects in it, check out [this guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/stackit_org_service_account) for how to create a service account which you can use for authentication in the STACKIT Terraform provider.
@ -52,5 +52,7 @@ To create a project within a STACKIT Network Area, setting the label `networkAre
### Read-Only
- `container_id` (String) Project container ID. Globally unique, user-friendly identifier.
- `creation_time` (String) Date-time at which the project was created.
- `id` (String) Terraform's internal resource ID. It is structured as "`container_id`".
- `project_id` (String) Project UUID identifier. This is the ID that can be used in most of the other resources to identify the project.
- `update_time` (String) Date-time at which the project was last modified.