Skip to content

Commit d6d612f

Browse files
authored
Add missing RefArch undeployment section (#129)
* Add missing RefArch undeployment section * indentation fix
1 parent beb258d commit d6d612f

File tree

4 files changed

+76
-6
lines changed

4 files changed

+76
-6
lines changed

_docs-sources/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,14 @@ Deploy Runner:
2323
(cd <REPLACE_WITH_NAME_OF_ACCOUNT>/us-west-2/mgmt && terragrunt run-all apply)
2424
```
2525

26-
**NOTE:** Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan,
26+
:::note
27+
28+
Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan,
2729
run `apply` in each subfolder of the `mgmt` folder, in dependency graph order. You can see the dependency graph by using
2830
the [graph-dependencies terragrunt
2931
command](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies).
3032

33+
:::
34+
3135
At this point, the ECS Deploy Runner is provisioned in the new account, and you can start using the Gruntwork Pipeline
3236
to provision new infrastructure in the account.
Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
# Undeploying modules using Gruntwork Pipelines
22

3-
...
3+
To destroy a module with no downstream dependencies, such as `route53-private` in the `dev` environment:
4+
5+
1. Update the `force_destroy` variable in `dev/us-west-2/dev/networking/route53-private/terragrunt.hcl`.
6+
([See the `force_destroy` section](./03-pre-requisite-force-destroy-on-s3-buckets.md).)
7+
8+
force_destroy = true
9+
10+
1. Open a pull request for that change and verify the plan in CI. You should see a trivial change to update the
11+
module.
12+
1. Go through the typical git workflow to get the change merged into the main branch.
13+
1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the
14+
`deployment` step to complete so that the module is fully updated with the new variable.
15+
1. Remove the module folder from the repo. For example:
16+
17+
rm -rf dev/us-west-2/dev/networking/route53-private
18+
19+
1. Open a pull request for that change and verify the plan in CI.
20+
- Make sure the `plan -destroy` output looks accurate.
21+
- If you are deleting multiple modules (e.g., in `dev`, `stage`, and `prod`) you should see multiple plan
22+
outputs -- one per folder deleted. You'll need to scroll through the plan output to see all of them, as
23+
it runs `plan -destroy` for each folder individually.
24+
1. Go through the typical git workflow to get the change merged into the main branch.
25+
1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the
26+
`deployment` step to complete so that the module is fully _deleted_.
27+
1. [Remove the terraform state](./08-removing-the-terraform-state.md).
28+
29+
:::note
30+
31+
Repeat this process for upstream dependencies you may now want to destroy, always starting from the
32+
modules that have no existing downstream dependencies.
33+
34+
:::

docs/guides/reference-architecture/06-adding-a-new-account/05-deploy-the-ecs-deploy-runner.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ Deploy Runner:
2323
(cd <REPLACE_WITH_NAME_OF_ACCOUNT>/us-west-2/mgmt && terragrunt run-all apply)
2424
```
2525

26-
**NOTE:** Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan,
26+
:::note
27+
28+
Because this uses `run-all`, the command will not pause to show you the plan. If you wish to view the plan,
2729
run `apply` in each subfolder of the `mgmt` folder, in dependency graph order. You can see the dependency graph by using
2830
the [graph-dependencies terragrunt
2931
command](https://terragrunt.gruntwork.io/docs/reference/cli-options/#graph-dependencies).
3032

33+
:::
34+
3135
At this point, the ECS Deploy Runner is provisioned in the new account, and you can start using the Gruntwork Pipeline
3236
to provision new infrastructure in the account.
3337

3438

3539
<!-- ##DOCS-SOURCER-START
36-
{"sourcePlugin":"Local File Copier","hash":"d45e6387b5fc09c9e6ced9d19a69a784"}
40+
{"sourcePlugin":"Local File Copier","hash":"f383a1b3ce7b725423c02c57370d347b"}
3741
##DOCS-SOURCER-END -->
Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
# Undeploying modules using Gruntwork Pipelines
22

3-
...
3+
To destroy a module with no downstream dependencies, such as `route53-private` in the `dev` environment:
4+
5+
1. Update the `force_destroy` variable in `dev/us-west-2/dev/networking/route53-private/terragrunt.hcl`.
6+
([See the `force_destroy` section](./03-pre-requisite-force-destroy-on-s3-buckets.md).)
7+
8+
force_destroy = true
9+
10+
1. Open a pull request for that change and verify the plan in CI. You should see a trivial change to update the
11+
module.
12+
1. Go through the typical git workflow to get the change merged into the main branch.
13+
1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the
14+
`deployment` step to complete so that the module is fully updated with the new variable.
15+
1. Remove the module folder from the repo. For example:
16+
17+
rm -rf dev/us-west-2/dev/networking/route53-private
18+
19+
1. Open a pull request for that change and verify the plan in CI.
20+
- Make sure the `plan -destroy` output looks accurate.
21+
- If you are deleting multiple modules (e.g., in `dev`, `stage`, and `prod`) you should see multiple plan
22+
outputs -- one per folder deleted. You'll need to scroll through the plan output to see all of them, as
23+
it runs `plan -destroy` for each folder individually.
24+
1. Go through the typical git workflow to get the change merged into the main branch.
25+
1. As CI runs on the main branch, watch for the job to be held for approval. Approve the job, and wait for the
26+
`deployment` step to complete so that the module is fully _deleted_.
27+
1. [Remove the terraform state](./08-removing-the-terraform-state.md).
28+
29+
:::note
30+
31+
Repeat this process for upstream dependencies you may now want to destroy, always starting from the
32+
modules that have no existing downstream dependencies.
33+
34+
:::
435

536

637
<!-- ##DOCS-SOURCER-START
7-
{"sourcePlugin":"Local File Copier","hash":"5a713398c4c7a21365cc14d9e31323b3"}
38+
{"sourcePlugin":"Local File Copier","hash":"b29d1696372fb2955b41113f2eee5f96"}
839
##DOCS-SOURCER-END -->

0 commit comments

Comments
 (0)