diff --git a/_docs-sources/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md b/_docs-sources/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md index 1cc90beb32..737500cf61 100644 --- a/_docs-sources/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md +++ b/_docs-sources/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md @@ -23,10 +23,14 @@ Deploy Runner: (cd /us-west-2/mgmt && terragrunt run-all apply) ``` -**NOTE:** Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan, +:::note + +Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan, run `apply` in each subfolder of the `mgmt` folder, in dependency graph order. You can see the dependency graph by using the [graph-dependencies terragrunt command](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies). +::: + At this point, the ECS Deploy Runner is provisioned in the new account, and you can start using the Gruntwork Pipeline to provision new infrastructure in the account. diff --git a/_docs-sources/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md b/_docs-sources/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md index fbb193a518..03266826b3 100644 --- a/_docs-sources/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md +++ b/_docs-sources/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md @@ -1,3 +1,34 @@ # Undeploying modules using Gruntwork Pipelines -... +To destroy a module with no downstream dependencies, such as `route53-private` in the `dev` environment: + +1. Update the `force_destroy` variable in `dev/us-west-2/dev/networking/route53-private/terragrunt.hcl`. + ([See the `force_destroy` section](./03-pre-requisite-force-destroy-on-s3-buckets.md).) + + force_destroy = true + +1. Open a pull request for that change and verify the plan in CI. You should see a trivial change to update the + module. +1. Go through the typical git workflow to get the change merged into the main branch. +1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the + `deployment` step to complete so that the module is fully updated with the new variable. +1. Remove the module folder from the repo. For example: + + rm -rf dev/us-west-2/dev/networking/route53-private + +1. Open a pull request for that change and verify the plan in CI. + - Make sure the `plan -destroy` output looks accurate. + - If you are deleting multiple modules (e.g., in `dev`, `stage`, and `prod`) you should see multiple plan + outputs -- one per folder deleted. You'll need to scroll through the plan output to see all of them, as + it runs `plan -destroy` for each folder individually. +1. Go through the typical git workflow to get the change merged into the main branch. +1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the + `deployment` step to complete so that the module is fully _deleted_. +1. [Remove the terraform state](./08-removing-the-terraform-state.md). + +:::note + +Repeat this process for upstream dependencies you may now want to destroy, always starting from the +modules that have no existing downstream dependencies. + +::: diff --git a/docs/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md b/docs/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md index b41a3f36b3..62dd68e5a9 100644 --- a/docs/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md +++ b/docs/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md @@ -23,15 +23,19 @@ Deploy Runner: (cd /us-west-2/mgmt && terragrunt run-all apply) ``` -**NOTE:** Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan, +:::note + +Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan, run `apply` in each subfolder of the `mgmt` folder, in dependency graph order. You can see the dependency graph by using the [graph-dependencies terragrunt command](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies). +::: + At this point, the ECS Deploy Runner is provisioned in the new account, and you can start using the Gruntwork Pipeline to provision new infrastructure in the account. diff --git a/docs/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md b/docs/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md index c6fcf0df74..d32bb95102 100644 --- a/docs/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md +++ b/docs/guides/reference-architecture/07-undeploy/05-undeploying-modules-using-gruntwork-pipelines.md @@ -1,8 +1,39 @@ # Undeploying modules using Gruntwork Pipelines -... +To destroy a module with no downstream dependencies, such as `route53-private` in the `dev` environment: + +1. Update the `force_destroy` variable in `dev/us-west-2/dev/networking/route53-private/terragrunt.hcl`. + ([See the `force_destroy` section](./03-pre-requisite-force-destroy-on-s3-buckets.md).) + + force_destroy = true + +1. Open a pull request for that change and verify the plan in CI. You should see a trivial change to update the + module. +1. Go through the typical git workflow to get the change merged into the main branch. +1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the + `deployment` step to complete so that the module is fully updated with the new variable. +1. Remove the module folder from the repo. For example: + + rm -rf dev/us-west-2/dev/networking/route53-private + +1. Open a pull request for that change and verify the plan in CI. + - Make sure the `plan -destroy` output looks accurate. + - If you are deleting multiple modules (e.g., in `dev`, `stage`, and `prod`) you should see multiple plan + outputs -- one per folder deleted. You'll need to scroll through the plan output to see all of them, as + it runs `plan -destroy` for each folder individually. +1. Go through the typical git workflow to get the change merged into the main branch. +1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the + `deployment` step to complete so that the module is fully _deleted_. +1. [Remove the terraform state](./08-removing-the-terraform-state.md). + +:::note + +Repeat this process for upstream dependencies you may now want to destroy, always starting from the +modules that have no existing downstream dependencies. + +:::