Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wai-wong-edb committed Jan 11, 2024
1 parent 8e1c6b9 commit 8aef25b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/resources/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ 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' and 'private_networking' cannot be changed and have to match the source 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
Expand Down
2 changes: 1 addition & 1 deletion pkg/plan_modifier/restore_cluster_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (m customRestoreClusterIdModifier) PlanModifyString(ctx context.Context, re
if !req.PlanValue.IsNull() {
resp.Diagnostics.AddWarning(
"You are restoring a cluster",
"You are restoring a cluster. The config fields 'cloud_provider', 'pg_type', 'pg_version' and 'private_networking' cannot be changed and have to match the source cluster. After restoring the cluster, please remove fields 'restore_cluster_id','restore_from_deleted' and 'restore_point' from the config",
"You are restoring a cluster. The config fields 'cloud_provider', 'pg_type', 'pg_version', 'pg_config' and 'private_networking' cannot be changed and have to match the source cluster. After restoring the cluster, please remove fields 'restore_cluster_id','restore_from_deleted' and 'restore_point' from the config",
)
}
}
2 changes: 1 addition & 1 deletion templates/resources/cluster.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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' and 'private_networking' cannot be changed and have to match the source 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
Expand Down

0 comments on commit 8aef25b

Please sign in to comment.