You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38Lines changed: 38 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,7 @@ This diagram shows the namespaces used in the cluster and the services deployed
146
146
## Useful tools
147
147
148
148
-[tfenv](https://github.com/tfutils/tfenv) - tool for managing different versions of terraform; the required version can be specified directly as an argument or via `.terraform-version`
149
+
-[tgenv](https://github.com/cunymatthieu/tgenv) - tool for managing different versions of terragrunt.
149
150
-[terraform](https://www.terraform.io/) - terraform itself, our main development tool: `tfenv install`
150
151
-[awscli](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) - console utility to work with AWS API
151
152
-[kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) - conssole utility to work with Kubernetes API
@@ -362,6 +363,43 @@ We've also used `terragrunt` to simplify s3 bucket creation and terraform backen
362
363
363
364
By running this `terragrunt` will create s3 bucket, configure terraform backend and then will run `terraform init` and `terraform apply` in layer-1 and layer-2 sequentially.
364
365
366
+
#### Apply infrastructure by layers with `terragrunt`
367
+
368
+
Go to layer folder `terraform/layer1-aws/` or `terraform/layer2-k8s/` and run this command:
369
+
370
+
```
371
+
terragrunt apply
372
+
```
373
+
374
+
> The `layer2-k8s` has a dependence on `layer1-aws`.
375
+
376
+
#### Target apply by `terragrunt`
377
+
378
+
Go to layer folder `terraform/layer1-aws/` or `terraform/layer2-k8s/` and run this command:
379
+
380
+
```
381
+
terragrunt apply -target=module.eks
382
+
```
383
+
384
+
> The `-target` is formed from the following parts `resource type` and `resource name`.
385
+
> For example: `-target=module.eks`, `-target=helm_release.loki_stack`
386
+
387
+
#### Destroy infrastructure by `terragrunt`
388
+
389
+
For destroy both layers, run this command from `terraform/` folder:
390
+
391
+
```
392
+
terragrant run-all destroy
393
+
```
394
+
395
+
For destroy `layer2-k8s`, run this command from `terraform/layare2-k8s` folder:
396
+
397
+
```
398
+
terragrunt destroy
399
+
```
400
+
401
+
> The `layer2-k8s` has dependence from `layer1-aws` and when you destroy `layer1-aws`, `layer2-k8s` destroyed automatically.
402
+
365
403
## What to do after deployment
366
404
367
405
After applying this configuration, you will get the infrastructure described and outlined at the beginning of the document. In AWS and within the EKS cluster, the basic resources and services necessary for the operation of the EKS k8s cluster will be created.
0 commit comments