-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terraform state backup and restore tool #314
Conversation
Signed-off-by: loheagn <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
=========================================
Coverage ? 78.18%
=========================================
Files ? 23
Lines ? 1595
Branches ? 0
=========================================
Hits ? 1247
Misses ? 268
Partials ? 80
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
}, | ||
} | ||
restoreCmd.Flags().StringVar(&stateJSONPath, "state", "state.back.json", "the path of the backed up Terraform state file") | ||
restoreCmd.Flags().StringVar(&configurationPath, "configuration", "configuration.back.yaml", "the path of the backed up configuration objcet yaml file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restoreCmd.Flags().StringVar(&configurationPath, "configuration", "configuration.back.yaml", "the path of the backed up configuration objcet yaml file") | |
restoreCmd.Flags().StringVar(&configurationPath, "configuration", "configuration.yaml", "the path of the backed up configuration objcet yaml file") |
Normally the configuration file is there, no need to have a backup.
Signed-off-by: loheagn <[email protected]>
hack/tool/backup_restore/README.md
Outdated
|
||
## `restore` | ||
|
||
The main usage of the `restore` subcommand is to import an "outside" Terraform instance (maybe created by the terraform command line or managed by another terraform-controller before) to the terraform-controller in the target kubernetes without recreating the cloud resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main usage of the `restore` subcommand is to import an "outside" Terraform instance (maybe created by the terraform command line or managed by another terraform-controller before) to the terraform-controller in the target kubernetes without recreating the cloud resources. | |
The main usage of the `restore` subcommand is to import an "outside" Terraform instance (maybe created by the terraform command line or managed by another terraform-controller before) to the terraform-controller in the target Kubernetes without recreating the cloud resources. |
To use the `restore` subcommand, you should: | ||
|
||
1. Prepare the `configuration.yaml` file and the `state.json` file whose content is the state json of the Terraform instance which would be imported. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typical scenario, great! Here is another one, please cover it in this PR or in a later one #310 (comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this should be covered by backup
command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add the backup
command in the next PR.
Signed-off-by: loheagn <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
This PR fixes #310
Signed-off-by: loheagn [email protected]