Merge branch 'main' into alpha

# Conflicts:
#	docs/data-sources/sqlserverflexalpha_user.md
#	docs/index.md
#	docs/resources/postgresflexalpha_instance.md
#	docs/resources/sqlserverflexalpha_user.md
#	examples/data-sources/stackitprivatepreview_postgresflexalpha_database/data-source.tf
#	examples/data-sources/stackitprivatepreview_postgresflexalpha_instance/data-source.tf
#	examples/data-sources/stackitprivatepreview_postgresflexalpha_user/data-source.tf
#	examples/data-sources/stackitprivatepreview_sqlserverflexalpha_instance/data-source.tf
#	examples/data-sources/stackitprivatepreview_sqlserverflexalpha_user/data-source.tf
#	examples/provider/provider.tf
#	examples/resources/stackitprivatepreview_postgresflexalpha_database/resource.tf
#	examples/resources/stackitprivatepreview_postgresflexalpha_instance/resource.tf
#	examples/resources/stackitprivatepreview_postgresflexalpha_user/resource.tf
#	examples/resources/stackitprivatepreview_sqlserverflexalpha_instance/resource.tf
#	examples/resources/stackitprivatepreview_sqlserverflexalpha_user/resource.tf
#	go.mod
#	go.sum
#	golang-ci.yaml
#	main.go
#	scripts/check-docs.sh
#	scripts/lint-golangci-lint.sh
#	scripts/project.sh
#	scripts/replace.sh
#	scripts/tfplugindocs.sh
#	stackit/internal/conversion/conversion.go
#	stackit/internal/conversion/conversion_test.go
#	stackit/internal/core/core.go
#	stackit/internal/core/core_test.go
#	stackit/internal/features/beta.go
#	stackit/internal/features/beta_test.go
#	stackit/internal/features/experiments.go
#	stackit/internal/features/experiments_test.go
#	stackit/internal/services/postgresflexalpha/database/datasource.go.bak
#	stackit/internal/services/postgresflexalpha/database/resource.go.bak
#	stackit/internal/services/postgresflexalpha/database/resource_test.go.bak
#	stackit/internal/services/postgresflexalpha/instance/datasource.go.bak
#	stackit/internal/services/postgresflexalpha/instance/resource.go
#	stackit/internal/services/postgresflexalpha/instance/use_state_for_unknown_if_flavor_unchanged_modifier.go
#	stackit/internal/services/postgresflexalpha/postgresflex_acc_test.go
#	stackit/internal/services/postgresflexalpha/user/datasource.go
#	stackit/internal/services/postgresflexalpha/user/datasource_test.go
#	stackit/internal/services/postgresflexalpha/user/resource.go
#	stackit/internal/services/postgresflexalpha/user/resource_test.go
#	stackit/internal/services/postgresflexalpha/utils/util.go
#	stackit/internal/services/postgresflexalpha/utils/util_test.go
#	stackit/internal/services/sqlserverflexalpha/instance/datasource.go
#	stackit/internal/services/sqlserverflexalpha/instance/resource.go
#	stackit/internal/services/sqlserverflexalpha/sqlserverflex_acc_test.go
#	stackit/internal/services/sqlserverflexalpha/testdata/resource-max.tf
#	stackit/internal/services/sqlserverflexalpha/testdata/resource-min.tf
#	stackit/internal/services/sqlserverflexalpha/user/datasource.go
#	stackit/internal/services/sqlserverflexalpha/user/resource.go
#	stackit/internal/services/sqlserverflexalpha/utils/util.go
#	stackit/internal/services/sqlserverflexalpha/utils/util_test.go
#	stackit/internal/testutil/testutil.go
#	stackit/internal/testutil/testutil_test.go
#	stackit/internal/utils/attributes.go
#	stackit/internal/utils/attributes_test.go
#	stackit/internal/utils/headers.go
#	stackit/internal/utils/headers_test.go
#	stackit/internal/utils/regions.go
#	stackit/internal/utils/regions_test.go
#	stackit/internal/utils/use_state_for_unknown_if.go
#	stackit/internal/utils/use_state_for_unknown_if_test.go
#	stackit/internal/utils/utils.go
#	stackit/internal/utils/utils_test.go
#	stackit/internal/validate/validate.go
#	stackit/internal/validate/validate_test.go
#	stackit/provider.go
#	stackit/provider_acc_test.go
#	stackit/testdata/provider-all-attributes.tf
#	stackit/testdata/provider-credentials.tf
#	stackit/testdata/provider-invalid-attribute.tf
This commit is contained in:
Marcel_Henselin 2025-12-19 11:33:29 +01:00
commit 7de63b5b8e
9 changed files with 4 additions and 194 deletions

View file

@ -1,27 +0,0 @@
---
page_title: "How to import an existing resources"
---
# How to import an existing resources?
## 1. **Create a terraform config file and add an import block for your resource**
In order to import an existing resources in terraform you need to add an import block for the corresponding resource in a terraform config file.
There is an example for every resource under the [examples](../../examples/) folder.
E.g. the import statement for a `stackit_volume` looks like the following:
```terraform
import {
to = stackit_volume.import-example
id = "${var.project_id},${var.volume_id}"
}
```
## 2. **Generate the destination resource automatically**
Run `terraform plan -generate-config-out=generated.tf` to let terraform generate the configuration for you.
In this step the `stackit_volume.import-example` resource is generated and filled with informations of your existing resource.
## 3. **Finish the import**
Run `terraform apply` to add your resource to the terraform state.