From 11c4fba12372aa4678f9e0cd970618d6f46cd680 Mon Sep 17 00:00:00 2001 From: paulxll Date: Thu, 6 Mar 2025 17:39:04 +0900 Subject: [PATCH] add import block example --- .../resources/bigquery_datamart_definition.md | 11 +++++++ docs/resources/connection.md | 11 +++++++ docs/resources/job_definition.md | 11 +++++++ docs/resources/label.md | 15 +++++++++- docs/resources/pipeline_definition.md | 11 +++++++ docs/resources/resource_group.md | 16 +++++++++- docs/resources/team.md | 16 +++++++++- docs/resources/user.md | 15 +++++++++- .../import.tf | 4 +++ .../resources/trocco_connection/import.tf | 4 +++ .../resources/trocco_job_definition/import.tf | 4 +++ examples/resources/trocco_label/import.tf | 4 +++ .../trocco_pipeline_definition/import.tf | 4 +++ .../resources/trocco_resource_group/import.tf | 4 +++ examples/resources/trocco_team/import.tf | 4 +++ examples/resources/trocco_user/import.tf | 4 +++ .../bigquery_datamart_definition.md.tmpl | 6 ++++ templates/resources/connection.md.tmpl | 6 ++++ templates/resources/job_definition.md.tmpl | 6 ++++ templates/resources/label.md.tmpl | 29 +++++++++++++++++++ .../resources/pipeline_definition.md.tmpl | 6 ++++ templates/resources/resource_group.md.tmpl | 29 +++++++++++++++++++ templates/resources/team.md.tmpl | 29 +++++++++++++++++++ templates/resources/user.md.tmpl | 29 +++++++++++++++++++ 24 files changed, 274 insertions(+), 4 deletions(-) create mode 100644 examples/resources/trocco_bigquery_datamart_definition/import.tf create mode 100644 examples/resources/trocco_connection/import.tf create mode 100644 examples/resources/trocco_job_definition/import.tf create mode 100644 examples/resources/trocco_label/import.tf create mode 100644 examples/resources/trocco_pipeline_definition/import.tf create mode 100644 examples/resources/trocco_resource_group/import.tf create mode 100644 examples/resources/trocco_team/import.tf create mode 100644 examples/resources/trocco_user/import.tf create mode 100644 templates/resources/label.md.tmpl create mode 100644 templates/resources/resource_group.md.tmpl create mode 100644 templates/resources/team.md.tmpl create mode 100644 templates/resources/user.md.tmpl diff --git a/docs/resources/bigquery_datamart_definition.md b/docs/resources/bigquery_datamart_definition.md index c33555ff..38361aea 100644 --- a/docs/resources/bigquery_datamart_definition.md +++ b/docs/resources/bigquery_datamart_definition.md @@ -292,6 +292,17 @@ Optional: Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_bigquery_datamart_definition (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_bigquery_datamart_definition.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_bigquery_datamart_definition.example ``` diff --git a/docs/resources/connection.md b/docs/resources/connection.md index d9cc6af7..8825117e 100644 --- a/docs/resources/connection.md +++ b/docs/resources/connection.md @@ -314,6 +314,17 @@ resource "trocco_connection" "postgresql" { Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_connection (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_connection.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_connection.example , ``` diff --git a/docs/resources/job_definition.md b/docs/resources/job_definition.md index eb1357fe..fad7d508 100644 --- a/docs/resources/job_definition.md +++ b/docs/resources/job_definition.md @@ -2457,6 +2457,17 @@ Optional: Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_job_definition (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_job_definition.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_job_definition.example ``` diff --git a/docs/resources/label.md b/docs/resources/label.md index 66ff72c1..7bda4892 100644 --- a/docs/resources/label.md +++ b/docs/resources/label.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "trocco_label Resource - trocco" subcategory: "" description: |- @@ -36,10 +35,24 @@ resource "trocco_label" "example" { - `id` (Number) The ID of the label. + + ## Import Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_label (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_label.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_label.example ``` + diff --git a/docs/resources/pipeline_definition.md b/docs/resources/pipeline_definition.md index 75b62d96..48f87e81 100644 --- a/docs/resources/pipeline_definition.md +++ b/docs/resources/pipeline_definition.md @@ -1656,6 +1656,17 @@ Required: Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_pipeline_definition (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_pipeline_definition.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_pipeline_definition.example ``` diff --git a/docs/resources/resource_group.md b/docs/resources/resource_group.md index e1b84a14..e0455803 100644 --- a/docs/resources/resource_group.md +++ b/docs/resources/resource_group.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "trocco_resource_group Resource - trocco" subcategory: "" description: |- @@ -53,10 +52,25 @@ Required: - `role` (String) The role of the team. Valid values are `administrator`, `editor`, `operator`, `viewer`. - `team_id` (Number) The team ID of the role. + + + ## Import Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_resource_group (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_resource_group.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_resource.import_resource_group ``` + diff --git a/docs/resources/team.md b/docs/resources/team.md index 52cb5962..5d320ba4 100644 --- a/docs/resources/team.md +++ b/docs/resources/team.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "trocco_team Resource - trocco" subcategory: "" description: |- @@ -53,10 +52,25 @@ Required: - `role` (String) The role of the team member. Valid values are `team_admin` or `team_member`. - `user_id` (Number) The user ID of the team member. + + + ## Import Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_team (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_resource_group.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_team.import_team ``` + diff --git a/docs/resources/user.md b/docs/resources/user.md index 2b69e129..37d55993 100644 --- a/docs/resources/user.md +++ b/docs/resources/user.md @@ -1,5 +1,4 @@ --- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "trocco_user Resource - trocco" subcategory: "" description: |- @@ -40,10 +39,24 @@ resource "trocco_user" "example" { - `id` (Number) The ID of the user. + + ## Import Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import trocco_user (Resource). For example: + +```terraform +import { + id = 1 + to = trocco_user.example +} +``` + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + ```shell terraform import trocco_user.example ``` + diff --git a/examples/resources/trocco_bigquery_datamart_definition/import.tf b/examples/resources/trocco_bigquery_datamart_definition/import.tf new file mode 100644 index 00000000..07333f25 --- /dev/null +++ b/examples/resources/trocco_bigquery_datamart_definition/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_bigquery_datamart_definition.example +} diff --git a/examples/resources/trocco_connection/import.tf b/examples/resources/trocco_connection/import.tf new file mode 100644 index 00000000..88a05cb8 --- /dev/null +++ b/examples/resources/trocco_connection/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_connection.example +} diff --git a/examples/resources/trocco_job_definition/import.tf b/examples/resources/trocco_job_definition/import.tf new file mode 100644 index 00000000..3d6008ae --- /dev/null +++ b/examples/resources/trocco_job_definition/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_job_definition.example +} diff --git a/examples/resources/trocco_label/import.tf b/examples/resources/trocco_label/import.tf new file mode 100644 index 00000000..80e4342c --- /dev/null +++ b/examples/resources/trocco_label/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_label.example +} diff --git a/examples/resources/trocco_pipeline_definition/import.tf b/examples/resources/trocco_pipeline_definition/import.tf new file mode 100644 index 00000000..0ede8edd --- /dev/null +++ b/examples/resources/trocco_pipeline_definition/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_pipeline_definition.example +} diff --git a/examples/resources/trocco_resource_group/import.tf b/examples/resources/trocco_resource_group/import.tf new file mode 100644 index 00000000..aaf2309f --- /dev/null +++ b/examples/resources/trocco_resource_group/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_resource_group.example +} diff --git a/examples/resources/trocco_team/import.tf b/examples/resources/trocco_team/import.tf new file mode 100644 index 00000000..aaf2309f --- /dev/null +++ b/examples/resources/trocco_team/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_resource_group.example +} diff --git a/examples/resources/trocco_user/import.tf b/examples/resources/trocco_user/import.tf new file mode 100644 index 00000000..ed6d1572 --- /dev/null +++ b/examples/resources/trocco_user/import.tf @@ -0,0 +1,4 @@ +import { + id = 1 + to = trocco_user.example +} diff --git a/templates/resources/bigquery_datamart_definition.md.tmpl b/templates/resources/bigquery_datamart_definition.md.tmpl index e6dc0921..a2a4d91a 100644 --- a/templates/resources/bigquery_datamart_definition.md.tmpl +++ b/templates/resources/bigquery_datamart_definition.md.tmpl @@ -45,5 +45,11 @@ description: |- Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_bigquery_datamart_definition/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + {{codefile "shell" "examples/resources/trocco_bigquery_datamart_definition/import.sh"}} diff --git a/templates/resources/connection.md.tmpl b/templates/resources/connection.md.tmpl index dfb57451..abd8b62f 100644 --- a/templates/resources/connection.md.tmpl +++ b/templates/resources/connection.md.tmpl @@ -49,5 +49,11 @@ description: |- Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_connection/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + {{codefile "shell" "examples/resources/trocco_connection/import.sh"}} diff --git a/templates/resources/job_definition.md.tmpl b/templates/resources/job_definition.md.tmpl index 871a2456..6943669c 100644 --- a/templates/resources/job_definition.md.tmpl +++ b/templates/resources/job_definition.md.tmpl @@ -153,5 +153,11 @@ Minimum configuration Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_job_definition/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + {{codefile "shell" "examples/resources/trocco_job_definition/import.sh"}} diff --git a/templates/resources/label.md.tmpl b/templates/resources/label.md.tmpl new file mode 100644 index 00000000..30d253f9 --- /dev/null +++ b/templates/resources/label.md.tmpl @@ -0,0 +1,29 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderShortName}}" +subcategory: "" +description: |- + {{.Description}} +--- + +# {{.Name}} ({{.Type}}) + +{{.Description}} + +## Example Usage + +{{codefile "terraform" "examples/resources/trocco_label/resource.tf"}} + +{{.SchemaMarkdown}} + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_label/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + +{{codefile "shell" "examples/resources/trocco_label/import.sh"}} + diff --git a/templates/resources/pipeline_definition.md.tmpl b/templates/resources/pipeline_definition.md.tmpl index 079c9276..ba76f9ee 100644 --- a/templates/resources/pipeline_definition.md.tmpl +++ b/templates/resources/pipeline_definition.md.tmpl @@ -99,5 +99,11 @@ description: |- Import is supported using the following syntax: +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_pipeline_definition/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + {{codefile "shell" "examples/resources/trocco_pipeline_definition/import.sh"}} diff --git a/templates/resources/resource_group.md.tmpl b/templates/resources/resource_group.md.tmpl new file mode 100644 index 00000000..4fc07bf4 --- /dev/null +++ b/templates/resources/resource_group.md.tmpl @@ -0,0 +1,29 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderShortName}}" +subcategory: "" +description: |- + {{.Description}} +--- + +# {{.Name}} ({{.Type}}) + +{{.Description}} + +## Example Usage + +{{codefile "terraform" "examples/resources/trocco_resource_group/resource.tf"}} + +{{.SchemaMarkdown}} + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_resource_group/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + +{{codefile "shell" "examples/resources/trocco_resource_group/import.sh"}} + diff --git a/templates/resources/team.md.tmpl b/templates/resources/team.md.tmpl new file mode 100644 index 00000000..3716bb6b --- /dev/null +++ b/templates/resources/team.md.tmpl @@ -0,0 +1,29 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderShortName}}" +subcategory: "" +description: |- + {{.Description}} +--- + +# {{.Name}} ({{.Type}}) + +{{.Description}} + +## Example Usage + +{{codefile "terraform" "examples/resources/trocco_team/resource.tf"}} + +{{.SchemaMarkdown}} + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_team/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + +{{codefile "shell" "examples/resources/trocco_team/import.sh"}} + diff --git a/templates/resources/user.md.tmpl b/templates/resources/user.md.tmpl new file mode 100644 index 00000000..fa00f5a6 --- /dev/null +++ b/templates/resources/user.md.tmpl @@ -0,0 +1,29 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderShortName}}" +subcategory: "" +description: |- + {{.Description}} +--- + +# {{.Name}} ({{.Type}}) + +{{.Description}} + +## Example Usage + +{{codefile "terraform" "examples/resources/trocco_user/resource.tf"}} + +{{.SchemaMarkdown}} + +## Import + +Import is supported using the following syntax: + +In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import {{.Name}} ({{.Type}}). For example: + +{{codefile "terraform" "examples/resources/trocco_user/import.tf"}} + +Using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import): + +{{codefile "shell" "examples/resources/trocco_user/import.sh"}} +