File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff 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):
Original file line number Diff line number Diff line change 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
197200resource "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
210215resource "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}
You can’t perform that action at this time.
0 commit comments