Skip to content

Commit 8bfc982

Browse files
authored
Merge pull request #116 from maddevsio/Feature/add_depends_on_eks_modify_readme
Feature/add depends on eks modify readme
2 parents 80c2414 + e2d8b09 commit 8bfc982

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ You can find more about this project in Anton Babenko stream:
8080
- [Base project name](#base-project-name)
8181
- [Unique prefix of resource names](#unique-prefix-of-resource-names)
8282
- [Separators](#separators)
83+
- [Depends_on](#depends_on)
8384
- [Resource names](#resource-names)
8485
- [Variable names](#variable-names)
8586
- [Output names](#output-names)
@@ -570,6 +571,19 @@ The `local.name` value is then used as a prefix for all `name` and `name_prefix`
570571
571572
> Use `name_prefix` where possible
572573
574+
#### Depends_on
575+
576+
When you need to add `depends_on` to a resource or a module you should put it at the end of the block with empty line in front of it.
577+
578+
```
579+
resource "aws_eks_addon" "coredns" {
580+
...
581+
addon_version = var.addon_coredns_version
582+
583+
depends_on = [module.eks]
584+
}
585+
```
586+
573587
#### Resource names
574588
575589
- The resource type should not be duplicated in the resource name (either partially or in full):

terraform/layer1-aws/aws-eks.tf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ EOT
178178
})
179179
}
180180
}
181+
181182
depends_on = [module.vpc]
182183
}
183184

@@ -192,6 +193,8 @@ resource "aws_eks_addon" "vpc_cni" {
192193
tags = {
193194
Environment = local.env
194195
}
196+
197+
depends_on = [module.eks]
195198
}
196199

197200
resource "aws_eks_addon" "kube_proxy" {
@@ -205,6 +208,8 @@ resource "aws_eks_addon" "kube_proxy" {
205208
tags = {
206209
Environment = local.env
207210
}
211+
212+
depends_on = [module.eks]
208213
}
209214

210215
resource "aws_eks_addon" "coredns" {
@@ -214,8 +219,10 @@ resource "aws_eks_addon" "coredns" {
214219
addon_name = "coredns"
215220
resolve_conflicts = "OVERWRITE"
216221
addon_version = var.addon_coredns_version
217-
depends_on = [module.eks]
222+
218223
tags = {
219224
Environment = local.env
220225
}
226+
227+
depends_on = [module.eks]
221228
}

terraform/layer2-k8s/.terraform.lock.hcl

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)