diff --git a/docs/resources/affinity_group.md b/docs/resources/affinity_group.md index 3d8b8351c..79af4b998 100644 --- a/docs/resources/affinity_group.md +++ b/docs/resources/affinity_group.md @@ -87,12 +87,6 @@ resource "stackit_affinity_group" "example" { name = "example-affinity-group-name" policy = "hard-anti-affinity" } - -# Only use the import statement, if you want to import an existing affinity group -import { - to = stackit_affinity_group.import-example - id = "${var.project_id},${var.region},${var.affinity_group_id}" -} ``` @@ -113,3 +107,17 @@ import { - `affinity_group_id` (String) The affinity group ID. - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`affinity_group_id`". - `members` (List of String) The servers that are part of the affinity group. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing affinity group +import { + to = stackit_affinity_group.import-example + id = "${var.project_id},${var.region},${var.affinity_group_id}" +} +``` diff --git a/docs/resources/authorization_folder_custom_role.md b/docs/resources/authorization_folder_custom_role.md index c11f4da5b..2d8225f78 100644 --- a/docs/resources/authorization_folder_custom_role.md +++ b/docs/resources/authorization_folder_custom_role.md @@ -27,12 +27,6 @@ resource "stackit_authorization_folder_custom_role" "example" { "iam.subject.get" ] } - -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_folder_custom_role.import-example - id = "${var.folder_id},${var.custom_role_id}" -} ``` @@ -49,3 +43,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]". - `role_id` (String) The ID of the role. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_folder_custom_role.import-example + id = "${var.folder_id},${var.custom_role_id}" +} +``` diff --git a/docs/resources/authorization_folder_role_assignment.md b/docs/resources/authorization_folder_role_assignment.md index fb479a6c2..e4047ce52 100644 --- a/docs/resources/authorization_folder_role_assignment.md +++ b/docs/resources/authorization_folder_role_assignment.md @@ -28,12 +28,6 @@ resource "stackit_authorization_folder_role_assignment" "fra" { role = "reader" subject = "foo.bar@stackit.cloud" } - -# Only use the import statement, if you want to import an existing folder role assignment -import { - to = stackit_authorization_folder_role_assignment.import-example - id = "${var.folder_id},${var.folder_role_assignment},${var.folder_role_assignment_subject}" -} ``` @@ -48,3 +42,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource identifier. It is structured as "`resource_id`,`role`,`subject`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing folder role assignment +import { + to = stackit_authorization_folder_role_assignment.import-example + id = "${var.folder_id},${var.folder_role_assignment},${var.folder_role_assignment_subject}" +} +``` diff --git a/docs/resources/authorization_organization_custom_role.md b/docs/resources/authorization_organization_custom_role.md index c6ea057f7..dc4f6f940 100644 --- a/docs/resources/authorization_organization_custom_role.md +++ b/docs/resources/authorization_organization_custom_role.md @@ -21,12 +21,6 @@ resource "stackit_authorization_organization_custom_role" "example" { "iam.subject.get" ] } - -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_organization_custom_role.import-example - id = "${var.organization_id},${var.custom_role_id}" -} ``` @@ -43,3 +37,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]". - `role_id` (String) The ID of the role. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_organization_custom_role.import-example + id = "${var.organization_id},${var.custom_role_id}" +} +``` diff --git a/docs/resources/authorization_organization_role_assignment.md b/docs/resources/authorization_organization_role_assignment.md index 5cc52d80b..7f107bfcf 100644 --- a/docs/resources/authorization_organization_role_assignment.md +++ b/docs/resources/authorization_organization_role_assignment.md @@ -21,12 +21,6 @@ resource "stackit_authorization_organization_role_assignment" "example" { role = "owner" subject = "john.doe@stackit.cloud" } - -# Only use the import statement, if you want to import an existing organization role assignment -import { - to = stackit_authorization_organization_role_assignment.import-example - id = "${var.organization_id},${var.org_role_assignment_role},${var.org_role_assignment_subject}" -} ``` @@ -41,3 +35,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource identifier. It is structured as "`resource_id`,`role`,`subject`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing organization role assignment +import { + to = stackit_authorization_organization_role_assignment.import-example + id = "${var.organization_id},${var.org_role_assignment_role},${var.org_role_assignment_subject}" +} +``` diff --git a/docs/resources/authorization_project_custom_role.md b/docs/resources/authorization_project_custom_role.md index 531c8ecad..0cdff6628 100644 --- a/docs/resources/authorization_project_custom_role.md +++ b/docs/resources/authorization_project_custom_role.md @@ -27,12 +27,6 @@ resource "stackit_authorization_project_custom_role" "example" { "iam.subject.get" ] } - -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_project_custom_role.import-example - id = "${var.project_id},${var.custom_role_id}" -} ``` @@ -49,3 +43,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "[resource_id],[role_id]". - `role_id` (String) The ID of the role. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_project_custom_role.import-example + id = "${var.project_id},${var.custom_role_id}" +} +``` diff --git a/docs/resources/authorization_project_role_assignment.md b/docs/resources/authorization_project_role_assignment.md index c9077e803..6da638ec9 100644 --- a/docs/resources/authorization_project_role_assignment.md +++ b/docs/resources/authorization_project_role_assignment.md @@ -28,12 +28,6 @@ resource "stackit_authorization_project_role_assignment" "pra" { role = "reader" subject = "foo.bar@stackit.cloud" } - -# Only use the import statement, if you want to import an existing project role assignment -import { - to = stackit_authorization_project_role_assignment.import-example - id = "${var.project_id},${var.project_role_assignment_role},${var.project_role_assignment_subject}" -} ``` @@ -48,3 +42,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource identifier. It is structured as "`resource_id`,`role`,`subject`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing project role assignment +import { + to = stackit_authorization_project_role_assignment.import-example + id = "${var.project_id},${var.project_role_assignment_role},${var.project_role_assignment_subject}" +} +``` diff --git a/docs/resources/authorization_service_account_role_assignment.md b/docs/resources/authorization_service_account_role_assignment.md index 173ea840b..3a383d848 100644 --- a/docs/resources/authorization_service_account_role_assignment.md +++ b/docs/resources/authorization_service_account_role_assignment.md @@ -42,12 +42,6 @@ resource "stackit_authorization_service_account_role_assignment" "sa" { role = "user" subject = data.stackit_service_accounts.ske_sa_suffix.items.0.email } - -# Only use the import statement, if you want to import an existing service account assignment -import { - to = stackit_authorization_service_account_assignment.sa - id = "${var.resource_id},${var.service_account_assignment_role},${var.service_account_assignment_subject}" -} ``` @@ -62,3 +56,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource identifier. It is structured as "`resource_id`,`role`,`subject`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing service account assignment +import { + to = stackit_authorization_service_account_assignment.sa + id = "${var.resource_id},${var.service_account_assignment_role},${var.service_account_assignment_subject}" +} +``` diff --git a/docs/resources/cdn_custom_domain.md b/docs/resources/cdn_custom_domain.md index 0a535c6bc..1612cd5ee 100644 --- a/docs/resources/cdn_custom_domain.md +++ b/docs/resources/cdn_custom_domain.md @@ -25,12 +25,6 @@ resource "stackit_cdn_custom_domain" "example" { private_key = "-----BEGIN RSA PRIVATE KEY-----\nY2VydGlmaWNhdGVfZGF0YQ==\n-----END RSA PRIVATE KEY---" } } - -# Only use the import statement, if you want to import an existing cdn custom domain -import { - to = stackit_cdn_custom_domain.import-example - id = "${var.project_id},${var.distribution_id},${var.custom_domain_name}" -} ``` @@ -63,3 +57,17 @@ Optional: Read-Only: - `version` (Number) A version identifier for the certificate. Required for custom certificates. The certificate will be updated if this field is changed. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing cdn custom domain +import { + to = stackit_cdn_custom_domain.import-example + id = "${var.project_id},${var.distribution_id},${var.custom_domain_name}" +} +``` diff --git a/docs/resources/cdn_distribution.md b/docs/resources/cdn_distribution.md index e7684b718..cf24cf2cf 100644 --- a/docs/resources/cdn_distribution.md +++ b/docs/resources/cdn_distribution.md @@ -116,12 +116,6 @@ resource "stackit_cdn_distribution" "example_bucket_distribution" { } } } - -# Only use the import statement, if you want to import an existing cdn distribution -import { - to = stackit_cdn_distribution.import-example - id = "${var.project_id},${var.distribution_id}" -} ``` @@ -271,3 +265,17 @@ Read-Only: - `name` (String) The name of the domain - `status` (String) The status of the domain - `type` (String) The type of the domain. Each distribution has one domain of type "managed", and domains of type "custom" may be additionally created by the user + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing cdn distribution +import { + to = stackit_cdn_distribution.import-example + id = "${var.project_id},${var.distribution_id}" +} +``` diff --git a/docs/resources/dns_record_set.md b/docs/resources/dns_record_set.md index a2774a545..86fe349eb 100644 --- a/docs/resources/dns_record_set.md +++ b/docs/resources/dns_record_set.md @@ -21,12 +21,6 @@ resource "stackit_dns_record_set" "example" { comment = "Example comment" records = ["1.2.3.4"] } - -# Only use the import statement, if you want to import an existing dns record set -import { - to = stackit_dns_record_set.import-example - id = "${var.project_id},${var.zone_id},${var.record_set_id}" -} ``` @@ -64,3 +58,17 @@ Optional: - `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. - `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. - `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing dns record set +import { + to = stackit_dns_record_set.import-example + id = "${var.project_id},${var.zone_id},${var.record_set_id}" +} +``` diff --git a/docs/resources/dns_zone.md b/docs/resources/dns_zone.md index b5dd0706d..d5bc254df 100644 --- a/docs/resources/dns_zone.md +++ b/docs/resources/dns_zone.md @@ -23,12 +23,6 @@ resource "stackit_dns_zone" "example" { description = "Example description" default_ttl = 1230 } - -# Only use the import statement, if you want to import an existing dns zone -import { - to = stackit_dns_zone.import-example - id = "${var.project_id},${var.zone_id}" -} ``` @@ -75,3 +69,17 @@ Optional: - `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. - `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. - `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing dns zone +import { + to = stackit_dns_zone.import-example + id = "${var.project_id},${var.zone_id}" +} +``` diff --git a/docs/resources/dremio_instance.md b/docs/resources/dremio_instance.md index 151822405..54daabf08 100644 --- a/docs/resources/dremio_instance.md +++ b/docs/resources/dremio_instance.md @@ -44,11 +44,6 @@ resource "stackit_dremio_instance" "example" { } } } - -import { - to = stackit_dremio_instance.import_example - id = "${var.project_id},${var.region},${var.instance_id}" -} ``` @@ -155,3 +150,16 @@ Read-Only: - `arrow_flight` (String) The arrow flight endpoint of the Dremio instance. - `catalog` (String) The Apache Iceberg endpoint of the Dremio instance. - `ui` (String) The UI endpoint of the Dremio instance. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +import { + to = stackit_dremio_instance.import_example + id = "${var.project_id},${var.region},${var.instance_id}" +} +``` diff --git a/docs/resources/dremio_user.md b/docs/resources/dremio_user.md index 1405e2b69..fade9625b 100644 --- a/docs/resources/dremio_user.md +++ b/docs/resources/dremio_user.md @@ -27,11 +27,6 @@ resource "stackit_dremio_user" "example" { last_name = "User" name = "testUser" } - -import { - to = stackit_dremio_user.import_example - id = "${var.project_id},${var.region},${var.instance_id},${var.user_id}" -} ``` @@ -67,3 +62,16 @@ Optional: - `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. - `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. - `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +import { + to = stackit_dremio_user.import_example + id = "${var.project_id},${var.region},${var.instance_id},${var.user_id}" +} +``` diff --git a/docs/resources/edgecloud_instance.md b/docs/resources/edgecloud_instance.md index 381c25961..29906bea9 100644 --- a/docs/resources/edgecloud_instance.md +++ b/docs/resources/edgecloud_instance.md @@ -32,12 +32,6 @@ resource "stackit_edgecloud_instance" "this" { plan_id = local.plan_id description = local.description } - -# Only use the import statement, if you want to import an existing Edge Cloud instance resource -import { - to = stackit_edgecloud_instance.this - id = "${local.project_id},${local.region},INSTANCE_ID" -} ``` @@ -61,3 +55,17 @@ import { - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`region`,`instance_id`". - `instance_id` (String) - - `status` (String) instance status + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing Edge Cloud instance resource +import { + to = stackit_edgecloud_instance.this + id = "${local.project_id},${local.region},INSTANCE_ID" +} +``` diff --git a/docs/resources/git.md b/docs/resources/git.md index 0fb6f2bfa..9b9e4d9f8 100644 --- a/docs/resources/git.md +++ b/docs/resources/git.md @@ -29,12 +29,6 @@ resource "stackit_git" "git" { ] flavor = "git-100" } - -# Only use the import statement, if you want to import an existing git resource -import { - to = stackit_git.import-example - id = "${var.project_id},${var.git_instance_id}" -} ``` @@ -59,3 +53,17 @@ import { - `instance_id` (String) ID linked to the git instance. - `url` (String) Url linked to the git instance. - `version` (String) Version linked to the git instance. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing git resource +import { + to = stackit_git.import-example + id = "${var.project_id},${var.git_instance_id}" +} +``` diff --git a/docs/resources/image.md b/docs/resources/image.md index 7dfb252f2..0ba462c0f 100644 --- a/docs/resources/image.md +++ b/docs/resources/image.md @@ -21,18 +21,6 @@ resource "stackit_image" "example_image" { min_disk_size = 10 min_ram = 5 } - -# Only use the import statement, if you want to import an existing image -# Must set a configuration value for the local_file_path attribute as the provider has marked it as required. -# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply. -# In order to prevent this you need to add: -#lifecycle { -# ignore_changes = [ local_file_path ] -# } -import { - to = stackit_image.import-example - id = "${var.project_id},${var.region},${var.image_id}" -} ``` @@ -88,3 +76,23 @@ Read-Only: - `algorithm` (String) Algorithm for the checksum of the image data. - `digest` (String) Hexdigest of the checksum of the image data. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing image +# Must set a configuration value for the local_file_path attribute as the provider has marked it as required. +# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply. +# In order to prevent this you need to add: +#lifecycle { +# ignore_changes = [ local_file_path ] +# } +import { + to = stackit_image.import-example + id = "${var.project_id},${var.region},${var.image_id}" +} +``` diff --git a/docs/resources/key_pair.md b/docs/resources/key_pair.md index ff25a7b29..1be3fd7a8 100644 --- a/docs/resources/key_pair.md +++ b/docs/resources/key_pair.md @@ -61,12 +61,6 @@ resource "stackit_key_pair" "keypair" { name = "example-key-pair" public_key = chomp(file("path/to/id_rsa.pub")) } - -# Only use the import statement, if you want to import an existing key pair -import { - to = stackit_key_pair.import-example - id = var.keypair_name -} ``` @@ -85,3 +79,17 @@ import { - `fingerprint` (String) The fingerprint of the public SSH key. - `id` (String) Terraform's internal resource ID. It takes the value of the key pair "`name`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing key pair +import { + to = stackit_key_pair.import-example + id = var.keypair_name +} +``` diff --git a/docs/resources/loadbalancer.md b/docs/resources/loadbalancer.md index 3e5c8b688..63073b2cc 100644 --- a/docs/resources/loadbalancer.md +++ b/docs/resources/loadbalancer.md @@ -228,12 +228,6 @@ resource "stackit_network_interface" "nic" { security_group_ids = [stackit_security_group.target_sg.security_group_id] } # End of advanced example - -# Only use the import statement, if you want to import an existing loadbalancer -import { - to = stackit_loadbalancer.import-example - id = "${var.project_id},${var.region},${var.loadbalancer_name}" -} ``` @@ -390,3 +384,17 @@ Optional: - `credentials_ref` (String) Credentials reference for metrics. Not changeable after creation. - `push_url` (String) The ARGUS/Prometheus remote write Push URL to ship the metrics to. Not changeable after creation. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing loadbalancer +import { + to = stackit_loadbalancer.import-example + id = "${var.project_id},${var.region},${var.loadbalancer_name}" +} +``` diff --git a/docs/resources/loadbalancer_observability_credential.md b/docs/resources/loadbalancer_observability_credential.md index 3d00c6c3b..9836cc8fc 100644 --- a/docs/resources/loadbalancer_observability_credential.md +++ b/docs/resources/loadbalancer_observability_credential.md @@ -19,12 +19,6 @@ resource "stackit_loadbalancer_observability_credential" "example" { username = "example-user" password = "example-password" } - -# Only use the import statement, if you want to import an existing loadbalancer observability credential -import { - to = stackit_loadbalancer_observability_credential.import-example - id = "${var.project_id},${var.region},${var.credentials_ref}" -} ``` @@ -45,3 +39,17 @@ import { - `credentials_ref` (String) The credentials reference is used by the Load Balancer to define which credentials it will use. - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`","region","`credentials_ref`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing loadbalancer observability credential +import { + to = stackit_loadbalancer_observability_credential.import-example + id = "${var.project_id},${var.region},${var.credentials_ref}" +} +``` diff --git a/docs/resources/logme_credential.md b/docs/resources/logme_credential.md index 74a598c6f..c30a90053 100644 --- a/docs/resources/logme_credential.md +++ b/docs/resources/logme_credential.md @@ -17,12 +17,6 @@ resource "stackit_logme_credential" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing logme credential -import { - to = stackit_logme_credential.import-example - id = "${var.project_id},${var.logme_instance_id},${var.logme_credentials_id}" -} ``` @@ -42,3 +36,17 @@ import { - `port` (Number) - `uri` (String, Sensitive) - `username` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing logme credential +import { + to = stackit_logme_credential.import-example + id = "${var.project_id},${var.logme_instance_id},${var.logme_credentials_id}" +} +``` diff --git a/docs/resources/logme_instance.md b/docs/resources/logme_instance.md index 74b6f2145..698d07d66 100644 --- a/docs/resources/logme_instance.md +++ b/docs/resources/logme_instance.md @@ -22,12 +22,6 @@ resource "stackit_logme_instance" "example" { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } } - -# Only use the import statement, if you want to import an existing logme instance -import { - to = stackit_logme_instance.import-example - id = "${var.project_id},${var.logme_instance_id}" -} ``` @@ -82,3 +76,17 @@ Optional: - `opensearch_tls_protocols` (List of String) - `sgw_acl` (String) Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - `syslog` (List of String) List of syslog servers to send logs to. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing logme instance +import { + to = stackit_logme_instance.import-example + id = "${var.project_id},${var.logme_instance_id}" +} +``` diff --git a/docs/resources/logs_access_token.md b/docs/resources/logs_access_token.md index 9b1ade03c..63b394ca5 100644 --- a/docs/resources/logs_access_token.md +++ b/docs/resources/logs_access_token.md @@ -54,17 +54,6 @@ resource "stackit_logs_access_token" "accessToken_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing logs access token -# Note: The generated access token is only available upon creation. -# Since this attribute is not fetched from the API call, to prevent the conflicts, you need to add: -# lifecycle { -# ignore_changes = [ lifetime ] -# } -import { - to = stackit_logs_access_token.import-example - id = "${var.project_id},${var.region},${var.logs_instance_id},${var.logs_access_token_id}" -} ``` @@ -93,3 +82,22 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`instance_id`,`access_token_id`". - `status` (String) The status of the access token. Possible values are: `active`, `expired`. - `valid_until` (String) The date and time until an access token is valid to (inclusively) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing logs access token +# Note: The generated access token is only available upon creation. +# Since this attribute is not fetched from the API call, to prevent the conflicts, you need to add: +# lifecycle { +# ignore_changes = [ lifetime ] +# } +import { + to = stackit_logs_access_token.import-example + id = "${var.project_id},${var.region},${var.logs_instance_id},${var.logs_access_token_id}" +} +``` diff --git a/docs/resources/logs_instance.md b/docs/resources/logs_instance.md index bd2877203..165775d7c 100644 --- a/docs/resources/logs_instance.md +++ b/docs/resources/logs_instance.md @@ -30,12 +30,6 @@ resource "stackit_logs_instance" "logs2" { ] description = "Example description" } - -# Only use the import statement, if you want to import an existing logs instance -import { - to = stackit_logs_instance.import-example - id = "${var.project_id},${var.region},${var.logs_instance_id}" -} ``` @@ -64,3 +58,17 @@ import { - `query_range_url` (String) The Logs instance's query range URL - `query_url` (String) The Logs instance's query URL - `status` (String) The status of the Logs instance. Possible values are: `active`, `deleting`, `reconciling`. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing logs instance +import { + to = stackit_logs_instance.import-example + id = "${var.project_id},${var.region},${var.logs_instance_id}" +} +``` diff --git a/docs/resources/mariadb_credential.md b/docs/resources/mariadb_credential.md index ffc7c2741..417718bdb 100644 --- a/docs/resources/mariadb_credential.md +++ b/docs/resources/mariadb_credential.md @@ -30,12 +30,6 @@ resource "stackit_mariadb_credential" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing mariadb credential -import { - to = stackit_mariadb_credential.import-example - id = "${var.project_id},${var.mariadb_instance_id},${var.mariadb_credential_id}" -} ``` @@ -61,3 +55,17 @@ import { - `port` (Number) - `uri` (String, Sensitive) - `username` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing mariadb credential +import { + to = stackit_mariadb_credential.import-example + id = "${var.project_id},${var.mariadb_instance_id},${var.mariadb_credential_id}" +} +``` diff --git a/docs/resources/mariadb_instance.md b/docs/resources/mariadb_instance.md index 4814286bc..ddabdf615 100644 --- a/docs/resources/mariadb_instance.md +++ b/docs/resources/mariadb_instance.md @@ -22,12 +22,6 @@ resource "stackit_mariadb_instance" "example" { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } } - -# Only use the import statement, if you want to import an existing mariadb instance -import { - to = stackit_mariadb_instance.import-example - id = "${var.project_id},${var.mariadb_instance_id}" -} ``` @@ -68,3 +62,17 @@ Optional: - `monitoring_instance_id` (String) The ID of the STACKIT monitoring instance. Monitoring instances with the plan "Observability-Monitoring-Starter" are not supported. - `sgw_acl` (String) Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - `syslog` (List of String) List of syslog servers to send logs to. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing mariadb instance +import { + to = stackit_mariadb_instance.import-example + id = "${var.project_id},${var.mariadb_instance_id}" +} +``` diff --git a/docs/resources/mongodbflex_instance.md b/docs/resources/mongodbflex_instance.md index bc76a7966..258d4e096 100644 --- a/docs/resources/mongodbflex_instance.md +++ b/docs/resources/mongodbflex_instance.md @@ -34,12 +34,6 @@ resource "stackit_mongodbflex_instance" "example" { } backup_schedule = "0 0 * * *" } - -# Only use the import statement, if you want to import an existing mongodbflex instance -import { - to = stackit_mongodbflex_instance.import-example - id = "${var.project_id},${var.region},${var.instance_id}" -} ``` @@ -106,3 +100,17 @@ Required: stackit mongodbflex options --storages --flavor-id FLAVOR_ID ``` - `size` (Number) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing mongodbflex instance +import { + to = stackit_mongodbflex_instance.import-example + id = "${var.project_id},${var.region},${var.instance_id}" +} +``` diff --git a/docs/resources/mongodbflex_user.md b/docs/resources/mongodbflex_user.md index d37b3eb14..e831c3001 100644 --- a/docs/resources/mongodbflex_user.md +++ b/docs/resources/mongodbflex_user.md @@ -36,12 +36,6 @@ resource "stackit_mongodbflex_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing mongodbflex user -import { - to = stackit_mongodbflex_user.import-example - id = "${var.project_id},${var.region},${var.instance_id},${user_id}" -} ``` @@ -68,3 +62,17 @@ import { - `port` (Number) - `uri` (String, Sensitive) - `user_id` (String) User ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing mongodbflex user +import { + to = stackit_mongodbflex_user.import-example + id = "${var.project_id},${var.region},${var.instance_id},${user_id}" +} +``` diff --git a/docs/resources/network.md b/docs/resources/network.md index f48a2f5e6..a31c14ea7 100644 --- a/docs/resources/network.md +++ b/docs/resources/network.md @@ -44,14 +44,6 @@ resource "stackit_network" "example_non_routed_network" { } routed = false } - -# Only use the import statement, if you want to import an existing network -# Note: There will be a conflict which needs to be resolved manually. -# These attributes cannot be configured together: [ipv4_prefix,ipv4_prefix_length,ipv4_gateway] -import { - to = stackit_network.import-example - id = "${var.project_id},${var.region},${var.network_id}" -} ``` @@ -87,3 +79,19 @@ import { - `ipv6_prefixes` (List of String) The IPv6 prefixes of the network. - `network_id` (String) The network ID. - `public_ip` (String) The public IP of the network. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing network +# Note: There will be a conflict which needs to be resolved manually. +# These attributes cannot be configured together: [ipv4_prefix,ipv4_prefix_length,ipv4_gateway] +import { + to = stackit_network.import-example + id = "${var.project_id},${var.region},${var.network_id}" +} +``` diff --git a/docs/resources/network_area.md b/docs/resources/network_area.md index 5f7614354..be6f6eae1 100644 --- a/docs/resources/network_area.md +++ b/docs/resources/network_area.md @@ -24,12 +24,6 @@ resource "stackit_network_area" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing network area -import { - to = stackit_network_area.import-example - id = "${var.organization_id},${var.network_area_id}" -} ``` ## Migration of IaaS resources from versions <= v0.78.1 diff --git a/docs/resources/network_area_region.md b/docs/resources/network_area_region.md index c6eb57097..634ba8e24 100644 --- a/docs/resources/network_area_region.md +++ b/docs/resources/network_area_region.md @@ -28,12 +28,6 @@ resource "stackit_network_area_region" "example" { ] } } - -# Only use the import statement, if you want to import an existing network area region -import { - to = stackit_network_area_region.import-example - id = "${var.organization_id},${var.network_area_id},${var.region}" -} ``` @@ -78,3 +72,17 @@ Required: Read-Only: - `network_range_id` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing network area region +import { + to = stackit_network_area_region.import-example + id = "${var.organization_id},${var.network_area_id},${var.region}" +} +``` diff --git a/docs/resources/network_area_route.md b/docs/resources/network_area_route.md index e2bae1a63..a76739e6b 100644 --- a/docs/resources/network_area_route.md +++ b/docs/resources/network_area_route.md @@ -32,12 +32,6 @@ resource "stackit_network_area_route" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing network area route -import { - to = stackit_network_area_route.import-example - id = "${var.organization_id},${var.network_area_id},${var.region},${var.network_area_route_id}" -} ``` ## Migration of IaaS resources from versions <= v0.74.0 diff --git a/docs/resources/network_interface.md b/docs/resources/network_interface.md index 6c7156a59..a5f6d270e 100644 --- a/docs/resources/network_interface.md +++ b/docs/resources/network_interface.md @@ -19,12 +19,6 @@ resource "stackit_network_interface" "example" { allowed_addresses = ["192.168.0.0/24"] security_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] } - -# Only use the import statement, if you want to import an existing network interface -import { - to = stackit_network_interface.import-example - id = "${var.project_id},${var.region},${var.network_id},${var.network_interface_id}" -} ``` @@ -52,3 +46,17 @@ import { - `mac` (String) The MAC address of network interface. - `network_interface_id` (String) The network interface ID. - `type` (String) Type of network interface. Some of the possible values are: Possible values are: `server`, `metadata`, `gateway`. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing network interface +import { + to = stackit_network_interface.import-example + id = "${var.project_id},${var.region},${var.network_id},${var.network_interface_id}" +} +``` diff --git a/docs/resources/objectstorage_bucket.md b/docs/resources/objectstorage_bucket.md index 8eb4c6fa9..d33b52065 100644 --- a/docs/resources/objectstorage_bucket.md +++ b/docs/resources/objectstorage_bucket.md @@ -32,13 +32,6 @@ resource "stackit_objectstorage_bucket" "example_with_lock" { name = "example-bucket-with-lock" object_lock = true } - - -# Only use the import statement, if you want to import an existing objectstorage bucket -import { - to = stackit_objectstorage_bucket.import-example - id = "${var.project_id},${var.region},${var.bucket_name}" -} ``` @@ -59,3 +52,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`name`". - `url_path_style` (String) - `url_virtual_hosted_style` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing objectstorage bucket +import { + to = stackit_objectstorage_bucket.import-example + id = "${var.project_id},${var.region},${var.bucket_name}" +} +``` diff --git a/docs/resources/objectstorage_credential.md b/docs/resources/objectstorage_credential.md index c5a47d098..2123d2725 100644 --- a/docs/resources/objectstorage_credential.md +++ b/docs/resources/objectstorage_credential.md @@ -32,12 +32,6 @@ resource "stackit_objectstorage_credential" "rotate_example" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing objectstorage credential -import { - to = stackit_objectstorage_credential.import-example - id = "${var.project_id},${var.region},${var.bucket_credentials_group_id},${var.bucket_credential_id}" -} ``` @@ -61,3 +55,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`credentials_group_id`,`credential_id`". - `name` (String) - `secret_access_key` (String, Sensitive) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing objectstorage credential +import { + to = stackit_objectstorage_credential.import-example + id = "${var.project_id},${var.region},${var.bucket_credentials_group_id},${var.bucket_credential_id}" +} +``` diff --git a/docs/resources/objectstorage_credentials_group.md b/docs/resources/objectstorage_credentials_group.md index 9115a0c75..a4c90d8b4 100644 --- a/docs/resources/objectstorage_credentials_group.md +++ b/docs/resources/objectstorage_credentials_group.md @@ -17,12 +17,6 @@ resource "stackit_objectstorage_credentials_group" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-credentials-group" } - -# Only use the import statement, if you want to import an existing objectstorage credential group -import { - to = stackit_objectstorage_credentials_group.import-example - id = "${var.project_id},${var.region},${var.bucket_credentials_group_id}" -} ``` @@ -42,3 +36,17 @@ import { - `credentials_group_id` (String) The credentials group ID - `id` (String) Terraform's internal data source identifier. It is structured as "`project_id`,`region`,`credentials_group_id`". - `urn` (String) Credentials group uniform resource name (URN) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing objectstorage credential group +import { + to = stackit_objectstorage_credentials_group.import-example + id = "${var.project_id},${var.region},${var.bucket_credentials_group_id}" +} +``` diff --git a/docs/resources/observability_alertgroup.md b/docs/resources/observability_alertgroup.md index 771e9a026..ef02a688c 100644 --- a/docs/resources/observability_alertgroup.md +++ b/docs/resources/observability_alertgroup.md @@ -40,12 +40,6 @@ resource "stackit_observability_alertgroup" "example" { }, ] } - -# Only use the import statement, if you want to import an existing observability alertgroup -import { - to = stackit_observability_alertgroup.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_alertgroup_name}" -} ``` @@ -80,3 +74,17 @@ Optional: - `for` (String) Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s - `labels` (Map of String) A map of key:value. Labels to add or overwrite for each alert - `record` (String) The name of the metric. It's the identifier and must be unique in the group. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing observability alertgroup +import { + to = stackit_observability_alertgroup.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_alertgroup_name}" +} +``` diff --git a/docs/resources/observability_instance.md b/docs/resources/observability_instance.md index c0d99224a..52cc09301 100644 --- a/docs/resources/observability_instance.md +++ b/docs/resources/observability_instance.md @@ -24,12 +24,6 @@ resource "stackit_observability_instance" "example" { metrics_retention_days_5m_downsampling = 90 metrics_retention_days_1h_downsampling = 90 } - -# Only use the import statement, if you want to import an existing observability instance -import { - to = stackit_observability_instance.import-example - id = "${var.project_id},${var.observability_instance_id}" -} ``` @@ -193,3 +187,17 @@ Optional: - `smtp_auth_username` (String) SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server. - `smtp_from` (String) The default SMTP From header field. Must be a valid email address - `smtp_smart_host` (String) The default SMTP smarthost used for sending emails, including port number in format `host:port` (eg. `smtp.example.com:587`). Port number usually is 25, or 587 for SMTP over TLS (sometimes referred to as STARTTLS). + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing observability instance +import { + to = stackit_observability_instance.import-example + id = "${var.project_id},${var.observability_instance_id}" +} +``` diff --git a/docs/resources/observability_logalertgroup.md b/docs/resources/observability_logalertgroup.md index 5b38cf66e..3c5b22a18 100644 --- a/docs/resources/observability_logalertgroup.md +++ b/docs/resources/observability_logalertgroup.md @@ -45,12 +45,6 @@ resource "stackit_observability_logalertgroup" "example" { }, ] } - -# Only use the import statement, if you want to import an existing observability logalertgroup -import { - to = stackit_observability_logalertgroup.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_logalertgroup_name}" -} ``` @@ -84,3 +78,17 @@ Optional: - `annotations` (Map of String) A map of key:value. Annotations to add or overwrite for each alert - `for` (String) Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s - `labels` (Map of String) A map of key:value. Labels to add or overwrite for each alert + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing observability logalertgroup +import { + to = stackit_observability_logalertgroup.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_logalertgroup_name}" +} +``` diff --git a/docs/resources/observability_scrapeconfig.md b/docs/resources/observability_scrapeconfig.md index 9840a2e45..f909d2403 100644 --- a/docs/resources/observability_scrapeconfig.md +++ b/docs/resources/observability_scrapeconfig.md @@ -30,12 +30,6 @@ resource "stackit_observability_scrapeconfig" "example" { } ] } - -# Only use the import statement, if you want to import an existing observability scrapeconfig -import { - to = stackit_observability_scrapeconfig.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_scrapeconfig_name}" -} ``` @@ -89,3 +83,17 @@ Required: Optional: - `enable_url_parameters` (Boolean) Specifies if URL parameters are enabled. Defaults to `true` + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing observability scrapeconfig +import { + to = stackit_observability_scrapeconfig.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_scrapeconfig_name}" +} +``` diff --git a/docs/resources/opensearch_credential.md b/docs/resources/opensearch_credential.md index 34506cfa7..439f1b0ce 100644 --- a/docs/resources/opensearch_credential.md +++ b/docs/resources/opensearch_credential.md @@ -30,12 +30,6 @@ resource "stackit_opensearch_credential" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing opensearch credential -import { - to = stackit_opensearch_credential.import-example - id = "${var.project_id},${var.instance_id},${var.credential_id}" -} ``` @@ -61,3 +55,17 @@ import { - `scheme` (String) - `uri` (String, Sensitive) - `username` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing opensearch credential +import { + to = stackit_opensearch_credential.import-example + id = "${var.project_id},${var.instance_id},${var.credential_id}" +} +``` diff --git a/docs/resources/opensearch_instance.md b/docs/resources/opensearch_instance.md index 5ca0a8b84..3801ccab8 100644 --- a/docs/resources/opensearch_instance.md +++ b/docs/resources/opensearch_instance.md @@ -22,12 +22,6 @@ resource "stackit_opensearch_instance" "example" { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } } - -# Only use the import statement, if you want to import an existing opensearch instance -import { - to = stackit_opensearch_instance.import-example - id = "${var.project_id},${var.instance_id}" -} ``` @@ -74,3 +68,17 @@ Optional: - `syslog` (List of String) List of syslog servers to send logs to. - `tls_ciphers` (List of String) List of TLS ciphers to use. - `tls_protocols` (List of String) The TLS protocol to use. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing opensearch instance +import { + to = stackit_opensearch_instance.import-example + id = "${var.project_id},${var.instance_id}" +} +``` diff --git a/docs/resources/postgresflex_database.md b/docs/resources/postgresflex_database.md index b9363141d..86c163d54 100644 --- a/docs/resources/postgresflex_database.md +++ b/docs/resources/postgresflex_database.md @@ -19,12 +19,6 @@ resource "stackit_postgresflex_database" "example" { name = "mydb" owner = "myusername" } - -# Only use the import statement, if you want to import an existing postgresflex database -import { - to = stackit_postgresflex_database.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.postgres_database_id}" -} ``` @@ -45,3 +39,17 @@ import { - `database_id` (String) Database ID. - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`instance_id`,`database_id`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing postgresflex database +import { + to = stackit_postgresflex_database.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.postgres_database_id}" +} +``` diff --git a/docs/resources/postgresflex_instance.md b/docs/resources/postgresflex_instance.md index b796ad5e8..081a1cd2f 100644 --- a/docs/resources/postgresflex_instance.md +++ b/docs/resources/postgresflex_instance.md @@ -29,12 +29,6 @@ resource "stackit_postgresflex_instance" "example" { } version = 14 } - -# Only use the import statement, if you want to import an existing postgresflex instance -import { - to = stackit_postgresflex_instance.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id}" -} ``` @@ -84,3 +78,17 @@ Required: stackit postgresflex options --storages --flavor-id FLAVOR_ID ``` - `size` (Number) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing postgresflex instance +import { + to = stackit_postgresflex_instance.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id}" +} +``` diff --git a/docs/resources/postgresflex_user.md b/docs/resources/postgresflex_user.md index 9489ffb75..3f5cdfc65 100644 --- a/docs/resources/postgresflex_user.md +++ b/docs/resources/postgresflex_user.md @@ -34,12 +34,6 @@ resource "stackit_postgresflex_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing postgresflex user -import { - to = stackit_postgresflex_user.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}" -} ``` @@ -65,3 +59,17 @@ import { - `port` (Number) - `uri` (String, Sensitive) - `user_id` (String) User ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing postgresflex user +import { + to = stackit_postgresflex_user.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}" +} +``` diff --git a/docs/resources/public_ip.md b/docs/resources/public_ip.md index f95b9314f..e473ae07a 100644 --- a/docs/resources/public_ip.md +++ b/docs/resources/public_ip.md @@ -20,12 +20,6 @@ resource "stackit_public_ip" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing public ip -import { - to = stackit_public_ip.import-example - id = "${var.project_id},${var.region},${var.public_ip_id}" -} ``` @@ -46,3 +40,17 @@ import { - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`public_ip_id`". - `ip` (String) The IP address. - `public_ip_id` (String) The public IP ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing public ip +import { + to = stackit_public_ip.import-example + id = "${var.project_id},${var.region},${var.public_ip_id}" +} +``` diff --git a/docs/resources/public_ip_associate.md b/docs/resources/public_ip_associate.md index fd76fc369..8f55d1a37 100644 --- a/docs/resources/public_ip_associate.md +++ b/docs/resources/public_ip_associate.md @@ -23,12 +23,6 @@ resource "stackit_public_ip_associate" "example" { public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing public ip associate -import { - to = stackit_public_ip_associate.import-example - id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}" -} ``` @@ -48,3 +42,17 @@ import { - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`public_ip_id`,`network_interface_id`". - `ip` (String) The IP address. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing public ip associate +import { + to = stackit_public_ip_associate.import-example + id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}" +} +``` diff --git a/docs/resources/rabbitmq_credential.md b/docs/resources/rabbitmq_credential.md index e2aeda9bb..af031b930 100644 --- a/docs/resources/rabbitmq_credential.md +++ b/docs/resources/rabbitmq_credential.md @@ -30,12 +30,6 @@ resource "stackit_rabbitmq_credential" "example" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing rabbitmq credential -import { - to = stackit_rabbitmq_credential.import-example - id = "${var.project_id},${var.rabbitmq_instance_id},${var.rabbitmq_credential_id}" -} ``` @@ -65,3 +59,17 @@ import { - `uri` (String, Sensitive) - `uris` (List of String) - `username` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing rabbitmq credential +import { + to = stackit_rabbitmq_credential.import-example + id = "${var.project_id},${var.rabbitmq_instance_id},${var.rabbitmq_credential_id}" +} +``` diff --git a/docs/resources/rabbitmq_instance.md b/docs/resources/rabbitmq_instance.md index 829256422..1c10d82aa 100644 --- a/docs/resources/rabbitmq_instance.md +++ b/docs/resources/rabbitmq_instance.md @@ -25,12 +25,6 @@ resource "stackit_rabbitmq_instance" "example" { plugins = ["rabbitmq_consistent_hash_exchange", "rabbitmq_federation", "rabbitmq_tracing"] } } - -# Only use the import statement, if you want to import an existing rabbitmq instance -import { - to = stackit_rabbitmq_instance.import-example - id = "${var.project_id},${var.rabbitmq_instance_id}" -} ``` @@ -77,3 +71,17 @@ Optional: - `syslog` (List of String) List of syslog servers to send logs to. - `tls_ciphers` (List of String) List of TLS ciphers to use. - `tls_protocols` (List of String) TLS protocol versions to use. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing rabbitmq instance +import { + to = stackit_rabbitmq_instance.import-example + id = "${var.project_id},${var.rabbitmq_instance_id}" +} +``` diff --git a/docs/resources/redis_credential.md b/docs/resources/redis_credential.md index 2c289812b..ffdcc171c 100644 --- a/docs/resources/redis_credential.md +++ b/docs/resources/redis_credential.md @@ -30,12 +30,6 @@ resource "stackit_redis_credential" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing redis credential -import { - to = stackit_redis_credential.import-example - id = "${var.project_id},${var.redis_instance_id},${var.redis_credential_id}" -} ``` @@ -61,3 +55,17 @@ import { - `port` (Number) - `uri` (String, Sensitive) Connection URI. - `username` (String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing redis credential +import { + to = stackit_redis_credential.import-example + id = "${var.project_id},${var.redis_instance_id},${var.redis_credential_id}" +} +``` diff --git a/docs/resources/redis_instance.md b/docs/resources/redis_instance.md index 40f63b813..4603796cf 100644 --- a/docs/resources/redis_instance.md +++ b/docs/resources/redis_instance.md @@ -25,12 +25,6 @@ resource "stackit_redis_instance" "example" { syslog = ["logs4.your-syslog-endpoint.com:54321"] } } - -# Only use the import statement, if you want to import an existing redis instance -import { - to = stackit_redis_instance.import-example - id = "${var.project_id},${var.redis_instance_id}" -} ``` @@ -85,3 +79,17 @@ Optional: - `tls_ciphers` (List of String) List of TLS ciphers to use. - `tls_ciphersuites` (String) TLS cipher suites to use. - `tls_protocols` (String) TLS protocol to use. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing redis instance +import { + to = stackit_redis_instance.import-example + id = "${var.project_id},${var.redis_instance_id}" +} +``` diff --git a/docs/resources/resourcemanager_folder.md b/docs/resources/resourcemanager_folder.md index 2a99f8a08..543f2a8e0 100644 --- a/docs/resources/resourcemanager_folder.md +++ b/docs/resources/resourcemanager_folder.md @@ -29,14 +29,6 @@ resource "stackit_resourcemanager_project" "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 -} ``` @@ -59,3 +51,19 @@ import { - `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. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# 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 +} +``` diff --git a/docs/resources/resourcemanager_project.md b/docs/resources/resourcemanager_project.md index 382cc2f78..ed3f1628f 100644 --- a/docs/resources/resourcemanager_project.md +++ b/docs/resources/resourcemanager_project.md @@ -25,14 +25,6 @@ resource "stackit_resourcemanager_project" "example" { } owner_email = "john.doe@stackit.cloud" } - -# Only use the import statement, if you want to import an existing resourcemanager project -# 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_project.import-example - id = var.container_id -} ``` @@ -56,3 +48,19 @@ To create a project within a STACKIT Network Area, setting the label `networkAre - `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. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing resourcemanager project +# 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_project.import-example + id = var.container_id +} +``` diff --git a/docs/resources/routing_table.md b/docs/resources/routing_table.md index 5149eb549..bac9d6f0f 100644 --- a/docs/resources/routing_table.md +++ b/docs/resources/routing_table.md @@ -27,12 +27,6 @@ resource "stackit_routing_table" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing routing table -import { - to = stackit_routing_table.import-example - id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id}" -} ``` @@ -58,3 +52,17 @@ import { - `id` (String) Terraform's internal resource ID. It is structured as "`organization_id`,`region`,`network_area_id`,`routing_table_id`". - `routing_table_id` (String) The routing tables ID. - `updated_at` (String) Date-time when the routing table was updated + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing routing table +import { + to = stackit_routing_table.import-example + id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id}" +} +``` diff --git a/docs/resources/routing_table_route.md b/docs/resources/routing_table_route.md index 797a10f4b..738369f1d 100644 --- a/docs/resources/routing_table_route.md +++ b/docs/resources/routing_table_route.md @@ -35,12 +35,6 @@ resource "stackit_routing_table_route" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing routing table route -import { - to = stackit_routing_table_route.import-example - id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id},${var.routing_table_route_id}" -} ``` @@ -85,3 +79,17 @@ Required: Optional: - `value` (String) Either IPv4 or IPv6 (not set for blackhole and internet). Only IPv4 supported during experimental stage. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing routing table route +import { + to = stackit_routing_table_route.import-example + id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id},${var.routing_table_route_id}" +} +``` diff --git a/docs/resources/scf_organization.md b/docs/resources/scf_organization.md index 28c2d3a19..b15bcbb55 100644 --- a/docs/resources/scf_organization.md +++ b/docs/resources/scf_organization.md @@ -25,12 +25,6 @@ resource "stackit_scf_organization" "example" { quota_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" suspended = false } - -# Only use the import statement, if you want to import an existing scf organization -import { - to = stackit_scf_organization.import-example - id = "${var.project_id},${var.region},${var.org_id}" -} ``` @@ -55,3 +49,17 @@ import { - `org_id` (String) The ID of the Cloud Foundry Organization - `status` (String) The status of the organization (e.g., deleting, delete_failed) - `updated_at` (String) The time when the organization was last updated + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing scf organization +import { + to = stackit_scf_organization.import-example + id = "${var.project_id},${var.region},${var.org_id}" +} +``` diff --git a/docs/resources/scf_organization_manager.md b/docs/resources/scf_organization_manager.md index 3ed0b008f..33e47a160 100644 --- a/docs/resources/scf_organization_manager.md +++ b/docs/resources/scf_organization_manager.md @@ -17,13 +17,6 @@ resource "stackit_scf_organization_manager" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" org_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing scf org user -# The password field is still null after import and must be entered manually in the state. -import { - to = stackit_scf_organization_manager.import-example - id = "${var.project_id},${var.region},${var.org_id},${var.user_id}" -} ``` @@ -47,3 +40,18 @@ import { - `updated_at` (String) The time when the organization manager was last updated - `user_id` (String) The ID of the organization manager user - `username` (String) An auto-generated organization manager user name + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing scf org user +# The password field is still null after import and must be entered manually in the state. +import { + to = stackit_scf_organization_manager.import-example + id = "${var.project_id},${var.region},${var.org_id},${var.user_id}" +} +``` diff --git a/docs/resources/secretsmanager_instance.md b/docs/resources/secretsmanager_instance.md index 0c5b67db0..0b8ad2aa6 100644 --- a/docs/resources/secretsmanager_instance.md +++ b/docs/resources/secretsmanager_instance.md @@ -18,12 +18,6 @@ resource "stackit_secretsmanager_instance" "example" { name = "example-instance" acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] } - -# Only use the import statement, if you want to import an existing secretsmanager instance -import { - to = stackit_secretsmanager_instance.import-example - id = "${var.project_id},${var.secret_instance_id}" -} ``` @@ -53,3 +47,17 @@ Required: - `key_ring_id` (String) UUID of the keyring where the key is located within the STACKTI-KMS. - `key_version` (Number) Version of the key within the STACKIT-KMS to use for the encryption. - `service_account_email` (String) Service-Account linked to the Key within the STACKIT-KMS. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing secretsmanager instance +import { + to = stackit_secretsmanager_instance.import-example + id = "${var.project_id},${var.secret_instance_id}" +} +``` diff --git a/docs/resources/secretsmanager_user.md b/docs/resources/secretsmanager_user.md index fec4d79c5..5eeae72ba 100644 --- a/docs/resources/secretsmanager_user.md +++ b/docs/resources/secretsmanager_user.md @@ -34,12 +34,6 @@ resource "stackit_secretsmanager_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing secretsmanager user -import { - to = stackit_secretsmanager_user.import-example - id = "${var.project_id},${var.secret_instance_id},${var.secret_user_id}" -} ``` @@ -62,3 +56,17 @@ import { - `password` (String, Sensitive) An auto-generated password. - `user_id` (String) The user's ID. - `username` (String) An auto-generated user name. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing secretsmanager user +import { + to = stackit_secretsmanager_user.import-example + id = "${var.project_id},${var.secret_instance_id},${var.secret_user_id}" +} +``` diff --git a/docs/resources/security_group.md b/docs/resources/security_group.md index 727a7c0fa..30df0c6d5 100644 --- a/docs/resources/security_group.md +++ b/docs/resources/security_group.md @@ -20,12 +20,6 @@ resource "stackit_security_group" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing security group -import { - to = stackit_security_group.import-example - id = "${var.project_id},${var.region},${var.security_group_id}" -} ``` @@ -47,3 +41,17 @@ import { - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`security_group_id`". - `security_group_id` (String) The security group ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing security group +import { + to = stackit_security_group.import-example + id = "${var.project_id},${var.region},${var.security_group_id}" +} +``` diff --git a/docs/resources/security_group_rule.md b/docs/resources/security_group_rule.md index d3a004474..f17200918 100644 --- a/docs/resources/security_group_rule.md +++ b/docs/resources/security_group_rule.md @@ -25,14 +25,6 @@ resource "stackit_security_group_rule" "example" { name = "icmp" } } - -# Only use the import statement, if you want to import an existing security group rule -# Note: There will be a conflict which needs to be resolved manually. -# Attribute "protocol.number" cannot be specified when "protocol.name" is specified. -import { - to = stackit_security_group_rule.import-example - id = "${var.project_id},${var.region},${var.security_group_id},${var.security_group_rule_id}" -} ``` @@ -85,3 +77,19 @@ Optional: - `name` (String) The protocol name which the rule should match. Either `name` or `number` must be provided. Possible values are: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. - `number` (Number) The protocol number which the rule should match. Either `name` or `number` must be provided. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing security group rule +# Note: There will be a conflict which needs to be resolved manually. +# Attribute "protocol.number" cannot be specified when "protocol.name" is specified. +import { + to = stackit_security_group_rule.import-example + id = "${var.project_id},${var.region},${var.security_group_id},${var.security_group_rule_id}" +} +``` diff --git a/docs/resources/server.md b/docs/resources/server.md index 8137ab175..80b679478 100644 --- a/docs/resources/server.md +++ b/docs/resources/server.md @@ -377,19 +377,6 @@ resource "stackit_server" "example" { stackit_network_interface.example.network_interface_id ] } - -# Only use the import statement, if you want to import an existing server -# Note: There will be a conflict which needs to be resolved manually. -# Must set a configuration value for the boot_volume.source_type and boot_volume.source_id attribute as the provider has marked it as required. -# Since those attributes are not fetched in general from the API call, after adding them this would replace your server resource after an terraform apply. -# In order to prevent this you need to add: -# lifecycle { -# ignore_changes = [ boot_volume ] -# } -import { - to = stackit_server.import-example - id = "${var.project_id},${var.region},${var.server_id}" -} ``` @@ -452,3 +439,24 @@ Optional: Read-Only: - `id` (String) The ID of the boot volume + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server +# Note: There will be a conflict which needs to be resolved manually. +# Must set a configuration value for the boot_volume.source_type and boot_volume.source_id attribute as the provider has marked it as required. +# Since those attributes are not fetched in general from the API call, after adding them this would replace your server resource after an terraform apply. +# In order to prevent this you need to add: +# lifecycle { +# ignore_changes = [ boot_volume ] +# } +import { + to = stackit_server.import-example + id = "${var.project_id},${var.region},${var.server_id}" +} +``` diff --git a/docs/resources/server_backup_schedule.md b/docs/resources/server_backup_schedule.md index d3f56214c..eab6aef48 100644 --- a/docs/resources/server_backup_schedule.md +++ b/docs/resources/server_backup_schedule.md @@ -33,12 +33,6 @@ resource "stackit_server_backup_enable" "enable" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing server backup schedule -import { - to = stackit_server_backup_schedule.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.server_backup_schedule_id}" -} ``` @@ -73,3 +67,17 @@ Required: Optional: - `volume_ids` (List of String) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server backup schedule +import { + to = stackit_server_backup_schedule.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.server_backup_schedule_id}" +} +``` diff --git a/docs/resources/server_network_interface_attach.md b/docs/resources/server_network_interface_attach.md index eab7c8c96..2960c7310 100644 --- a/docs/resources/server_network_interface_attach.md +++ b/docs/resources/server_network_interface_attach.md @@ -18,12 +18,6 @@ resource "stackit_server_network_interface_attach" "attached_network_interface" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing server network interface attachment -import { - to = stackit_server_network_interface_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.network_interface_id}" -} ``` @@ -42,3 +36,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`server_id`,`network_interface_id`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server network interface attachment +import { + to = stackit_server_network_interface_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.network_interface_id}" +} +``` diff --git a/docs/resources/server_service_account_attach.md b/docs/resources/server_service_account_attach.md index 215c6f5f2..810e77086 100644 --- a/docs/resources/server_service_account_attach.md +++ b/docs/resources/server_service_account_attach.md @@ -18,12 +18,6 @@ resource "stackit_server_service_account_attach" "attached_service_account" { server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" service_account_email = "service-account@stackit.cloud" } - -# Only use the import statement, if you want to import an existing server service account attachment -import { - to = stackit_server_service_account_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.service_account_email}" -} ``` @@ -42,3 +36,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`server_id`,`service_account_email`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server service account attachment +import { + to = stackit_server_service_account_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.service_account_email}" +} +``` diff --git a/docs/resources/server_update_schedule.md b/docs/resources/server_update_schedule.md index 66e867b06..64b5d3cdc 100644 --- a/docs/resources/server_update_schedule.md +++ b/docs/resources/server_update_schedule.md @@ -29,12 +29,6 @@ resource "stackit_server_update_enable" "enable" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing server update schedule -import { - to = stackit_server_update_schedule.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.server_update_schedule_id}" -} ``` @@ -57,3 +51,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`server_id`,`update_schedule_id`". - `update_schedule_id` (Number) Update schedule ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server update schedule +import { + to = stackit_server_update_schedule.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.server_update_schedule_id}" +} +``` diff --git a/docs/resources/server_volume_attach.md b/docs/resources/server_volume_attach.md index 61710ce45..25d5e2818 100644 --- a/docs/resources/server_volume_attach.md +++ b/docs/resources/server_volume_attach.md @@ -18,12 +18,6 @@ resource "stackit_server_volume_attach" "attached_volume" { server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing server volume attachment -import { - to = stackit_server_volume_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}" -} ``` @@ -42,3 +36,17 @@ import { ### Read-Only - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`server_id`,`volume_id`". + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing server volume attachment +import { + to = stackit_server_volume_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}" +} +``` diff --git a/docs/resources/service_account.md b/docs/resources/service_account.md index 219a99ecc..39ea9b7ad 100644 --- a/docs/resources/service_account.md +++ b/docs/resources/service_account.md @@ -17,12 +17,6 @@ resource "stackit_service_account" "sa" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "sa01" } - -# Only use the import statement, if you want to import an existing service account -import { - to = stackit_service_account.import-example - id = "${var.project_id},${var.service_account_email}" -} ``` @@ -38,3 +32,17 @@ import { - `email` (String) Email of the service account. - `id` (String) Terraform's internal resource ID, structured as "`project_id`,`email`". - `service_account_id` (String) The internal UUID of the service account. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing service account +import { + to = stackit_service_account.import-example + id = "${var.project_id},${var.service_account_email}" +} +``` diff --git a/docs/resources/service_account_federated_identity_provider.md b/docs/resources/service_account_federated_identity_provider.md index 9942d82f1..b157feefe 100644 --- a/docs/resources/service_account_federated_identity_provider.md +++ b/docs/resources/service_account_federated_identity_provider.md @@ -95,12 +95,6 @@ resource "stackit_service_account_federated_identity_provider" "provider" { } ] } - -# Only use the import statement, if you want to import an existing federated identity provider -import { - to = stackit_service_account_federated_identity_provider.import-example - id = "${var.project_id},${var.service_account_email},${var.federation_id}" -} ``` @@ -127,3 +121,17 @@ Required: - `item` (String) The assertion claim. At least one assertion with the claim "aud" is required for security reasons. - `operator` (String) The assertion operator. Currently, the only supported operator is "equals". - `value` (String) The assertion value. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing federated identity provider +import { + to = stackit_service_account_federated_identity_provider.import-example + id = "${var.project_id},${var.service_account_email},${var.federation_id}" +} +``` diff --git a/docs/resources/sfs_export_policy.md b/docs/resources/sfs_export_policy.md index 5fea32694..39396c705 100644 --- a/docs/resources/sfs_export_policy.md +++ b/docs/resources/sfs_export_policy.md @@ -29,12 +29,6 @@ resource "stackit_sfs_export_policy" "example" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing export policy -import { - to = stackit_sfs_export_policy.example - id = "${var.project_id},${var.region},${var.policy_id}" -} ``` @@ -70,3 +64,17 @@ Optional: - `read_only` (Boolean) Flag to indicate if client IPs matching this rule can only mount the share in read only mode - `set_uuid` (Boolean) Flag to honor set UUID - `super_user` (Boolean) Flag to indicate if client IPs matching this rule have root access on the Share + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing export policy +import { + to = stackit_sfs_export_policy.example + id = "${var.project_id},${var.region},${var.policy_id}" +} +``` diff --git a/docs/resources/sfs_project_lock.md b/docs/resources/sfs_project_lock.md index c12e33765..09833ec87 100644 --- a/docs/resources/sfs_project_lock.md +++ b/docs/resources/sfs_project_lock.md @@ -16,12 +16,6 @@ SFS project lock resource schema. Must have a `region` specified in the provider resource "stackit_sfs_project_lock" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing project lock -import { - to = stackit_sfs_project_lock.example - id = "${var.project_id},${var.region}" -} ``` @@ -39,3 +33,17 @@ import { - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`". - `lock_id` (String) ID of the lock. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing project lock +import { + to = stackit_sfs_project_lock.example + id = "${var.project_id},${var.region}" +} +``` diff --git a/docs/resources/sfs_resource_pool.md b/docs/resources/sfs_resource_pool.md index 4a7e103fd..60368822f 100644 --- a/docs/resources/sfs_resource_pool.md +++ b/docs/resources/sfs_resource_pool.md @@ -31,12 +31,6 @@ resource "stackit_sfs_resource_pool" "resourcepool" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing resource pool -import { - to = stackit_sfs_resource_pool.resourcepool - id = "${var.project_id},${var.region},${var.resource_pool_id}" -} ``` @@ -73,3 +67,17 @@ Required: Read-Only: - `name` (String) Name of the snapshot policy. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing resource pool +import { + to = stackit_sfs_resource_pool.resourcepool + id = "${var.project_id},${var.region},${var.resource_pool_id}" +} +``` diff --git a/docs/resources/sfs_share.md b/docs/resources/sfs_share.md index dd70dee06..d67ffacbc 100644 --- a/docs/resources/sfs_share.md +++ b/docs/resources/sfs_share.md @@ -26,12 +26,6 @@ resource "stackit_sfs_share" "example" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing sfs share -import { - to = stackit_sfs_resource_pool.resourcepool - id = "${var.project_id},${var.region},${var.resource_pool_id},${var.share_id}" -} ``` @@ -60,3 +54,17 @@ You can also assign a Share Export Policy after creating the Share - `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`region`,`resource_pool_id`,`share_id`". - `mount_path` (String) Mount path of the Share, used to mount the Share - `share_id` (String) share ID + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing sfs share +import { + to = stackit_sfs_resource_pool.resourcepool + id = "${var.project_id},${var.region},${var.resource_pool_id},${var.share_id}" +} +``` diff --git a/docs/resources/ske_cluster.md b/docs/resources/ske_cluster.md index 5850f36bc..2d2e0a9d7 100644 --- a/docs/resources/ske_cluster.md +++ b/docs/resources/ske_cluster.md @@ -45,12 +45,6 @@ resource "stackit_ske_cluster" "example" { } } } - -# Only use the import statement, if you want to import an existing ske cluster -import { - to = stackit_ske_cluster.import-example - id = "${var.project_id},${var.region},${var.ske_name}" -} ``` @@ -234,3 +228,17 @@ Optional: Optional: - `access_scope` (String) Access scope of the control plane. It defines if the Kubernetes control plane is public or only available inside a STACKIT Network Area.Possible values are: `PUBLIC`, `SNA`. The field is immutable! + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing ske cluster +import { + to = stackit_ske_cluster.import-example + id = "${var.project_id},${var.region},${var.ske_name}" +} +``` diff --git a/docs/resources/sqlserverflex_instance.md b/docs/resources/sqlserverflex_instance.md index e93da6f09..471868583 100644 --- a/docs/resources/sqlserverflex_instance.md +++ b/docs/resources/sqlserverflex_instance.md @@ -28,12 +28,6 @@ resource "stackit_sqlserverflex_instance" "example" { } version = 2022 } - -# Only use the import statement, if you want to import an existing sqlserverflex instance -import { - to = stackit_sqlserverflex_instance.import-example - id = "${var.project_id},${var.region},${var.sql_instance_id}" -} ``` @@ -96,3 +90,17 @@ Optional: stackit beta sqlserverflex options --storages --flavor-id FLAVOR_ID ``` - `size` (Number) + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing sqlserverflex instance +import { + to = stackit_sqlserverflex_instance.import-example + id = "${var.project_id},${var.region},${var.sql_instance_id}" +} +``` diff --git a/docs/resources/sqlserverflex_user.md b/docs/resources/sqlserverflex_user.md index 292f5f111..acbbdaab4 100644 --- a/docs/resources/sqlserverflex_user.md +++ b/docs/resources/sqlserverflex_user.md @@ -34,12 +34,6 @@ resource "stackit_sqlserverflex_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing sqlserverflex user -import { - to = stackit_sqlserverflex_user.import-example - id = "${var.project_id},${var.region},${var.sql_instance_id},${var.sql_user_id}" -} ``` @@ -64,3 +58,17 @@ import { - `password` (String, Sensitive) Password of the user account. - `port` (Number) - `user_id` (String) User ID. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing sqlserverflex user +import { + to = stackit_sqlserverflex_user.import-example + id = "${var.project_id},${var.region},${var.sql_instance_id},${var.sql_user_id}" +} +``` diff --git a/docs/resources/telemetrylink.md b/docs/resources/telemetrylink.md index 0557d9c71..4be492195 100644 --- a/docs/resources/telemetrylink.md +++ b/docs/resources/telemetrylink.md @@ -31,12 +31,6 @@ resource "stackit_telemetrylink" "link2" { access_token = "eyJxxx" telemetry_router_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing TelemetryLink -import { - to = stackit_telemetrylink.import-example - id = "${var.resource_type},${var.resource_id},${var.region}" -} ``` @@ -60,3 +54,17 @@ import { - `create_time` (String) The time the Telemetry Link was created. - `id` (String) Terraform's internal resource identifier. It is structured as "`resource_type`, `resource_id`,`region`". - `status` (String) The status of the TelemetryLink, possible values: Possible values are: `active`, `inactive`, `failed`, `reconciling`, `deleting`. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing TelemetryLink +import { + to = stackit_telemetrylink.import-example + id = "${var.resource_type},${var.resource_id},${var.region}" +} +``` diff --git a/docs/resources/telemetryrouter_access_token.md b/docs/resources/telemetryrouter_access_token.md index 93dae50dd..bc01f24aa 100644 --- a/docs/resources/telemetryrouter_access_token.md +++ b/docs/resources/telemetryrouter_access_token.md @@ -28,13 +28,6 @@ resource "stackit_telemetryrouter_access_token" "accessToken2" { ttl = 30 description = "Example description" } - -# Only use the import statement, if you want to import an existing TelemetryRouter access token -# Note: The generated access token is only available upon creation. -import { - to = stackit_telemetryrouter_access_token.import-example - id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.telemetryrouter_access_token_id}" -} ``` @@ -60,3 +53,18 @@ import { - `expiration_time` (String) The date and time an access token will expire at (inclusively) - `id` (String) Terraform's internal resource identifier. It is structured as "`project_id`,`region`,`instance_id`,`access_token_id`". - `status` (String) The status of the access token. Possible values are: `active`, `expired`, `deleting`. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing TelemetryRouter access token +# Note: The generated access token is only available upon creation. +import { + to = stackit_telemetryrouter_access_token.import-example + id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.telemetryrouter_access_token_id}" +} +``` diff --git a/docs/resources/telemetryrouter_destination.md b/docs/resources/telemetryrouter_destination.md index 289236512..824affb21 100644 --- a/docs/resources/telemetryrouter_destination.md +++ b/docs/resources/telemetryrouter_destination.md @@ -80,12 +80,6 @@ resource "stackit_telemetryrouter_destination" "otlp" { } } } - -# Only use the import statement, if you want to import an existing TelemetryRouter destination -import { - to = stackit_telemetryrouter_destination.import-example - id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.destination_id}" -} ``` @@ -184,3 +178,17 @@ Required: - `id` (String) S3 access key ID - `secret` (String, Sensitive) S3 access key secret + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing TelemetryRouter destination +import { + to = stackit_telemetryrouter_destination.import-example + id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.destination_id}" +} +``` diff --git a/docs/resources/telemetryrouter_instance.md b/docs/resources/telemetryrouter_instance.md index e2eec8e62..4f78797b4 100644 --- a/docs/resources/telemetryrouter_instance.md +++ b/docs/resources/telemetryrouter_instance.md @@ -41,12 +41,6 @@ resource "stackit_telemetryrouter_instance" "router2" { ] } } - -# Only use the import statement, if you want to import an existing TelemetryRouter instance -import { - to = stackit_telemetryrouter_instance.import-example - id = "${var.project_id},${var.region},${var.router_instance_id}" -} ``` @@ -87,3 +81,17 @@ Required: - `level` (String) The TelemetryRouter global filter attribute level, possible values: Possible values are: `resource`, `scope`, `logRecord`. - `matcher` (String) The TelemetryRouter global filter attribute matcher, possible values: Possible values are: `=`, `!=`. - `values` (List of String) The TelemetryRouter global filter attributes + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing TelemetryRouter instance +import { + to = stackit_telemetryrouter_instance.import-example + id = "${var.project_id},${var.region},${var.router_instance_id}" +} +``` diff --git a/docs/resources/volume.md b/docs/resources/volume.md index 125fed296..af2775923 100644 --- a/docs/resources/volume.md +++ b/docs/resources/volume.md @@ -25,12 +25,6 @@ resource "stackit_volume" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing volume -import { - to = stackit_volume.import-example - id = "${var.project_id},${var.region},${var.volume_id}" -} ``` @@ -83,3 +77,17 @@ Required: - `id` (String) The ID of the source, e.g. image ID - `type` (String) The type of the source. Possible values are: `volume`, `image`, `snapshot`, `backup`. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing volume +import { + to = stackit_volume.import-example + id = "${var.project_id},${var.region},${var.volume_id}" +} +``` diff --git a/docs/resources/vpn_connection.md b/docs/resources/vpn_connection.md index c0bad25b3..90ce83f14 100644 --- a/docs/resources/vpn_connection.md +++ b/docs/resources/vpn_connection.md @@ -52,12 +52,6 @@ resource "stackit_vpn_connection" "example" { } } } - -# Only use the import statement, if you want to import an existing VPN connection -import { - to = stackit_vpn_connection.example - id = "${var.project_id},${var.region},${var.gateway_id},${var.connection_id}" -} ``` @@ -216,3 +210,17 @@ Required: - `local_address` (String) Local tunnel interface IPv4 address. - `remote_address` (String) Remote tunnel interface IPv4 address. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing VPN connection +import { + to = stackit_vpn_connection.example + id = "${var.project_id},${var.region},${var.gateway_id},${var.connection_id}" +} +``` diff --git a/docs/resources/vpn_gateway.md b/docs/resources/vpn_gateway.md index 6687ccf63..bbd557e1b 100644 --- a/docs/resources/vpn_gateway.md +++ b/docs/resources/vpn_gateway.md @@ -24,12 +24,6 @@ resource "stackit_vpn_gateway" "example" { tunnel2 = "eu01-2" } } - -# Only use the import statement, if you want to import an existing VPN gateway -import { - to = stackit_vpn_gateway.example - id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} ``` @@ -73,3 +67,17 @@ Required: Optional: - `override_advertised_routes` (List of String) List of IPv4 CIDRs to advertise via BGP. If omitted, SNA network ranges are advertised. + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, the [` + "`" + `import` + "`" + ` block](https://developer.hashicorp.com/terraform/language/import) can be used with the ` + "`" + `id` + "`" + ` attribute, for example: + +```terraform +# Only use the import statement, if you want to import an existing VPN gateway +import { + to = stackit_vpn_gateway.example + id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +} +``` diff --git a/examples/resources/stackit_affinity_group/import-by-string-id.tf b/examples/resources/stackit_affinity_group/import-by-string-id.tf new file mode 100644 index 000000000..25bc62c2e --- /dev/null +++ b/examples/resources/stackit_affinity_group/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing affinity group +import { + to = stackit_affinity_group.import-example + id = "${var.project_id},${var.region},${var.affinity_group_id}" +} diff --git a/examples/resources/stackit_affinity_group/resource.tf b/examples/resources/stackit_affinity_group/resource.tf index b0e506ab6..b222dc550 100644 --- a/examples/resources/stackit_affinity_group/resource.tf +++ b/examples/resources/stackit_affinity_group/resource.tf @@ -2,10 +2,4 @@ resource "stackit_affinity_group" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-affinity-group-name" policy = "hard-anti-affinity" -} - -# Only use the import statement, if you want to import an existing affinity group -import { - to = stackit_affinity_group.import-example - id = "${var.project_id},${var.region},${var.affinity_group_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_authorization_folder_custom_role/import-by-string-id.tf b/examples/resources/stackit_authorization_folder_custom_role/import-by-string-id.tf new file mode 100644 index 000000000..20668a2a9 --- /dev/null +++ b/examples/resources/stackit_authorization_folder_custom_role/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_folder_custom_role.import-example + id = "${var.folder_id},${var.custom_role_id}" +} diff --git a/examples/resources/stackit_authorization_folder_custom_role/resource.tf b/examples/resources/stackit_authorization_folder_custom_role/resource.tf index de88df59d..824e1f24b 100644 --- a/examples/resources/stackit_authorization_folder_custom_role/resource.tf +++ b/examples/resources/stackit_authorization_folder_custom_role/resource.tf @@ -11,11 +11,4 @@ resource "stackit_authorization_folder_custom_role" "example" { permissions = [ "iam.subject.get" ] -} - -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_folder_custom_role.import-example - id = "${var.folder_id},${var.custom_role_id}" -} - +} \ No newline at end of file diff --git a/examples/resources/stackit_authorization_folder_role_assignment/import-by-string-id.tf b/examples/resources/stackit_authorization_folder_role_assignment/import-by-string-id.tf new file mode 100644 index 000000000..023fff863 --- /dev/null +++ b/examples/resources/stackit_authorization_folder_role_assignment/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing folder role assignment +import { + to = stackit_authorization_folder_role_assignment.import-example + id = "${var.folder_id},${var.folder_role_assignment},${var.folder_role_assignment_subject}" +} diff --git a/examples/resources/stackit_authorization_folder_role_assignment/resource.tf b/examples/resources/stackit_authorization_folder_role_assignment/resource.tf index 27263a476..77f7a4824 100644 --- a/examples/resources/stackit_authorization_folder_role_assignment/resource.tf +++ b/examples/resources/stackit_authorization_folder_role_assignment/resource.tf @@ -9,10 +9,4 @@ resource "stackit_authorization_folder_role_assignment" "fra" { resource_id = stackit_resourcemanager_folder.example.folder_id role = "reader" subject = "foo.bar@stackit.cloud" -} - -# Only use the import statement, if you want to import an existing folder role assignment -import { - to = stackit_authorization_folder_role_assignment.import-example - id = "${var.folder_id},${var.folder_role_assignment},${var.folder_role_assignment_subject}" -} +} \ No newline at end of file diff --git a/examples/resources/stackit_authorization_organization_custom_role/import-by-string-id.tf b/examples/resources/stackit_authorization_organization_custom_role/import-by-string-id.tf new file mode 100644 index 000000000..596f9131e --- /dev/null +++ b/examples/resources/stackit_authorization_organization_custom_role/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_organization_custom_role.import-example + id = "${var.organization_id},${var.custom_role_id}" +} diff --git a/examples/resources/stackit_authorization_organization_custom_role/resource.tf b/examples/resources/stackit_authorization_organization_custom_role/resource.tf index 4e1fd28b9..d107d48a5 100644 --- a/examples/resources/stackit_authorization_organization_custom_role/resource.tf +++ b/examples/resources/stackit_authorization_organization_custom_role/resource.tf @@ -5,11 +5,4 @@ resource "stackit_authorization_organization_custom_role" "example" { permissions = [ "iam.subject.get" ] -} - -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_organization_custom_role.import-example - id = "${var.organization_id},${var.custom_role_id}" -} - +} \ No newline at end of file diff --git a/examples/resources/stackit_authorization_organization_role_assignment/import-by-string-id.tf b/examples/resources/stackit_authorization_organization_role_assignment/import-by-string-id.tf new file mode 100644 index 000000000..46f6cc34b --- /dev/null +++ b/examples/resources/stackit_authorization_organization_role_assignment/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing organization role assignment +import { + to = stackit_authorization_organization_role_assignment.import-example + id = "${var.organization_id},${var.org_role_assignment_role},${var.org_role_assignment_subject}" +} diff --git a/examples/resources/stackit_authorization_organization_role_assignment/resource.tf b/examples/resources/stackit_authorization_organization_role_assignment/resource.tf index f717c3344..7875cf7f3 100644 --- a/examples/resources/stackit_authorization_organization_role_assignment/resource.tf +++ b/examples/resources/stackit_authorization_organization_role_assignment/resource.tf @@ -3,9 +3,3 @@ resource "stackit_authorization_organization_role_assignment" "example" { role = "owner" subject = "john.doe@stackit.cloud" } - -# Only use the import statement, if you want to import an existing organization role assignment -import { - to = stackit_authorization_organization_role_assignment.import-example - id = "${var.organization_id},${var.org_role_assignment_role},${var.org_role_assignment_subject}" -} diff --git a/examples/resources/stackit_authorization_project_custom_role/import-by-string-id.tf b/examples/resources/stackit_authorization_project_custom_role/import-by-string-id.tf new file mode 100644 index 000000000..1dfc6df09 --- /dev/null +++ b/examples/resources/stackit_authorization_project_custom_role/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing custom role +import { + to = stackit_authorization_project_custom_role.import-example + id = "${var.project_id},${var.custom_role_id}" +} diff --git a/examples/resources/stackit_authorization_project_custom_role/resource.tf b/examples/resources/stackit_authorization_project_custom_role/resource.tf index ead0862bc..6567dd5e8 100644 --- a/examples/resources/stackit_authorization_project_custom_role/resource.tf +++ b/examples/resources/stackit_authorization_project_custom_role/resource.tf @@ -13,9 +13,3 @@ resource "stackit_authorization_project_custom_role" "example" { ] } -# Only use the import statement, if you want to import an existing custom role -import { - to = stackit_authorization_project_custom_role.import-example - id = "${var.project_id},${var.custom_role_id}" -} - diff --git a/examples/resources/stackit_authorization_project_role_assignment/import-by-string-id.tf b/examples/resources/stackit_authorization_project_role_assignment/import-by-string-id.tf new file mode 100644 index 000000000..ccd65d65a --- /dev/null +++ b/examples/resources/stackit_authorization_project_role_assignment/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing project role assignment +import { + to = stackit_authorization_project_role_assignment.import-example + id = "${var.project_id},${var.project_role_assignment_role},${var.project_role_assignment_subject}" +} diff --git a/examples/resources/stackit_authorization_project_role_assignment/resource.tf b/examples/resources/stackit_authorization_project_role_assignment/resource.tf index ac3c8cf16..928fabddc 100644 --- a/examples/resources/stackit_authorization_project_role_assignment/resource.tf +++ b/examples/resources/stackit_authorization_project_role_assignment/resource.tf @@ -9,10 +9,4 @@ resource "stackit_authorization_project_role_assignment" "pra" { resource_id = stackit_resourcemanager_project.example.project_id role = "reader" subject = "foo.bar@stackit.cloud" -} - -# Only use the import statement, if you want to import an existing project role assignment -import { - to = stackit_authorization_project_role_assignment.import-example - id = "${var.project_id},${var.project_role_assignment_role},${var.project_role_assignment_subject}" -} +} \ No newline at end of file diff --git a/examples/resources/stackit_authorization_service_account_role_assignment/import-by-string-id.tf b/examples/resources/stackit_authorization_service_account_role_assignment/import-by-string-id.tf new file mode 100644 index 000000000..afeeb1fbf --- /dev/null +++ b/examples/resources/stackit_authorization_service_account_role_assignment/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing service account assignment +import { + to = stackit_authorization_service_account_assignment.sa + id = "${var.resource_id},${var.service_account_assignment_role},${var.service_account_assignment_subject}" +} diff --git a/examples/resources/stackit_authorization_service_account_role_assignment/resource.tf b/examples/resources/stackit_authorization_service_account_role_assignment/resource.tf index 7fbc95577..129e441a9 100644 --- a/examples/resources/stackit_authorization_service_account_role_assignment/resource.tf +++ b/examples/resources/stackit_authorization_service_account_role_assignment/resource.tf @@ -21,9 +21,3 @@ resource "stackit_authorization_service_account_role_assignment" "sa" { role = "user" subject = data.stackit_service_accounts.ske_sa_suffix.items.0.email } - -# Only use the import statement, if you want to import an existing service account assignment -import { - to = stackit_authorization_service_account_assignment.sa - id = "${var.resource_id},${var.service_account_assignment_role},${var.service_account_assignment_subject}" -} diff --git a/examples/resources/stackit_cdn_custom_domain/import-by-string-id.tf b/examples/resources/stackit_cdn_custom_domain/import-by-string-id.tf new file mode 100644 index 000000000..3852f5d7c --- /dev/null +++ b/examples/resources/stackit_cdn_custom_domain/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing cdn custom domain +import { + to = stackit_cdn_custom_domain.import-example + id = "${var.project_id},${var.distribution_id},${var.custom_domain_name}" +} diff --git a/examples/resources/stackit_cdn_custom_domain/resource.tf b/examples/resources/stackit_cdn_custom_domain/resource.tf index 68ddfb960..e1ec03d99 100644 --- a/examples/resources/stackit_cdn_custom_domain/resource.tf +++ b/examples/resources/stackit_cdn_custom_domain/resource.tf @@ -6,10 +6,4 @@ resource "stackit_cdn_custom_domain" "example" { certificate = "-----BEGIN CERTIFICATE-----\nY2VydGlmaWNhdGVfZGF0YQ==\n-----END CERTIFICATE---" private_key = "-----BEGIN RSA PRIVATE KEY-----\nY2VydGlmaWNhdGVfZGF0YQ==\n-----END RSA PRIVATE KEY---" } -} - -# Only use the import statement, if you want to import an existing cdn custom domain -import { - to = stackit_cdn_custom_domain.import-example - id = "${var.project_id},${var.distribution_id},${var.custom_domain_name}" -} +} \ No newline at end of file diff --git a/examples/resources/stackit_cdn_distribution/import-by-string-id.tf b/examples/resources/stackit_cdn_distribution/import-by-string-id.tf new file mode 100644 index 000000000..d72cd64d9 --- /dev/null +++ b/examples/resources/stackit_cdn_distribution/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing cdn distribution +import { + to = stackit_cdn_distribution.import-example + id = "${var.project_id},${var.distribution_id}" +} diff --git a/examples/resources/stackit_cdn_distribution/resource.tf b/examples/resources/stackit_cdn_distribution/resource.tf index 4475b8854..65c6c560b 100644 --- a/examples/resources/stackit_cdn_distribution/resource.tf +++ b/examples/resources/stackit_cdn_distribution/resource.tf @@ -97,10 +97,4 @@ resource "stackit_cdn_distribution" "example_bucket_distribution" { log_only_rule_ids = ["@builtin/crs/response/954120"] } } -} - -# Only use the import statement, if you want to import an existing cdn distribution -import { - to = stackit_cdn_distribution.import-example - id = "${var.project_id},${var.distribution_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_dns_record_set/import-by-string-id.tf b/examples/resources/stackit_dns_record_set/import-by-string-id.tf new file mode 100644 index 000000000..bd1962243 --- /dev/null +++ b/examples/resources/stackit_dns_record_set/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing dns record set +import { + to = stackit_dns_record_set.import-example + id = "${var.project_id},${var.zone_id},${var.record_set_id}" +} diff --git a/examples/resources/stackit_dns_record_set/resource.tf b/examples/resources/stackit_dns_record_set/resource.tf index 96fe94437..ee4b3e6bd 100644 --- a/examples/resources/stackit_dns_record_set/resource.tf +++ b/examples/resources/stackit_dns_record_set/resource.tf @@ -5,10 +5,4 @@ resource "stackit_dns_record_set" "example" { type = "A" comment = "Example comment" records = ["1.2.3.4"] -} - -# Only use the import statement, if you want to import an existing dns record set -import { - to = stackit_dns_record_set.import-example - id = "${var.project_id},${var.zone_id},${var.record_set_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_dns_zone/import-by-string-id.tf b/examples/resources/stackit_dns_zone/import-by-string-id.tf new file mode 100644 index 000000000..c7525fa0a --- /dev/null +++ b/examples/resources/stackit_dns_zone/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing dns zone +import { + to = stackit_dns_zone.import-example + id = "${var.project_id},${var.zone_id}" +} diff --git a/examples/resources/stackit_dns_zone/resource.tf b/examples/resources/stackit_dns_zone/resource.tf index 431e26b4c..3be2b711e 100644 --- a/examples/resources/stackit_dns_zone/resource.tf +++ b/examples/resources/stackit_dns_zone/resource.tf @@ -7,10 +7,4 @@ resource "stackit_dns_zone" "example" { acl = "192.168.0.0/24" description = "Example description" default_ttl = 1230 -} - -# Only use the import statement, if you want to import an existing dns zone -import { - to = stackit_dns_zone.import-example - id = "${var.project_id},${var.zone_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_dremio_instance/import-by-string-id.tf b/examples/resources/stackit_dremio_instance/import-by-string-id.tf new file mode 100644 index 000000000..2083c099f --- /dev/null +++ b/examples/resources/stackit_dremio_instance/import-by-string-id.tf @@ -0,0 +1,4 @@ +import { + to = stackit_dremio_instance.import_example + id = "${var.project_id},${var.region},${var.instance_id}" +} diff --git a/examples/resources/stackit_dremio_instance/resource.tf b/examples/resources/stackit_dremio_instance/resource.tf index c48a0acae..de2ae9ad2 100644 --- a/examples/resources/stackit_dremio_instance/resource.tf +++ b/examples/resources/stackit_dremio_instance/resource.tf @@ -25,9 +25,4 @@ resource "stackit_dremio_instance" "example" { client_secret = "client-secret" } } -} - -import { - to = stackit_dremio_instance.import_example - id = "${var.project_id},${var.region},${var.instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_dremio_user/import-by-string-id.tf b/examples/resources/stackit_dremio_user/import-by-string-id.tf new file mode 100644 index 000000000..8f55e3e48 --- /dev/null +++ b/examples/resources/stackit_dremio_user/import-by-string-id.tf @@ -0,0 +1,4 @@ +import { + to = stackit_dremio_user.import_example + id = "${var.project_id},${var.region},${var.instance_id},${var.user_id}" +} diff --git a/examples/resources/stackit_dremio_user/resource.tf b/examples/resources/stackit_dremio_user/resource.tf index d317cf483..ad89bc32a 100644 --- a/examples/resources/stackit_dremio_user/resource.tf +++ b/examples/resources/stackit_dremio_user/resource.tf @@ -8,9 +8,4 @@ resource "stackit_dremio_user" "example" { first_name = "Test" last_name = "User" name = "testUser" -} - -import { - to = stackit_dremio_user.import_example - id = "${var.project_id},${var.region},${var.instance_id},${var.user_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_edgecloud_instance/import-by-string-id.tf b/examples/resources/stackit_edgecloud_instance/import-by-string-id.tf new file mode 100644 index 000000000..08195f4f6 --- /dev/null +++ b/examples/resources/stackit_edgecloud_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing Edge Cloud instance resource +import { + to = stackit_edgecloud_instance.this + id = "${local.project_id},${local.region},INSTANCE_ID" +} diff --git a/examples/resources/stackit_edgecloud_instance/resource.tf b/examples/resources/stackit_edgecloud_instance/resource.tf index e49dac133..3ebc35ecb 100644 --- a/examples/resources/stackit_edgecloud_instance/resource.tf +++ b/examples/resources/stackit_edgecloud_instance/resource.tf @@ -12,9 +12,3 @@ resource "stackit_edgecloud_instance" "this" { plan_id = local.plan_id description = local.description } - -# Only use the import statement, if you want to import an existing Edge Cloud instance resource -import { - to = stackit_edgecloud_instance.this - id = "${local.project_id},${local.region},INSTANCE_ID" -} diff --git a/examples/resources/stackit_git/import-by-string-id.tf b/examples/resources/stackit_git/import-by-string-id.tf new file mode 100644 index 000000000..ae522eaa3 --- /dev/null +++ b/examples/resources/stackit_git/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing git resource +import { + to = stackit_git.import-example + id = "${var.project_id},${var.git_instance_id}" +} diff --git a/examples/resources/stackit_git/resource.tf b/examples/resources/stackit_git/resource.tf index a7e02c827..fc5de0729 100644 --- a/examples/resources/stackit_git/resource.tf +++ b/examples/resources/stackit_git/resource.tf @@ -10,10 +10,4 @@ resource "stackit_git" "git" { "0.0.0.0/0" ] flavor = "git-100" -} - -# Only use the import statement, if you want to import an existing git resource -import { - to = stackit_git.import-example - id = "${var.project_id},${var.git_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_image/import-by-string-id.tf b/examples/resources/stackit_image/import-by-string-id.tf new file mode 100644 index 000000000..65cb8d72e --- /dev/null +++ b/examples/resources/stackit_image/import-by-string-id.tf @@ -0,0 +1,11 @@ +# Only use the import statement, if you want to import an existing image +# Must set a configuration value for the local_file_path attribute as the provider has marked it as required. +# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply. +# In order to prevent this you need to add: +#lifecycle { +# ignore_changes = [ local_file_path ] +# } +import { + to = stackit_image.import-example + id = "${var.project_id},${var.region},${var.image_id}" +} diff --git a/examples/resources/stackit_image/resource.tf b/examples/resources/stackit_image/resource.tf index bf3bd6927..b2d311923 100644 --- a/examples/resources/stackit_image/resource.tf +++ b/examples/resources/stackit_image/resource.tf @@ -5,16 +5,4 @@ resource "stackit_image" "example_image" { local_file_path = "./path/to/image.qcow2" min_disk_size = 10 min_ram = 5 -} - -# Only use the import statement, if you want to import an existing image -# Must set a configuration value for the local_file_path attribute as the provider has marked it as required. -# Since this attribute is not fetched in general from the API call, after adding it this would replace your image resource after an terraform apply. -# In order to prevent this you need to add: -#lifecycle { -# ignore_changes = [ local_file_path ] -# } -import { - to = stackit_image.import-example - id = "${var.project_id},${var.region},${var.image_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_key_pair/import-by-string-id.tf b/examples/resources/stackit_key_pair/import-by-string-id.tf new file mode 100644 index 000000000..8170fb62c --- /dev/null +++ b/examples/resources/stackit_key_pair/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing key pair +import { + to = stackit_key_pair.import-example + id = var.keypair_name +} diff --git a/examples/resources/stackit_key_pair/resource.tf b/examples/resources/stackit_key_pair/resource.tf index 6f575bfef..8b159e0bc 100644 --- a/examples/resources/stackit_key_pair/resource.tf +++ b/examples/resources/stackit_key_pair/resource.tf @@ -2,10 +2,4 @@ resource "stackit_key_pair" "keypair" { name = "example-key-pair" public_key = chomp(file("path/to/id_rsa.pub")) -} - -# Only use the import statement, if you want to import an existing key pair -import { - to = stackit_key_pair.import-example - id = var.keypair_name } \ No newline at end of file diff --git a/examples/resources/stackit_loadbalancer/import-by-string-id.tf b/examples/resources/stackit_loadbalancer/import-by-string-id.tf new file mode 100644 index 000000000..063d29d89 --- /dev/null +++ b/examples/resources/stackit_loadbalancer/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing loadbalancer +import { + to = stackit_loadbalancer.import-example + id = "${var.project_id},${var.region},${var.loadbalancer_name}" +} diff --git a/examples/resources/stackit_loadbalancer/resource.tf b/examples/resources/stackit_loadbalancer/resource.tf index 0c4f3b890..4b5209f04 100644 --- a/examples/resources/stackit_loadbalancer/resource.tf +++ b/examples/resources/stackit_loadbalancer/resource.tf @@ -208,10 +208,4 @@ resource "stackit_network_interface" "nic" { network_id = stackit_network.target_network.network_id security_group_ids = [stackit_security_group.target_sg.security_group_id] } -# End of advanced example - -# Only use the import statement, if you want to import an existing loadbalancer -import { - to = stackit_loadbalancer.import-example - id = "${var.project_id},${var.region},${var.loadbalancer_name}" -} +# End of advanced example \ No newline at end of file diff --git a/examples/resources/stackit_loadbalancer_observability_credential/import-by-string-id.tf b/examples/resources/stackit_loadbalancer_observability_credential/import-by-string-id.tf new file mode 100644 index 000000000..0a5b9d0b7 --- /dev/null +++ b/examples/resources/stackit_loadbalancer_observability_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing loadbalancer observability credential +import { + to = stackit_loadbalancer_observability_credential.import-example + id = "${var.project_id},${var.region},${var.credentials_ref}" +} \ No newline at end of file diff --git a/examples/resources/stackit_loadbalancer_observability_credential/resource.tf b/examples/resources/stackit_loadbalancer_observability_credential/resource.tf index 7b29fb3b4..512509440 100644 --- a/examples/resources/stackit_loadbalancer_observability_credential/resource.tf +++ b/examples/resources/stackit_loadbalancer_observability_credential/resource.tf @@ -3,10 +3,4 @@ resource "stackit_loadbalancer_observability_credential" "example" { display_name = "example-credentials" username = "example-user" password = "example-password" -} - -# Only use the import statement, if you want to import an existing loadbalancer observability credential -import { - to = stackit_loadbalancer_observability_credential.import-example - id = "${var.project_id},${var.region},${var.credentials_ref}" -} +} \ No newline at end of file diff --git a/examples/resources/stackit_logme_credential/import-by-string-id.tf b/examples/resources/stackit_logme_credential/import-by-string-id.tf new file mode 100644 index 000000000..757c244cf --- /dev/null +++ b/examples/resources/stackit_logme_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing logme credential +import { + to = stackit_logme_credential.import-example + id = "${var.project_id},${var.logme_instance_id},${var.logme_credentials_id}" +} diff --git a/examples/resources/stackit_logme_credential/resource.tf b/examples/resources/stackit_logme_credential/resource.tf index c0c0c7208..f0b177892 100644 --- a/examples/resources/stackit_logme_credential/resource.tf +++ b/examples/resources/stackit_logme_credential/resource.tf @@ -1,10 +1,4 @@ resource "stackit_logme_credential" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing logme credential -import { - to = stackit_logme_credential.import-example - id = "${var.project_id},${var.logme_instance_id},${var.logme_credentials_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_logme_instance/import-by-string-id.tf b/examples/resources/stackit_logme_instance/import-by-string-id.tf new file mode 100644 index 000000000..ecb03f52f --- /dev/null +++ b/examples/resources/stackit_logme_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing logme instance +import { + to = stackit_logme_instance.import-example + id = "${var.project_id},${var.logme_instance_id}" +} diff --git a/examples/resources/stackit_logme_instance/resource.tf b/examples/resources/stackit_logme_instance/resource.tf index e95eeb013..2db494bff 100644 --- a/examples/resources/stackit_logme_instance/resource.tf +++ b/examples/resources/stackit_logme_instance/resource.tf @@ -6,10 +6,4 @@ resource "stackit_logme_instance" "example" { parameters = { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } -} - -# Only use the import statement, if you want to import an existing logme instance -import { - to = stackit_logme_instance.import-example - id = "${var.project_id},${var.logme_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_logs_access_token/import-by-string-id.tf b/examples/resources/stackit_logs_access_token/import-by-string-id.tf new file mode 100644 index 000000000..d872c03cd --- /dev/null +++ b/examples/resources/stackit_logs_access_token/import-by-string-id.tf @@ -0,0 +1,10 @@ +# Only use the import statement, if you want to import an existing logs access token +# Note: The generated access token is only available upon creation. +# Since this attribute is not fetched from the API call, to prevent the conflicts, you need to add: +# lifecycle { +# ignore_changes = [ lifetime ] +# } +import { + to = stackit_logs_access_token.import-example + id = "${var.project_id},${var.region},${var.logs_instance_id},${var.logs_access_token_id}" +} diff --git a/examples/resources/stackit_logs_access_token/resource.tf b/examples/resources/stackit_logs_access_token/resource.tf index 3fdc4136f..3b0ed7f9f 100644 --- a/examples/resources/stackit_logs_access_token/resource.tf +++ b/examples/resources/stackit_logs_access_token/resource.tf @@ -38,15 +38,4 @@ resource "stackit_logs_access_token" "accessToken_rotate" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing logs access token -# Note: The generated access token is only available upon creation. -# Since this attribute is not fetched from the API call, to prevent the conflicts, you need to add: -# lifecycle { -# ignore_changes = [ lifetime ] -# } -import { - to = stackit_logs_access_token.import-example - id = "${var.project_id},${var.region},${var.logs_instance_id},${var.logs_access_token_id}" -} +} \ No newline at end of file diff --git a/examples/resources/stackit_logs_instance/import-by-string-id.tf b/examples/resources/stackit_logs_instance/import-by-string-id.tf new file mode 100644 index 000000000..f45048dc2 --- /dev/null +++ b/examples/resources/stackit_logs_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing logs instance +import { + to = stackit_logs_instance.import-example + id = "${var.project_id},${var.region},${var.logs_instance_id}" +} diff --git a/examples/resources/stackit_logs_instance/resource.tf b/examples/resources/stackit_logs_instance/resource.tf index 6fb54a675..7ee580a97 100644 --- a/examples/resources/stackit_logs_instance/resource.tf +++ b/examples/resources/stackit_logs_instance/resource.tf @@ -15,9 +15,3 @@ resource "stackit_logs_instance" "logs2" { ] description = "Example description" } - -# Only use the import statement, if you want to import an existing logs instance -import { - to = stackit_logs_instance.import-example - id = "${var.project_id},${var.region},${var.logs_instance_id}" -} diff --git a/examples/resources/stackit_mariadb_credential/import-by-string-id.tf b/examples/resources/stackit_mariadb_credential/import-by-string-id.tf new file mode 100644 index 000000000..8b00ef53b --- /dev/null +++ b/examples/resources/stackit_mariadb_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing mariadb credential +import { + to = stackit_mariadb_credential.import-example + id = "${var.project_id},${var.mariadb_instance_id},${var.mariadb_credential_id}" +} diff --git a/examples/resources/stackit_mariadb_credential/resource.tf b/examples/resources/stackit_mariadb_credential/resource.tf index 545573326..ed93bd618 100644 --- a/examples/resources/stackit_mariadb_credential/resource.tf +++ b/examples/resources/stackit_mariadb_credential/resource.tf @@ -15,9 +15,3 @@ resource "stackit_mariadb_credential" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing mariadb credential -import { - to = stackit_mariadb_credential.import-example - id = "${var.project_id},${var.mariadb_instance_id},${var.mariadb_credential_id}" -} diff --git a/examples/resources/stackit_mariadb_instance/import-by-string-id.tf b/examples/resources/stackit_mariadb_instance/import-by-string-id.tf new file mode 100644 index 000000000..e696a4e3f --- /dev/null +++ b/examples/resources/stackit_mariadb_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing mariadb instance +import { + to = stackit_mariadb_instance.import-example + id = "${var.project_id},${var.mariadb_instance_id}" +} diff --git a/examples/resources/stackit_mariadb_instance/resource.tf b/examples/resources/stackit_mariadb_instance/resource.tf index 7abe23ffc..fe6bafd2a 100644 --- a/examples/resources/stackit_mariadb_instance/resource.tf +++ b/examples/resources/stackit_mariadb_instance/resource.tf @@ -7,9 +7,3 @@ resource "stackit_mariadb_instance" "example" { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } } - -# Only use the import statement, if you want to import an existing mariadb instance -import { - to = stackit_mariadb_instance.import-example - id = "${var.project_id},${var.mariadb_instance_id}" -} diff --git a/examples/resources/stackit_mongodbflex_instance/import-by-string-id.tf b/examples/resources/stackit_mongodbflex_instance/import-by-string-id.tf new file mode 100644 index 000000000..1a479c47b --- /dev/null +++ b/examples/resources/stackit_mongodbflex_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing mongodbflex instance +import { + to = stackit_mongodbflex_instance.import-example + id = "${var.project_id},${var.region},${var.instance_id}" +} diff --git a/examples/resources/stackit_mongodbflex_instance/resource.tf b/examples/resources/stackit_mongodbflex_instance/resource.tf index 0f80279dc..7c955a03a 100644 --- a/examples/resources/stackit_mongodbflex_instance/resource.tf +++ b/examples/resources/stackit_mongodbflex_instance/resource.tf @@ -18,10 +18,4 @@ resource "stackit_mongodbflex_instance" "example" { point_in_time_window_hours = 30 } backup_schedule = "0 0 * * *" -} - -# Only use the import statement, if you want to import an existing mongodbflex instance -import { - to = stackit_mongodbflex_instance.import-example - id = "${var.project_id},${var.region},${var.instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_mongodbflex_user/import-by-string-id.tf b/examples/resources/stackit_mongodbflex_user/import-by-string-id.tf new file mode 100644 index 000000000..651bdd775 --- /dev/null +++ b/examples/resources/stackit_mongodbflex_user/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing mongodbflex user +import { + to = stackit_mongodbflex_user.import-example + id = "${var.project_id},${var.region},${var.instance_id},${user_id}" +} diff --git a/examples/resources/stackit_mongodbflex_user/resource.tf b/examples/resources/stackit_mongodbflex_user/resource.tf index b056d414a..e8390d36b 100644 --- a/examples/resources/stackit_mongodbflex_user/resource.tf +++ b/examples/resources/stackit_mongodbflex_user/resource.tf @@ -21,9 +21,3 @@ resource "stackit_mongodbflex_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing mongodbflex user -import { - to = stackit_mongodbflex_user.import-example - id = "${var.project_id},${var.region},${var.instance_id},${user_id}" -} diff --git a/examples/resources/stackit_network/import-by-string-id.tf b/examples/resources/stackit_network/import-by-string-id.tf new file mode 100644 index 000000000..bd0f7f3a0 --- /dev/null +++ b/examples/resources/stackit_network/import-by-string-id.tf @@ -0,0 +1,7 @@ +# Only use the import statement, if you want to import an existing network +# Note: There will be a conflict which needs to be resolved manually. +# These attributes cannot be configured together: [ipv4_prefix,ipv4_prefix_length,ipv4_gateway] +import { + to = stackit_network.import-example + id = "${var.project_id},${var.region},${var.network_id}" +} diff --git a/examples/resources/stackit_network/resource.tf b/examples/resources/stackit_network/resource.tf index f5760a04a..c06f00641 100644 --- a/examples/resources/stackit_network/resource.tf +++ b/examples/resources/stackit_network/resource.tf @@ -23,11 +23,3 @@ resource "stackit_network" "example_non_routed_network" { } routed = false } - -# Only use the import statement, if you want to import an existing network -# Note: There will be a conflict which needs to be resolved manually. -# These attributes cannot be configured together: [ipv4_prefix,ipv4_prefix_length,ipv4_gateway] -import { - to = stackit_network.import-example - id = "${var.project_id},${var.region},${var.network_id}" -} diff --git a/examples/resources/stackit_network_area/import-by-string-id.tf b/examples/resources/stackit_network_area/import-by-string-id.tf new file mode 100644 index 000000000..2c2e91551 --- /dev/null +++ b/examples/resources/stackit_network_area/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing network area +import { + to = stackit_network_area.import-example + id = "${var.organization_id},${var.network_area_id}" +} diff --git a/examples/resources/stackit_network_area/resource.tf b/examples/resources/stackit_network_area/resource.tf index a699e7cad..603cf073d 100644 --- a/examples/resources/stackit_network_area/resource.tf +++ b/examples/resources/stackit_network_area/resource.tf @@ -4,10 +4,4 @@ resource "stackit_network_area" "example" { labels = { "key" = "value" } -} - -# Only use the import statement, if you want to import an existing network area -import { - to = stackit_network_area.import-example - id = "${var.organization_id},${var.network_area_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_network_area_region/import-by-string-id.tf b/examples/resources/stackit_network_area_region/import-by-string-id.tf new file mode 100644 index 000000000..a779dc426 --- /dev/null +++ b/examples/resources/stackit_network_area_region/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing network area region +import { + to = stackit_network_area_region.import-example + id = "${var.organization_id},${var.network_area_id},${var.region}" +} diff --git a/examples/resources/stackit_network_area_region/resource.tf b/examples/resources/stackit_network_area_region/resource.tf index bb876b863..2c713b285 100644 --- a/examples/resources/stackit_network_area_region/resource.tf +++ b/examples/resources/stackit_network_area_region/resource.tf @@ -10,9 +10,3 @@ resource "stackit_network_area_region" "example" { ] } } - -# Only use the import statement, if you want to import an existing network area region -import { - to = stackit_network_area_region.import-example - id = "${var.organization_id},${var.network_area_id},${var.region}" -} diff --git a/examples/resources/stackit_network_area_route/import-by-string-id.tf b/examples/resources/stackit_network_area_route/import-by-string-id.tf new file mode 100644 index 000000000..89dbdeffd --- /dev/null +++ b/examples/resources/stackit_network_area_route/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing network area route +import { + to = stackit_network_area_route.import-example + id = "${var.organization_id},${var.network_area_id},${var.region},${var.network_area_route_id}" +} diff --git a/examples/resources/stackit_network_area_route/resource.tf b/examples/resources/stackit_network_area_route/resource.tf index 91ea42d48..d5535c18c 100644 --- a/examples/resources/stackit_network_area_route/resource.tf +++ b/examples/resources/stackit_network_area_route/resource.tf @@ -13,9 +13,3 @@ resource "stackit_network_area_route" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing network area route -import { - to = stackit_network_area_route.import-example - id = "${var.organization_id},${var.network_area_id},${var.region},${var.network_area_route_id}" -} diff --git a/examples/resources/stackit_network_interface/import-by-string-id.tf b/examples/resources/stackit_network_interface/import-by-string-id.tf new file mode 100644 index 000000000..f950d5fe0 --- /dev/null +++ b/examples/resources/stackit_network_interface/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing network interface +import { + to = stackit_network_interface.import-example + id = "${var.project_id},${var.region},${var.network_id},${var.network_interface_id}" +} diff --git a/examples/resources/stackit_network_interface/resource.tf b/examples/resources/stackit_network_interface/resource.tf index 2ff598ff3..181e63ed6 100644 --- a/examples/resources/stackit_network_interface/resource.tf +++ b/examples/resources/stackit_network_interface/resource.tf @@ -3,10 +3,4 @@ resource "stackit_network_interface" "example" { network_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" allowed_addresses = ["192.168.0.0/24"] security_group_ids = ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] -} - -# Only use the import statement, if you want to import an existing network interface -import { - to = stackit_network_interface.import-example - id = "${var.project_id},${var.region},${var.network_id},${var.network_interface_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_objectstorage_bucket/import-by-string-id.tf b/examples/resources/stackit_objectstorage_bucket/import-by-string-id.tf new file mode 100644 index 000000000..3f7efd087 --- /dev/null +++ b/examples/resources/stackit_objectstorage_bucket/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing objectstorage bucket +import { + to = stackit_objectstorage_bucket.import-example + id = "${var.project_id},${var.region},${var.bucket_name}" +} diff --git a/examples/resources/stackit_objectstorage_bucket/resource.tf b/examples/resources/stackit_objectstorage_bucket/resource.tf index 03e9989eb..b1074d41b 100644 --- a/examples/resources/stackit_objectstorage_bucket/resource.tf +++ b/examples/resources/stackit_objectstorage_bucket/resource.tf @@ -14,10 +14,3 @@ resource "stackit_objectstorage_bucket" "example_with_lock" { name = "example-bucket-with-lock" object_lock = true } - - -# Only use the import statement, if you want to import an existing objectstorage bucket -import { - to = stackit_objectstorage_bucket.import-example - id = "${var.project_id},${var.region},${var.bucket_name}" -} diff --git a/examples/resources/stackit_objectstorage_credential/import-by-string-id.tf b/examples/resources/stackit_objectstorage_credential/import-by-string-id.tf new file mode 100644 index 000000000..cba68cfc1 --- /dev/null +++ b/examples/resources/stackit_objectstorage_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing objectstorage credential +import { + to = stackit_objectstorage_credential.import-example + id = "${var.project_id},${var.region},${var.bucket_credentials_group_id},${var.bucket_credential_id}" +} diff --git a/examples/resources/stackit_objectstorage_credential/resource.tf b/examples/resources/stackit_objectstorage_credential/resource.tf index e011b0d60..f58d5105f 100644 --- a/examples/resources/stackit_objectstorage_credential/resource.tf +++ b/examples/resources/stackit_objectstorage_credential/resource.tf @@ -17,9 +17,3 @@ resource "stackit_objectstorage_credential" "rotate_example" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing objectstorage credential -import { - to = stackit_objectstorage_credential.import-example - id = "${var.project_id},${var.region},${var.bucket_credentials_group_id},${var.bucket_credential_id}" -} diff --git a/examples/resources/stackit_objectstorage_credentials_group/import-by-string-id.tf b/examples/resources/stackit_objectstorage_credentials_group/import-by-string-id.tf new file mode 100644 index 000000000..4392b666e --- /dev/null +++ b/examples/resources/stackit_objectstorage_credentials_group/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing objectstorage credential group +import { + to = stackit_objectstorage_credentials_group.import-example + id = "${var.project_id},${var.region},${var.bucket_credentials_group_id}" +} diff --git a/examples/resources/stackit_objectstorage_credentials_group/resource.tf b/examples/resources/stackit_objectstorage_credentials_group/resource.tf index 0d6b1e3e8..33e3cee18 100644 --- a/examples/resources/stackit_objectstorage_credentials_group/resource.tf +++ b/examples/resources/stackit_objectstorage_credentials_group/resource.tf @@ -2,9 +2,3 @@ resource "stackit_objectstorage_credentials_group" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-credentials-group" } - -# Only use the import statement, if you want to import an existing objectstorage credential group -import { - to = stackit_objectstorage_credentials_group.import-example - id = "${var.project_id},${var.region},${var.bucket_credentials_group_id}" -} diff --git a/examples/resources/stackit_observability_alertgroup/import-by-string-id.tf b/examples/resources/stackit_observability_alertgroup/import-by-string-id.tf new file mode 100644 index 000000000..d305fbe88 --- /dev/null +++ b/examples/resources/stackit_observability_alertgroup/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing observability alertgroup +import { + to = stackit_observability_alertgroup.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_alertgroup_name}" +} diff --git a/examples/resources/stackit_observability_alertgroup/resource.tf b/examples/resources/stackit_observability_alertgroup/resource.tf index 461618237..3530b0540 100644 --- a/examples/resources/stackit_observability_alertgroup/resource.tf +++ b/examples/resources/stackit_observability_alertgroup/resource.tf @@ -25,9 +25,3 @@ resource "stackit_observability_alertgroup" "example" { }, ] } - -# Only use the import statement, if you want to import an existing observability alertgroup -import { - to = stackit_observability_alertgroup.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_alertgroup_name}" -} diff --git a/examples/resources/stackit_observability_instance/import-by-string-id.tf b/examples/resources/stackit_observability_instance/import-by-string-id.tf new file mode 100644 index 000000000..12a6264f5 --- /dev/null +++ b/examples/resources/stackit_observability_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing observability instance +import { + to = stackit_observability_instance.import-example + id = "${var.project_id},${var.observability_instance_id}" +} diff --git a/examples/resources/stackit_observability_instance/resource.tf b/examples/resources/stackit_observability_instance/resource.tf index 070704ddf..529f6380c 100644 --- a/examples/resources/stackit_observability_instance/resource.tf +++ b/examples/resources/stackit_observability_instance/resource.tf @@ -8,10 +8,4 @@ resource "stackit_observability_instance" "example" { metrics_retention_days = 90 metrics_retention_days_5m_downsampling = 90 metrics_retention_days_1h_downsampling = 90 -} - -# Only use the import statement, if you want to import an existing observability instance -import { - to = stackit_observability_instance.import-example - id = "${var.project_id},${var.observability_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_observability_logalertgroup/import-by-string-id.tf b/examples/resources/stackit_observability_logalertgroup/import-by-string-id.tf new file mode 100644 index 000000000..6af04c6a7 --- /dev/null +++ b/examples/resources/stackit_observability_logalertgroup/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing observability logalertgroup +import { + to = stackit_observability_logalertgroup.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_logalertgroup_name}" +} diff --git a/examples/resources/stackit_observability_logalertgroup/resource.tf b/examples/resources/stackit_observability_logalertgroup/resource.tf index d2876a697..ff9e20065 100644 --- a/examples/resources/stackit_observability_logalertgroup/resource.tf +++ b/examples/resources/stackit_observability_logalertgroup/resource.tf @@ -30,9 +30,3 @@ resource "stackit_observability_logalertgroup" "example" { }, ] } - -# Only use the import statement, if you want to import an existing observability logalertgroup -import { - to = stackit_observability_logalertgroup.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_logalertgroup_name}" -} diff --git a/examples/resources/stackit_observability_scrapeconfig/import-by-string-id.tf b/examples/resources/stackit_observability_scrapeconfig/import-by-string-id.tf new file mode 100644 index 000000000..ac50f9041 --- /dev/null +++ b/examples/resources/stackit_observability_scrapeconfig/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing observability scrapeconfig +import { + to = stackit_observability_scrapeconfig.import-example + id = "${var.project_id},${var.observability_instance_id},${var.observability_scrapeconfig_name}" +} diff --git a/examples/resources/stackit_observability_scrapeconfig/resource.tf b/examples/resources/stackit_observability_scrapeconfig/resource.tf index f0866184c..71f20da1a 100644 --- a/examples/resources/stackit_observability_scrapeconfig/resource.tf +++ b/examples/resources/stackit_observability_scrapeconfig/resource.tf @@ -15,9 +15,3 @@ resource "stackit_observability_scrapeconfig" "example" { } ] } - -# Only use the import statement, if you want to import an existing observability scrapeconfig -import { - to = stackit_observability_scrapeconfig.import-example - id = "${var.project_id},${var.observability_instance_id},${var.observability_scrapeconfig_name}" -} diff --git a/examples/resources/stackit_opensearch_credential/import-by-string-id.tf b/examples/resources/stackit_opensearch_credential/import-by-string-id.tf new file mode 100644 index 000000000..9af8e897b --- /dev/null +++ b/examples/resources/stackit_opensearch_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing opensearch credential +import { + to = stackit_opensearch_credential.import-example + id = "${var.project_id},${var.instance_id},${var.credential_id}" +} diff --git a/examples/resources/stackit_opensearch_credential/resource.tf b/examples/resources/stackit_opensearch_credential/resource.tf index 1bc72f7dd..94ada27ec 100644 --- a/examples/resources/stackit_opensearch_credential/resource.tf +++ b/examples/resources/stackit_opensearch_credential/resource.tf @@ -14,10 +14,4 @@ resource "stackit_opensearch_credential" "example_rotate" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing opensearch credential -import { - to = stackit_opensearch_credential.import-example - id = "${var.project_id},${var.instance_id},${var.credential_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_opensearch_instance/import-by-string-id.tf b/examples/resources/stackit_opensearch_instance/import-by-string-id.tf new file mode 100644 index 000000000..31eb6fb05 --- /dev/null +++ b/examples/resources/stackit_opensearch_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing opensearch instance +import { + to = stackit_opensearch_instance.import-example + id = "${var.project_id},${var.instance_id}" +} diff --git a/examples/resources/stackit_opensearch_instance/resource.tf b/examples/resources/stackit_opensearch_instance/resource.tf index 043f71547..b166cc215 100644 --- a/examples/resources/stackit_opensearch_instance/resource.tf +++ b/examples/resources/stackit_opensearch_instance/resource.tf @@ -6,10 +6,4 @@ resource "stackit_opensearch_instance" "example" { parameters = { sgw_acl = "193.148.160.0/19,45.129.40.0/21,45.135.244.0/22" } -} - -# Only use the import statement, if you want to import an existing opensearch instance -import { - to = stackit_opensearch_instance.import-example - id = "${var.project_id},${var.instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_postgresflex_database/import-by-string-id.tf b/examples/resources/stackit_postgresflex_database/import-by-string-id.tf new file mode 100644 index 000000000..8214a6207 --- /dev/null +++ b/examples/resources/stackit_postgresflex_database/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing postgresflex database +import { + to = stackit_postgresflex_database.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.postgres_database_id}" +} diff --git a/examples/resources/stackit_postgresflex_database/resource.tf b/examples/resources/stackit_postgresflex_database/resource.tf index 5388e1a25..906f2ef1c 100644 --- a/examples/resources/stackit_postgresflex_database/resource.tf +++ b/examples/resources/stackit_postgresflex_database/resource.tf @@ -3,10 +3,4 @@ resource "stackit_postgresflex_database" "example" { instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "mydb" owner = "myusername" -} - -# Only use the import statement, if you want to import an existing postgresflex database -import { - to = stackit_postgresflex_database.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.postgres_database_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_postgresflex_instance/import-by-string-id.tf b/examples/resources/stackit_postgresflex_instance/import-by-string-id.tf new file mode 100644 index 000000000..b09704f20 --- /dev/null +++ b/examples/resources/stackit_postgresflex_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing postgresflex instance +import { + to = stackit_postgresflex_instance.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id}" +} diff --git a/examples/resources/stackit_postgresflex_instance/resource.tf b/examples/resources/stackit_postgresflex_instance/resource.tf index df74248d7..29efbd539 100644 --- a/examples/resources/stackit_postgresflex_instance/resource.tf +++ b/examples/resources/stackit_postgresflex_instance/resource.tf @@ -13,10 +13,4 @@ resource "stackit_postgresflex_instance" "example" { size = 5 } version = 14 -} - -# Only use the import statement, if you want to import an existing postgresflex instance -import { - to = stackit_postgresflex_instance.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_postgresflex_user/import-by-string-id.tf b/examples/resources/stackit_postgresflex_user/import-by-string-id.tf new file mode 100644 index 000000000..d9e62c961 --- /dev/null +++ b/examples/resources/stackit_postgresflex_user/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing postgresflex user +import { + to = stackit_postgresflex_user.import-example + id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}" +} diff --git a/examples/resources/stackit_postgresflex_user/resource.tf b/examples/resources/stackit_postgresflex_user/resource.tf index a1eeccefd..def1b01e5 100644 --- a/examples/resources/stackit_postgresflex_user/resource.tf +++ b/examples/resources/stackit_postgresflex_user/resource.tf @@ -18,10 +18,4 @@ resource "stackit_postgresflex_user" "example_rotate" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing postgresflex user -import { - to = stackit_postgresflex_user.import-example - id = "${var.project_id},${var.region},${var.postgres_instance_id},${var.user_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_public_ip/import-by-string-id.tf b/examples/resources/stackit_public_ip/import-by-string-id.tf new file mode 100644 index 000000000..ccaa39f4f --- /dev/null +++ b/examples/resources/stackit_public_ip/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing public ip +import { + to = stackit_public_ip.import-example + id = "${var.project_id},${var.region},${var.public_ip_id}" +} diff --git a/examples/resources/stackit_public_ip/resource.tf b/examples/resources/stackit_public_ip/resource.tf index 691cfc342..fd6bc845f 100644 --- a/examples/resources/stackit_public_ip/resource.tf +++ b/examples/resources/stackit_public_ip/resource.tf @@ -4,10 +4,4 @@ resource "stackit_public_ip" "example" { labels = { "key" = "value" } -} - -# Only use the import statement, if you want to import an existing public ip -import { - to = stackit_public_ip.import-example - id = "${var.project_id},${var.region},${var.public_ip_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_public_ip_associate/import-by-string-id.tf b/examples/resources/stackit_public_ip_associate/import-by-string-id.tf new file mode 100644 index 000000000..dd9870478 --- /dev/null +++ b/examples/resources/stackit_public_ip_associate/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing public ip associate +import { + to = stackit_public_ip_associate.import-example + id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}" +} diff --git a/examples/resources/stackit_public_ip_associate/resource.tf b/examples/resources/stackit_public_ip_associate/resource.tf index a025d0d79..280f60fe1 100644 --- a/examples/resources/stackit_public_ip_associate/resource.tf +++ b/examples/resources/stackit_public_ip_associate/resource.tf @@ -3,9 +3,3 @@ resource "stackit_public_ip_associate" "example" { public_ip_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing public ip associate -import { - to = stackit_public_ip_associate.import-example - id = "${var.project_id},${var.region},${var.public_ip_id},${var.network_interface_id}" -} diff --git a/examples/resources/stackit_rabbitmq_credential/import-by-string-id.tf b/examples/resources/stackit_rabbitmq_credential/import-by-string-id.tf new file mode 100644 index 000000000..d8eddcf7e --- /dev/null +++ b/examples/resources/stackit_rabbitmq_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing rabbitmq credential +import { + to = stackit_rabbitmq_credential.import-example + id = "${var.project_id},${var.rabbitmq_instance_id},${var.rabbitmq_credential_id}" +} diff --git a/examples/resources/stackit_rabbitmq_credential/resource.tf b/examples/resources/stackit_rabbitmq_credential/resource.tf index 0910231a5..ef238431f 100644 --- a/examples/resources/stackit_rabbitmq_credential/resource.tf +++ b/examples/resources/stackit_rabbitmq_credential/resource.tf @@ -14,10 +14,4 @@ resource "stackit_rabbitmq_credential" "example" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing rabbitmq credential -import { - to = stackit_rabbitmq_credential.import-example - id = "${var.project_id},${var.rabbitmq_instance_id},${var.rabbitmq_credential_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_rabbitmq_instance/import-by-string-id.tf b/examples/resources/stackit_rabbitmq_instance/import-by-string-id.tf new file mode 100644 index 000000000..bdbbe1d4f --- /dev/null +++ b/examples/resources/stackit_rabbitmq_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing rabbitmq instance +import { + to = stackit_rabbitmq_instance.import-example + id = "${var.project_id},${var.rabbitmq_instance_id}" +} diff --git a/examples/resources/stackit_rabbitmq_instance/resource.tf b/examples/resources/stackit_rabbitmq_instance/resource.tf index c559de44c..09be14e08 100644 --- a/examples/resources/stackit_rabbitmq_instance/resource.tf +++ b/examples/resources/stackit_rabbitmq_instance/resource.tf @@ -9,10 +9,4 @@ resource "stackit_rabbitmq_instance" "example" { enable_monitoring = false plugins = ["rabbitmq_consistent_hash_exchange", "rabbitmq_federation", "rabbitmq_tracing"] } -} - -# Only use the import statement, if you want to import an existing rabbitmq instance -import { - to = stackit_rabbitmq_instance.import-example - id = "${var.project_id},${var.rabbitmq_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_redis_credential/import-by-string-id.tf b/examples/resources/stackit_redis_credential/import-by-string-id.tf new file mode 100644 index 000000000..ec2106633 --- /dev/null +++ b/examples/resources/stackit_redis_credential/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing redis credential +import { + to = stackit_redis_credential.import-example + id = "${var.project_id},${var.redis_instance_id},${var.redis_credential_id}" +} diff --git a/examples/resources/stackit_redis_credential/resource.tf b/examples/resources/stackit_redis_credential/resource.tf index 10494b396..a79f87f07 100644 --- a/examples/resources/stackit_redis_credential/resource.tf +++ b/examples/resources/stackit_redis_credential/resource.tf @@ -14,10 +14,4 @@ resource "stackit_redis_credential" "example_rotate" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing redis credential -import { - to = stackit_redis_credential.import-example - id = "${var.project_id},${var.redis_instance_id},${var.redis_credential_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_redis_instance/import-by-string-id.tf b/examples/resources/stackit_redis_instance/import-by-string-id.tf new file mode 100644 index 000000000..d855ec91c --- /dev/null +++ b/examples/resources/stackit_redis_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing redis instance +import { + to = stackit_redis_instance.import-example + id = "${var.project_id},${var.redis_instance_id}" +} diff --git a/examples/resources/stackit_redis_instance/resource.tf b/examples/resources/stackit_redis_instance/resource.tf index 6ccb7728b..6fbc60b15 100644 --- a/examples/resources/stackit_redis_instance/resource.tf +++ b/examples/resources/stackit_redis_instance/resource.tf @@ -10,9 +10,3 @@ resource "stackit_redis_instance" "example" { syslog = ["logs4.your-syslog-endpoint.com:54321"] } } - -# Only use the import statement, if you want to import an existing redis instance -import { - to = stackit_redis_instance.import-example - id = "${var.project_id},${var.redis_instance_id}" -} diff --git a/examples/resources/stackit_resourcemanager_folder/import-by-string-id.tf b/examples/resources/stackit_resourcemanager_folder/import-by-string-id.tf new file mode 100644 index 000000000..7e4a5dc18 --- /dev/null +++ b/examples/resources/stackit_resourcemanager_folder/import-by-string-id.tf @@ -0,0 +1,7 @@ +# 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 +} diff --git a/examples/resources/stackit_resourcemanager_folder/resource.tf b/examples/resources/stackit_resourcemanager_folder/resource.tf index d4d782fac..6905b5a78 100644 --- a/examples/resources/stackit_resourcemanager_folder/resource.tf +++ b/examples/resources/stackit_resourcemanager_folder/resource.tf @@ -13,12 +13,4 @@ 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 } \ No newline at end of file diff --git a/examples/resources/stackit_resourcemanager_project/import-by-string-id.tf b/examples/resources/stackit_resourcemanager_project/import-by-string-id.tf new file mode 100644 index 000000000..b14ce4f8f --- /dev/null +++ b/examples/resources/stackit_resourcemanager_project/import-by-string-id.tf @@ -0,0 +1,7 @@ +# Only use the import statement, if you want to import an existing resourcemanager project +# 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_project.import-example + id = var.container_id +} diff --git a/examples/resources/stackit_resourcemanager_project/resource.tf b/examples/resources/stackit_resourcemanager_project/resource.tf index 37bcc4c05..ae2a0d580 100644 --- a/examples/resources/stackit_resourcemanager_project/resource.tf +++ b/examples/resources/stackit_resourcemanager_project/resource.tf @@ -7,11 +7,3 @@ resource "stackit_resourcemanager_project" "example" { } owner_email = "john.doe@stackit.cloud" } - -# Only use the import statement, if you want to import an existing resourcemanager project -# 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_project.import-example - id = var.container_id -} diff --git a/examples/resources/stackit_routing_table/import-by-string-id.tf b/examples/resources/stackit_routing_table/import-by-string-id.tf new file mode 100644 index 000000000..54fd5b7bd --- /dev/null +++ b/examples/resources/stackit_routing_table/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing routing table +import { + to = stackit_routing_table.import-example + id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id}" +} diff --git a/examples/resources/stackit_routing_table/resource.tf b/examples/resources/stackit_routing_table/resource.tf index 180599927..8841401fa 100644 --- a/examples/resources/stackit_routing_table/resource.tf +++ b/examples/resources/stackit_routing_table/resource.tf @@ -6,9 +6,3 @@ resource "stackit_routing_table" "example" { "key" = "value" } } - -# Only use the import statement, if you want to import an existing routing table -import { - to = stackit_routing_table.import-example - id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id}" -} diff --git a/examples/resources/stackit_routing_table_route/import-by-string-id.tf b/examples/resources/stackit_routing_table_route/import-by-string-id.tf new file mode 100644 index 000000000..4d31e28ea --- /dev/null +++ b/examples/resources/stackit_routing_table_route/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing routing table route +import { + to = stackit_routing_table_route.import-example + id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id},${var.routing_table_route_id}" +} diff --git a/examples/resources/stackit_routing_table_route/resource.tf b/examples/resources/stackit_routing_table_route/resource.tf index 78ff9832e..820da2927 100644 --- a/examples/resources/stackit_routing_table_route/resource.tf +++ b/examples/resources/stackit_routing_table_route/resource.tf @@ -13,10 +13,4 @@ resource "stackit_routing_table_route" "example" { labels = { "key" = "value" } -} - -# Only use the import statement, if you want to import an existing routing table route -import { - to = stackit_routing_table_route.import-example - id = "${var.organization_id},${var.region},${var.network_area_id},${var.routing_table_id},${var.routing_table_route_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_scf_organization/import-by-string-id.tf b/examples/resources/stackit_scf_organization/import-by-string-id.tf new file mode 100644 index 000000000..7067c83f9 --- /dev/null +++ b/examples/resources/stackit_scf_organization/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing scf organization +import { + to = stackit_scf_organization.import-example + id = "${var.project_id},${var.region},${var.org_id}" +} diff --git a/examples/resources/stackit_scf_organization/resource.tf b/examples/resources/stackit_scf_organization/resource.tf index fc38820ed..31eb94e78 100644 --- a/examples/resources/stackit_scf_organization/resource.tf +++ b/examples/resources/stackit_scf_organization/resource.tf @@ -10,9 +10,3 @@ resource "stackit_scf_organization" "example" { quota_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" suspended = false } - -# Only use the import statement, if you want to import an existing scf organization -import { - to = stackit_scf_organization.import-example - id = "${var.project_id},${var.region},${var.org_id}" -} diff --git a/examples/resources/stackit_scf_organization_manager/import-by-string-id.tf b/examples/resources/stackit_scf_organization_manager/import-by-string-id.tf new file mode 100644 index 000000000..bc90da1ec --- /dev/null +++ b/examples/resources/stackit_scf_organization_manager/import-by-string-id.tf @@ -0,0 +1,6 @@ +# Only use the import statement, if you want to import an existing scf org user +# The password field is still null after import and must be entered manually in the state. +import { + to = stackit_scf_organization_manager.import-example + id = "${var.project_id},${var.region},${var.org_id},${var.user_id}" +} diff --git a/examples/resources/stackit_scf_organization_manager/resource.tf b/examples/resources/stackit_scf_organization_manager/resource.tf index a16638a6a..9f43e69da 100644 --- a/examples/resources/stackit_scf_organization_manager/resource.tf +++ b/examples/resources/stackit_scf_organization_manager/resource.tf @@ -1,11 +1,4 @@ resource "stackit_scf_organization_manager" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" org_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing scf org user -# The password field is still null after import and must be entered manually in the state. -import { - to = stackit_scf_organization_manager.import-example - id = "${var.project_id},${var.region},${var.org_id},${var.user_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_secretsmanager_instance/import-by-string-id.tf b/examples/resources/stackit_secretsmanager_instance/import-by-string-id.tf new file mode 100644 index 000000000..d6a4a5085 --- /dev/null +++ b/examples/resources/stackit_secretsmanager_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing secretsmanager instance +import { + to = stackit_secretsmanager_instance.import-example + id = "${var.project_id},${var.secret_instance_id}" +} diff --git a/examples/resources/stackit_secretsmanager_instance/resource.tf b/examples/resources/stackit_secretsmanager_instance/resource.tf index 1ece81cc7..90ea49fe4 100644 --- a/examples/resources/stackit_secretsmanager_instance/resource.tf +++ b/examples/resources/stackit_secretsmanager_instance/resource.tf @@ -2,10 +2,4 @@ resource "stackit_secretsmanager_instance" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-instance" acls = ["XXX.XXX.XXX.X/XX", "XX.XXX.XX.X/XX"] -} - -# Only use the import statement, if you want to import an existing secretsmanager instance -import { - to = stackit_secretsmanager_instance.import-example - id = "${var.project_id},${var.secret_instance_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_secretsmanager_user/import-by-string-id.tf b/examples/resources/stackit_secretsmanager_user/import-by-string-id.tf new file mode 100644 index 000000000..8f0097bf5 --- /dev/null +++ b/examples/resources/stackit_secretsmanager_user/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing secretsmanager user +import { + to = stackit_secretsmanager_user.import-example + id = "${var.project_id},${var.secret_instance_id},${var.secret_user_id}" +} diff --git a/examples/resources/stackit_secretsmanager_user/resource.tf b/examples/resources/stackit_secretsmanager_user/resource.tf index b49258be0..40810ff6f 100644 --- a/examples/resources/stackit_secretsmanager_user/resource.tf +++ b/examples/resources/stackit_secretsmanager_user/resource.tf @@ -19,9 +19,3 @@ resource "stackit_secretsmanager_user" "example_rotate" { rotation = time_rotating.rotate.id } } - -# Only use the import statement, if you want to import an existing secretsmanager user -import { - to = stackit_secretsmanager_user.import-example - id = "${var.project_id},${var.secret_instance_id},${var.secret_user_id}" -} diff --git a/examples/resources/stackit_security_group/import-by-string-id.tf b/examples/resources/stackit_security_group/import-by-string-id.tf new file mode 100644 index 000000000..037cd38fb --- /dev/null +++ b/examples/resources/stackit_security_group/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing security group +import { + to = stackit_security_group.import-example + id = "${var.project_id},${var.region},${var.security_group_id}" +} diff --git a/examples/resources/stackit_security_group/resource.tf b/examples/resources/stackit_security_group/resource.tf index bdfbaed91..30c015d5d 100644 --- a/examples/resources/stackit_security_group/resource.tf +++ b/examples/resources/stackit_security_group/resource.tf @@ -4,10 +4,4 @@ resource "stackit_security_group" "example" { labels = { "key" = "value" } -} - -# Only use the import statement, if you want to import an existing security group -import { - to = stackit_security_group.import-example - id = "${var.project_id},${var.region},${var.security_group_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_security_group_rule/import-by-string-id.tf b/examples/resources/stackit_security_group_rule/import-by-string-id.tf new file mode 100644 index 000000000..65ea7596d --- /dev/null +++ b/examples/resources/stackit_security_group_rule/import-by-string-id.tf @@ -0,0 +1,7 @@ +# Only use the import statement, if you want to import an existing security group rule +# Note: There will be a conflict which needs to be resolved manually. +# Attribute "protocol.number" cannot be specified when "protocol.name" is specified. +import { + to = stackit_security_group_rule.import-example + id = "${var.project_id},${var.region},${var.security_group_id},${var.security_group_rule_id}" +} diff --git a/examples/resources/stackit_security_group_rule/resource.tf b/examples/resources/stackit_security_group_rule/resource.tf index d09c49491..2061647ad 100644 --- a/examples/resources/stackit_security_group_rule/resource.tf +++ b/examples/resources/stackit_security_group_rule/resource.tf @@ -9,12 +9,4 @@ resource "stackit_security_group_rule" "example" { protocol = { name = "icmp" } -} - -# Only use the import statement, if you want to import an existing security group rule -# Note: There will be a conflict which needs to be resolved manually. -# Attribute "protocol.number" cannot be specified when "protocol.name" is specified. -import { - to = stackit_security_group_rule.import-example - id = "${var.project_id},${var.region},${var.security_group_id},${var.security_group_rule_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_server/import-by-string-id.tf b/examples/resources/stackit_server/import-by-string-id.tf new file mode 100644 index 000000000..546525c08 --- /dev/null +++ b/examples/resources/stackit_server/import-by-string-id.tf @@ -0,0 +1,12 @@ +# Only use the import statement, if you want to import an existing server +# Note: There will be a conflict which needs to be resolved manually. +# Must set a configuration value for the boot_volume.source_type and boot_volume.source_id attribute as the provider has marked it as required. +# Since those attributes are not fetched in general from the API call, after adding them this would replace your server resource after an terraform apply. +# In order to prevent this you need to add: +# lifecycle { +# ignore_changes = [ boot_volume ] +# } +import { + to = stackit_server.import-example + id = "${var.project_id},${var.region},${var.server_id}" +} diff --git a/examples/resources/stackit_server/resource.tf b/examples/resources/stackit_server/resource.tf index e45631ddf..0c4751d77 100644 --- a/examples/resources/stackit_server/resource.tf +++ b/examples/resources/stackit_server/resource.tf @@ -11,17 +11,4 @@ resource "stackit_server" "example" { network_interfaces = [ stackit_network_interface.example.network_interface_id ] -} - -# Only use the import statement, if you want to import an existing server -# Note: There will be a conflict which needs to be resolved manually. -# Must set a configuration value for the boot_volume.source_type and boot_volume.source_id attribute as the provider has marked it as required. -# Since those attributes are not fetched in general from the API call, after adding them this would replace your server resource after an terraform apply. -# In order to prevent this you need to add: -# lifecycle { -# ignore_changes = [ boot_volume ] -# } -import { - to = stackit_server.import-example - id = "${var.project_id},${var.region},${var.server_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_server_backup_schedule/import-by-string-id.tf b/examples/resources/stackit_server_backup_schedule/import-by-string-id.tf new file mode 100644 index 000000000..d504ec761 --- /dev/null +++ b/examples/resources/stackit_server_backup_schedule/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing server backup schedule +import { + to = stackit_server_backup_schedule.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.server_backup_schedule_id}" +} diff --git a/examples/resources/stackit_server_backup_schedule/resource.tf b/examples/resources/stackit_server_backup_schedule/resource.tf index 36036128e..483a5a14e 100644 --- a/examples/resources/stackit_server_backup_schedule/resource.tf +++ b/examples/resources/stackit_server_backup_schedule/resource.tf @@ -17,10 +17,4 @@ resource "stackit_server_backup_schedule" "example" { resource "stackit_server_backup_enable" "enable" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing server backup schedule -import { - to = stackit_server_backup_schedule.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.server_backup_schedule_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_server_network_interface_attach/import-by-string-id.tf b/examples/resources/stackit_server_network_interface_attach/import-by-string-id.tf new file mode 100644 index 000000000..497fa45f8 --- /dev/null +++ b/examples/resources/stackit_server_network_interface_attach/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing server network interface attachment +import { + to = stackit_server_network_interface_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.network_interface_id}" +} diff --git a/examples/resources/stackit_server_network_interface_attach/resource.tf b/examples/resources/stackit_server_network_interface_attach/resource.tf index 054421ddc..9f29f7268 100644 --- a/examples/resources/stackit_server_network_interface_attach/resource.tf +++ b/examples/resources/stackit_server_network_interface_attach/resource.tf @@ -2,10 +2,4 @@ resource "stackit_server_network_interface_attach" "attached_network_interface" project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" network_interface_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing server network interface attachment -import { - to = stackit_server_network_interface_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.network_interface_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_server_service_account_attach/import-by-string-id.tf b/examples/resources/stackit_server_service_account_attach/import-by-string-id.tf new file mode 100644 index 000000000..f53b5f9bb --- /dev/null +++ b/examples/resources/stackit_server_service_account_attach/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing server service account attachment +import { + to = stackit_server_service_account_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.service_account_email}" +} diff --git a/examples/resources/stackit_server_service_account_attach/resource.tf b/examples/resources/stackit_server_service_account_attach/resource.tf index 0658f55d0..0ddc442e2 100644 --- a/examples/resources/stackit_server_service_account_attach/resource.tf +++ b/examples/resources/stackit_server_service_account_attach/resource.tf @@ -2,10 +2,4 @@ resource "stackit_server_service_account_attach" "attached_service_account" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" service_account_email = "service-account@stackit.cloud" -} - -# Only use the import statement, if you want to import an existing server service account attachment -import { - to = stackit_server_service_account_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.service_account_email}" } \ No newline at end of file diff --git a/examples/resources/stackit_server_update_schedule/import-by-string-id.tf b/examples/resources/stackit_server_update_schedule/import-by-string-id.tf new file mode 100644 index 000000000..a2f0ff813 --- /dev/null +++ b/examples/resources/stackit_server_update_schedule/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing server update schedule +import { + to = stackit_server_update_schedule.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.server_update_schedule_id}" +} diff --git a/examples/resources/stackit_server_update_schedule/resource.tf b/examples/resources/stackit_server_update_schedule/resource.tf index bd905be1c..087d59f31 100644 --- a/examples/resources/stackit_server_update_schedule/resource.tf +++ b/examples/resources/stackit_server_update_schedule/resource.tf @@ -13,10 +13,4 @@ resource "stackit_server_update_schedule" "example" { resource "stackit_server_update_enable" "enable" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing server update schedule -import { - to = stackit_server_update_schedule.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.server_update_schedule_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_server_volume_attach/import-by-string-id.tf b/examples/resources/stackit_server_volume_attach/import-by-string-id.tf new file mode 100644 index 000000000..f0b13fce2 --- /dev/null +++ b/examples/resources/stackit_server_volume_attach/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing server volume attachment +import { + to = stackit_server_volume_attach.import-example + id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}" +} diff --git a/examples/resources/stackit_server_volume_attach/resource.tf b/examples/resources/stackit_server_volume_attach/resource.tf index a503eabe7..a057edce5 100644 --- a/examples/resources/stackit_server_volume_attach/resource.tf +++ b/examples/resources/stackit_server_volume_attach/resource.tf @@ -2,10 +2,4 @@ resource "stackit_server_volume_attach" "attached_volume" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" server_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" volume_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing server volume attachment -import { - to = stackit_server_volume_attach.import-example - id = "${var.project_id},${var.region},${var.server_id},${var.volume_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_service_account/import-by-string-id.tf b/examples/resources/stackit_service_account/import-by-string-id.tf new file mode 100644 index 000000000..c447dc87d --- /dev/null +++ b/examples/resources/stackit_service_account/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing service account +import { + to = stackit_service_account.import-example + id = "${var.project_id},${var.service_account_email}" +} diff --git a/examples/resources/stackit_service_account/resource.tf b/examples/resources/stackit_service_account/resource.tf index 988cf345a..bd2b5d3b5 100644 --- a/examples/resources/stackit_service_account/resource.tf +++ b/examples/resources/stackit_service_account/resource.tf @@ -1,10 +1,4 @@ resource "stackit_service_account" "sa" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "sa01" -} - -# Only use the import statement, if you want to import an existing service account -import { - to = stackit_service_account.import-example - id = "${var.project_id},${var.service_account_email}" } \ No newline at end of file diff --git a/examples/resources/stackit_service_account_federated_identity_provider/import-by-string-id.tf b/examples/resources/stackit_service_account_federated_identity_provider/import-by-string-id.tf new file mode 100644 index 000000000..4d55a0d11 --- /dev/null +++ b/examples/resources/stackit_service_account_federated_identity_provider/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing federated identity provider +import { + to = stackit_service_account_federated_identity_provider.import-example + id = "${var.project_id},${var.service_account_email},${var.federation_id}" +} diff --git a/examples/resources/stackit_service_account_federated_identity_provider/resource.tf b/examples/resources/stackit_service_account_federated_identity_provider/resource.tf index 4a6d44a84..677c90931 100644 --- a/examples/resources/stackit_service_account_federated_identity_provider/resource.tf +++ b/examples/resources/stackit_service_account_federated_identity_provider/resource.tf @@ -22,9 +22,3 @@ resource "stackit_service_account_federated_identity_provider" "provider" { } ] } - -# Only use the import statement, if you want to import an existing federated identity provider -import { - to = stackit_service_account_federated_identity_provider.import-example - id = "${var.project_id},${var.service_account_email},${var.federation_id}" -} diff --git a/examples/resources/stackit_sfs_export_policy/import-by-string-id.tf b/examples/resources/stackit_sfs_export_policy/import-by-string-id.tf new file mode 100644 index 000000000..082960c63 --- /dev/null +++ b/examples/resources/stackit_sfs_export_policy/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing export policy +import { + to = stackit_sfs_export_policy.example + id = "${var.project_id},${var.region},${var.policy_id}" +} diff --git a/examples/resources/stackit_sfs_export_policy/resource.tf b/examples/resources/stackit_sfs_export_policy/resource.tf index 1ad284ac2..a467588f9 100644 --- a/examples/resources/stackit_sfs_export_policy/resource.tf +++ b/examples/resources/stackit_sfs_export_policy/resource.tf @@ -11,9 +11,3 @@ resource "stackit_sfs_export_policy" "example" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing export policy -import { - to = stackit_sfs_export_policy.example - id = "${var.project_id},${var.region},${var.policy_id}" -} diff --git a/examples/resources/stackit_sfs_project_lock/import-by-string-id.tf b/examples/resources/stackit_sfs_project_lock/import-by-string-id.tf new file mode 100644 index 000000000..2ef35c669 --- /dev/null +++ b/examples/resources/stackit_sfs_project_lock/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing project lock +import { + to = stackit_sfs_project_lock.example + id = "${var.project_id},${var.region}" +} diff --git a/examples/resources/stackit_sfs_project_lock/resource.tf b/examples/resources/stackit_sfs_project_lock/resource.tf index 8c9ba9d86..b35942308 100644 --- a/examples/resources/stackit_sfs_project_lock/resource.tf +++ b/examples/resources/stackit_sfs_project_lock/resource.tf @@ -1,9 +1,3 @@ resource "stackit_sfs_project_lock" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -} - -# Only use the import statement, if you want to import an existing project lock -import { - to = stackit_sfs_project_lock.example - id = "${var.project_id},${var.region}" } \ No newline at end of file diff --git a/examples/resources/stackit_sfs_resource_pool/import-by-string-id.tf b/examples/resources/stackit_sfs_resource_pool/import-by-string-id.tf new file mode 100644 index 000000000..2cc7334bb --- /dev/null +++ b/examples/resources/stackit_sfs_resource_pool/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing resource pool +import { + to = stackit_sfs_resource_pool.resourcepool + id = "${var.project_id},${var.region},${var.resource_pool_id}" +} diff --git a/examples/resources/stackit_sfs_resource_pool/resource.tf b/examples/resources/stackit_sfs_resource_pool/resource.tf index f63b55a9d..d0297f1fa 100644 --- a/examples/resources/stackit_sfs_resource_pool/resource.tf +++ b/examples/resources/stackit_sfs_resource_pool/resource.tf @@ -13,9 +13,3 @@ resource "stackit_sfs_resource_pool" "resourcepool" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing resource pool -import { - to = stackit_sfs_resource_pool.resourcepool - id = "${var.project_id},${var.region},${var.resource_pool_id}" -} diff --git a/examples/resources/stackit_sfs_share/import-by-string-id.tf b/examples/resources/stackit_sfs_share/import-by-string-id.tf new file mode 100644 index 000000000..df673c989 --- /dev/null +++ b/examples/resources/stackit_sfs_share/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing sfs share +import { + to = stackit_sfs_resource_pool.resourcepool + id = "${var.project_id},${var.region},${var.resource_pool_id},${var.share_id}" +} diff --git a/examples/resources/stackit_sfs_share/resource.tf b/examples/resources/stackit_sfs_share/resource.tf index 39741cd6f..30902bec9 100644 --- a/examples/resources/stackit_sfs_share/resource.tf +++ b/examples/resources/stackit_sfs_share/resource.tf @@ -8,9 +8,3 @@ resource "stackit_sfs_share" "example" { "foo" = "bar" } } - -# Only use the import statement, if you want to import an existing sfs share -import { - to = stackit_sfs_resource_pool.resourcepool - id = "${var.project_id},${var.region},${var.resource_pool_id},${var.share_id}" -} diff --git a/examples/resources/stackit_ske_cluster/import-by-string-id.tf b/examples/resources/stackit_ske_cluster/import-by-string-id.tf new file mode 100644 index 000000000..76ff7cbcf --- /dev/null +++ b/examples/resources/stackit_ske_cluster/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing ske cluster +import { + to = stackit_ske_cluster.import-example + id = "${var.project_id},${var.region},${var.ske_name}" +} diff --git a/examples/resources/stackit_ske_cluster/resource.tf b/examples/resources/stackit_ske_cluster/resource.tf index 07ac39f38..36f980f06 100644 --- a/examples/resources/stackit_ske_cluster/resource.tf +++ b/examples/resources/stackit_ske_cluster/resource.tf @@ -26,10 +26,4 @@ resource "stackit_ske_cluster" "example" { access_scope = "PUBLIC" } } -} - -# Only use the import statement, if you want to import an existing ske cluster -import { - to = stackit_ske_cluster.import-example - id = "${var.project_id},${var.region},${var.ske_name}" } \ No newline at end of file diff --git a/examples/resources/stackit_sqlserverflex_instance/import-by-string-id.tf b/examples/resources/stackit_sqlserverflex_instance/import-by-string-id.tf new file mode 100644 index 000000000..653ca8e2a --- /dev/null +++ b/examples/resources/stackit_sqlserverflex_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing sqlserverflex instance +import { + to = stackit_sqlserverflex_instance.import-example + id = "${var.project_id},${var.region},${var.sql_instance_id}" +} diff --git a/examples/resources/stackit_sqlserverflex_instance/resource.tf b/examples/resources/stackit_sqlserverflex_instance/resource.tf index 9a0a7cd05..463e36fa0 100644 --- a/examples/resources/stackit_sqlserverflex_instance/resource.tf +++ b/examples/resources/stackit_sqlserverflex_instance/resource.tf @@ -13,9 +13,3 @@ resource "stackit_sqlserverflex_instance" "example" { } version = 2022 } - -# Only use the import statement, if you want to import an existing sqlserverflex instance -import { - to = stackit_sqlserverflex_instance.import-example - id = "${var.project_id},${var.region},${var.sql_instance_id}" -} diff --git a/examples/resources/stackit_sqlserverflex_user/import-by-string-id.tf b/examples/resources/stackit_sqlserverflex_user/import-by-string-id.tf new file mode 100644 index 000000000..3889ed4b7 --- /dev/null +++ b/examples/resources/stackit_sqlserverflex_user/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing sqlserverflex user +import { + to = stackit_sqlserverflex_user.import-example + id = "${var.project_id},${var.region},${var.sql_instance_id},${var.sql_user_id}" +} diff --git a/examples/resources/stackit_sqlserverflex_user/resource.tf b/examples/resources/stackit_sqlserverflex_user/resource.tf index ce2bfad32..ee5d5aa7d 100644 --- a/examples/resources/stackit_sqlserverflex_user/resource.tf +++ b/examples/resources/stackit_sqlserverflex_user/resource.tf @@ -18,10 +18,4 @@ resource "stackit_sqlserverflex_user" "example_rotate" { rotate_when_changed = { rotation = time_rotating.rotate.id } -} - -# Only use the import statement, if you want to import an existing sqlserverflex user -import { - to = stackit_sqlserverflex_user.import-example - id = "${var.project_id},${var.region},${var.sql_instance_id},${var.sql_user_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_telemetrylink/import-by-string-id.tf b/examples/resources/stackit_telemetrylink/import-by-string-id.tf new file mode 100644 index 000000000..68c2caac2 --- /dev/null +++ b/examples/resources/stackit_telemetrylink/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing TelemetryLink +import { + to = stackit_telemetrylink.import-example + id = "${var.resource_type},${var.resource_id},${var.region}" +} diff --git a/examples/resources/stackit_telemetrylink/resource.tf b/examples/resources/stackit_telemetrylink/resource.tf index 5d03433a2..56de5c17d 100644 --- a/examples/resources/stackit_telemetrylink/resource.tf +++ b/examples/resources/stackit_telemetrylink/resource.tf @@ -16,9 +16,3 @@ resource "stackit_telemetrylink" "link2" { access_token = "eyJxxx" telemetry_router_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } - -# Only use the import statement, if you want to import an existing TelemetryLink -import { - to = stackit_telemetrylink.import-example - id = "${var.resource_type},${var.resource_id},${var.region}" -} diff --git a/examples/resources/stackit_telemetryrouter_access_token/import-by-string-id.tf b/examples/resources/stackit_telemetryrouter_access_token/import-by-string-id.tf new file mode 100644 index 000000000..b2e5a0df5 --- /dev/null +++ b/examples/resources/stackit_telemetryrouter_access_token/import-by-string-id.tf @@ -0,0 +1,6 @@ +# Only use the import statement, if you want to import an existing TelemetryRouter access token +# Note: The generated access token is only available upon creation. +import { + to = stackit_telemetryrouter_access_token.import-example + id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.telemetryrouter_access_token_id}" +} diff --git a/examples/resources/stackit_telemetryrouter_access_token/resource.tf b/examples/resources/stackit_telemetryrouter_access_token/resource.tf index 53136eba6..7c36af5fe 100644 --- a/examples/resources/stackit_telemetryrouter_access_token/resource.tf +++ b/examples/resources/stackit_telemetryrouter_access_token/resource.tf @@ -12,11 +12,4 @@ resource "stackit_telemetryrouter_access_token" "accessToken2" { display_name = "telemetryrouter-access-token-example" ttl = 30 description = "Example description" -} - -# Only use the import statement, if you want to import an existing TelemetryRouter access token -# Note: The generated access token is only available upon creation. -import { - to = stackit_telemetryrouter_access_token.import-example - id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.telemetryrouter_access_token_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_telemetryrouter_destination/import-by-string-id.tf b/examples/resources/stackit_telemetryrouter_destination/import-by-string-id.tf new file mode 100644 index 000000000..fc9ae693f --- /dev/null +++ b/examples/resources/stackit_telemetryrouter_destination/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing TelemetryRouter destination +import { + to = stackit_telemetryrouter_destination.import-example + id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.destination_id}" +} diff --git a/examples/resources/stackit_telemetryrouter_destination/resource.tf b/examples/resources/stackit_telemetryrouter_destination/resource.tf index 37ebcb3d2..1d79cc8d4 100644 --- a/examples/resources/stackit_telemetryrouter_destination/resource.tf +++ b/examples/resources/stackit_telemetryrouter_destination/resource.tf @@ -65,9 +65,3 @@ resource "stackit_telemetryrouter_destination" "otlp" { } } } - -# Only use the import statement, if you want to import an existing TelemetryRouter destination -import { - to = stackit_telemetryrouter_destination.import-example - id = "${var.project_id},${var.region},${var.telemetryrouter_instance_id},${var.destination_id}" -} diff --git a/examples/resources/stackit_telemetryrouter_instance/import-by-string-id.tf b/examples/resources/stackit_telemetryrouter_instance/import-by-string-id.tf new file mode 100644 index 000000000..67563ab3f --- /dev/null +++ b/examples/resources/stackit_telemetryrouter_instance/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing TelemetryRouter instance +import { + to = stackit_telemetryrouter_instance.import-example + id = "${var.project_id},${var.region},${var.router_instance_id}" +} diff --git a/examples/resources/stackit_telemetryrouter_instance/resource.tf b/examples/resources/stackit_telemetryrouter_instance/resource.tf index 944cdb07f..abd2ee463 100644 --- a/examples/resources/stackit_telemetryrouter_instance/resource.tf +++ b/examples/resources/stackit_telemetryrouter_instance/resource.tf @@ -26,9 +26,3 @@ resource "stackit_telemetryrouter_instance" "router2" { ] } } - -# Only use the import statement, if you want to import an existing TelemetryRouter instance -import { - to = stackit_telemetryrouter_instance.import-example - id = "${var.project_id},${var.region},${var.router_instance_id}" -} diff --git a/examples/resources/stackit_volume/import-by-string-id.tf b/examples/resources/stackit_volume/import-by-string-id.tf new file mode 100644 index 000000000..35a602b8b --- /dev/null +++ b/examples/resources/stackit_volume/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing volume +import { + to = stackit_volume.import-example + id = "${var.project_id},${var.region},${var.volume_id}" +} diff --git a/examples/resources/stackit_volume/resource.tf b/examples/resources/stackit_volume/resource.tf index 7a5c28ec5..b598fcf7a 100644 --- a/examples/resources/stackit_volume/resource.tf +++ b/examples/resources/stackit_volume/resource.tf @@ -6,10 +6,4 @@ resource "stackit_volume" "example" { labels = { "key" = "value" } -} - -# Only use the import statement, if you want to import an existing volume -import { - to = stackit_volume.import-example - id = "${var.project_id},${var.region},${var.volume_id}" } \ No newline at end of file diff --git a/examples/resources/stackit_vpn_connection/import-by-string-id.tf b/examples/resources/stackit_vpn_connection/import-by-string-id.tf new file mode 100644 index 000000000..6ee458842 --- /dev/null +++ b/examples/resources/stackit_vpn_connection/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing VPN connection +import { + to = stackit_vpn_connection.example + id = "${var.project_id},${var.region},${var.gateway_id},${var.connection_id}" +} diff --git a/examples/resources/stackit_vpn_connection/resource.tf b/examples/resources/stackit_vpn_connection/resource.tf index fc347e71c..2b5de4591 100644 --- a/examples/resources/stackit_vpn_connection/resource.tf +++ b/examples/resources/stackit_vpn_connection/resource.tf @@ -37,9 +37,3 @@ resource "stackit_vpn_connection" "example" { } } } - -# Only use the import statement, if you want to import an existing VPN connection -import { - to = stackit_vpn_connection.example - id = "${var.project_id},${var.region},${var.gateway_id},${var.connection_id}" -} diff --git a/examples/resources/stackit_vpn_gateway/import-by-string-id.tf b/examples/resources/stackit_vpn_gateway/import-by-string-id.tf new file mode 100644 index 000000000..545e36c92 --- /dev/null +++ b/examples/resources/stackit_vpn_gateway/import-by-string-id.tf @@ -0,0 +1,5 @@ +# Only use the import statement, if you want to import an existing VPN gateway +import { + to = stackit_vpn_gateway.example + id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" +} diff --git a/examples/resources/stackit_vpn_gateway/resource.tf b/examples/resources/stackit_vpn_gateway/resource.tf index 1244b87eb..08c918668 100644 --- a/examples/resources/stackit_vpn_gateway/resource.tf +++ b/examples/resources/stackit_vpn_gateway/resource.tf @@ -9,9 +9,3 @@ resource "stackit_vpn_gateway" "example" { tunnel2 = "eu01-2" } } - -# Only use the import statement, if you want to import an existing VPN gateway -import { - to = stackit_vpn_gateway.example - id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,eu01,xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -}