From 1272f7a8bc80897aa5881b52dbb9e6eb54e70038 Mon Sep 17 00:00:00 2001 From: Dmitry Kisler Date: Sat, 5 Oct 2024 00:15:35 +0200 Subject: [PATCH] add import instructions for project, branch and endpoint resources Signed-off-by: Dmitry Kisler --- docs/resources/branch.md | 25 +++++++++++++++++-- docs/resources/endpoint.md | 28 +++++++++++++++++++--- docs/resources/project.md | 31 ++++++++++++++++++++---- templates/resources/branch.md.tmpl | 36 ++++++++++++++++++++++++++++ templates/resources/endpoint.md.tmpl | 36 ++++++++++++++++++++++++++++ templates/resources/project.md.tmpl | 36 ++++++++++++++++++++++++++++ 6 files changed, 183 insertions(+), 9 deletions(-) create mode 100644 templates/resources/branch.md.tmpl create mode 100644 templates/resources/endpoint.md.tmpl create mode 100644 templates/resources/project.md.tmpl diff --git a/docs/resources/branch.md b/docs/resources/branch.md index 53bcdb2..8f0d03a 100644 --- a/docs/resources/branch.md +++ b/docs/resources/branch.md @@ -1,5 +1,3 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "neon_branch Resource - terraform-provider-neon" subcategory: "" description: |- @@ -64,3 +62,26 @@ Set whether the branch is protected. - `id` (String) Branch ID. - `logical_size` (Number) Branch logical size in MB. + + + +## Import + +The Neon Branch can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = neon_branch.this + id = "br-snowy-mountain-a5jkb18i" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import neon_branch.this br-snowy-mountain-a5jkb18i +``` diff --git a/docs/resources/endpoint.md b/docs/resources/endpoint.md index e62ef57..8d4949d 100644 --- a/docs/resources/endpoint.md +++ b/docs/resources/endpoint.md @@ -1,10 +1,9 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "neon_endpoint Resource - terraform-provider-neon" subcategory: "" description: |- Project Endpoint. See details: https://neon.tech/docs/manage/endpoints/ - !> Note that "read_write" type is only supported yet, and a single "read_write" endpoint is permitted per branch. It means that no additional endpoints can be provisioned for branches with existing endpoints. It also means that no endpoints can be created for branches provisioned with this terraform provider because every branch has the default endpoint attached. + +!> Note that "read_write" type is only supported yet, and a single "read_write" endpoint is permitted per branch. It means that no additional endpoints can be provisioned for branches with existing endpoints. It also means that no endpoints can be created for branches provisioned with this terraform provider because every branch has the default endpoint attached. --- # neon_endpoint (Resource) @@ -64,3 +63,26 @@ The maximum value is 604800 seconds (1 week) - `host` (String) Endpoint URI. - `id` (String) Endpoint ID. - `proxy_host` (String) + + + +## Import + +The Neon Endpoint can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = neon_endpoint.this + id = "ep-black-mouse-a64dr7wp" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import neon_endpoint.this ep-black-mouse-a64dr7wp +``` diff --git a/docs/resources/project.md b/docs/resources/project.md index 1caa34d..9664f33 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -1,11 +1,10 @@ ---- -# generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "neon_project Resource - terraform-provider-neon" subcategory: "" description: |- Neon Project. - See details: https://neon.tech/docs/get-started-with-neon/setting-up-a-project/ - API: https://api-docs.neon.tech/reference/createproject + +See details: https://neon.tech/docs/get-started-with-neon/setting-up-a-project/ +API: https://api-docs.neon.tech/reference/createproject --- # neon_project (Resource) @@ -187,3 +186,27 @@ Optional: - `data_transfer_bytes` (Number) Total amount of data transferred from all of a project's branches using the proxy. - `logical_size_bytes` (Number) Limit on the logical size of every project's branch. - `written_data_bytes` (Number) Total amount of data written to all of a project's branches. + + + + +## Import + +The Neon Project can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = neon_project.this + id = "shiny-cell-31746257" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import neon_project.this shiny-cell-31746257 +``` diff --git a/templates/resources/branch.md.tmpl b/templates/resources/branch.md.tmpl new file mode 100644 index 0000000..c463b92 --- /dev/null +++ b/templates/resources/branch.md.tmpl @@ -0,0 +1,36 @@ +page_title: "{{ .Name }} {{ .Type }} - {{.ProviderName}}" +subcategory: "" +description: |- + {{ .Description }} +--- + +# {{ .Name }} ({{ .Type }}) + +{{ .Description }} + +## Example Usage + +{{ tffile "examples/resources/neon_branch/resource.tf" }} + +{{.SchemaMarkdown}} + +## Import + +The Neon Branch can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = {{.Name}}.this + id = "br-snowy-mountain-a5jkb18i" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import {{.Name}}.this br-snowy-mountain-a5jkb18i +``` diff --git a/templates/resources/endpoint.md.tmpl b/templates/resources/endpoint.md.tmpl new file mode 100644 index 0000000..2acdcf1 --- /dev/null +++ b/templates/resources/endpoint.md.tmpl @@ -0,0 +1,36 @@ +page_title: "{{ .Name }} {{ .Type }} - {{.ProviderName}}" +subcategory: "" +description: |- + {{ .Description }} +--- + +# {{ .Name }} ({{ .Type }}) + +{{ .Description }} + +## Example Usage + +{{ tffile "examples/resources/neon_endpoint/resource.tf" }} + +{{.SchemaMarkdown}} + +## Import + +The Neon Endpoint can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = {{.Name}}.this + id = "ep-black-mouse-a64dr7wp" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import {{.Name}}.this ep-black-mouse-a64dr7wp +``` diff --git a/templates/resources/project.md.tmpl b/templates/resources/project.md.tmpl new file mode 100644 index 0000000..f32043f --- /dev/null +++ b/templates/resources/project.md.tmpl @@ -0,0 +1,36 @@ +page_title: "{{ .Name }} {{ .Type }} - {{.ProviderName}}" +subcategory: "" +description: |- + {{ .Description }} +--- + +# {{ .Name }} ({{ .Type }}) + +{{ .Description }} + +## Example Usage + +{{ tffile "examples/resources/neon_project/resource.tf" }} + +{{.SchemaMarkdown}} + +## Import + +The Neon Project can be imported to the terraform state by its identifier. + +Import using the [import block](https://developer.hashicorp.com/terraform/language/import): + +For example: + +```hcl +import { + to = {{.Name}}.this + id = "shiny-cell-31746257" +} +``` + +Import using the command `terraform import`: + +```commandline +terraform import {{.Name}}.this shiny-cell-31746257 +```