From 19616a443b692534e02d822f6f8b4a43055739aa Mon Sep 17 00:00:00 2001 From: "PC-2NR0VQ3\\wai.wong" Date: Thu, 11 Jan 2024 09:26:40 +0000 Subject: [PATCH] docs: update docs --- docs/resources/cluster.md | 8 ++++---- templates/resources/cluster.md.tmpl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 15991bd9..78255f63 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -250,11 +250,11 @@ output "faraway_replica_ids" { Here are the steps to restore a cluster: 1. Use an example config in the examples folder, uncomment the following fields restore_cluster_id=p-123456789, restore_from_deleted=true and enter your cluster id you want to restore and set to true respectively(for restoring an active cluster, set to false) -2. Use commands terraform init and terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789/import-from-deleted to import a deleted cluster into terraform(use import biganimal_cluster.single_node_cluster prj_123456789/p-123456789 to import an active cluster) -3. Use command terraform plan to compare and diff your config with the imported cluster(source cluster) and edit config where appropriate. You can also use terraform show to see the source cluster which you can copy and paste the field values into your config. The config fields 'cloud_provider', 'pg_type', 'pg_version', 'pg_config' and 'private_networking' cannot be changed and have to match the source cluster +2. Use commands "terraform init" and "terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789/import-from-deleted" to import a deleted cluster into terraform(use "terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789" to import an active cluster) +3. Use command "terraform plan" to compare and diff your config with the imported cluster(source cluster) and edit config where appropriate. You can also use "terraform show" to see the source cluster which you can copy and paste the field values into your config. The config fields "cloud_provider", "pg_type", "pg_version", "pg_config" and "private_networking" cannot be changed and have to match the source cluster 4. Remove state by deleting the file terraform.tfstate or use the commands terraform state rm 'biganimal_cluster.single_node_cluster' and terraform state rm 'random_password.password' -5. Use command terraform init and terraform apply to restore the cluster, it will show a warning saying you are trying to restore a cluster -6. Remove or comment the field restore_cluster_id=p-123456789 in the config after the restore has completed +5. Use command "terraform init" and "terraform apply" to restore the cluster, it will show a warning saying you are trying to restore a cluster +6. Remove or comment the fields "restore_cluster_id", "restore_from_deleted" and restore_point in the config after the restore has completed ## Schema diff --git a/templates/resources/cluster.md.tmpl b/templates/resources/cluster.md.tmpl index 6f472e20..e79a6c4e 100644 --- a/templates/resources/cluster.md.tmpl +++ b/templates/resources/cluster.md.tmpl @@ -25,11 +25,11 @@ Please visit the [examples page](https://github.com/EnterpriseDB/terraform-provi Here are the steps to restore a cluster: 1. Use an example config in the examples folder, uncomment the following fields restore_cluster_id=p-123456789, restore_from_deleted=true and enter your cluster id you want to restore and set to true respectively(for restoring an active cluster, set to false) -2. Use commands terraform init and terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789/import-from-deleted to import a deleted cluster into terraform(use import biganimal_cluster.single_node_cluster prj_123456789/p-123456789 to import an active cluster) -3. Use command terraform plan to compare and diff your config with the imported cluster(source cluster) and edit config where appropriate. You can also use terraform show to see the source cluster which you can copy and paste the field values into your config. The config fields 'cloud_provider', 'pg_type', 'pg_version', 'pg_config' and 'private_networking' cannot be changed and have to match the source cluster +2. Use commands "terraform init" and "terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789/import-from-deleted" to import a deleted cluster into terraform(use "terraform import biganimal_cluster.single_node_cluster prj_123456789/p-123456789" to import an active cluster) +3. Use command "terraform plan" to compare and diff your config with the imported cluster(source cluster) and edit config where appropriate. You can also use "terraform show" to see the source cluster which you can copy and paste the field values into your config. The config fields "cloud_provider", "pg_type", "pg_version", "pg_config" and "private_networking" cannot be changed and have to match the source cluster 4. Remove state by deleting the file terraform.tfstate or use the commands terraform state rm 'biganimal_cluster.single_node_cluster' and terraform state rm 'random_password.password' -5. Use command terraform init and terraform apply to restore the cluster, it will show a warning saying you are trying to restore a cluster -6. Remove or comment the field restore_cluster_id=p-123456789 in the config after the restore has completed +5. Use command "terraform init" and "terraform apply" to restore the cluster, it will show a warning saying you are trying to restore a cluster +6. Remove or comment the fields "restore_cluster_id", "restore_from_deleted" and restore_point in the config after the restore has completed {{ .SchemaMarkdown | trimspace }} {{- if .HasImport }}