Skip to content

Commit db062f2

Browse files
daroga0002spr-mweber3
authored andcommitted
feat: Removed ng_depends_on variable and related hack (terraform-aws-modules#1672)
1 parent 6217677 commit db062f2

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

modules/node_groups/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ No modules.
9797
| <a name="input_create_eks"></a> [create\_eks](#input\_create\_eks) | Controls if EKS resources should be created (it affects almost all resources) | `bool` | `true` | no |
9898
| <a name="input_default_iam_role_arn"></a> [default\_iam\_role\_arn](#input\_default\_iam\_role\_arn) | ARN of the default IAM worker role to use if one is not specified in `var.node_groups` or `var.node_groups_defaults` | `string` | `""` | no |
9999
| <a name="input_ebs_optimized_not_supported"></a> [ebs\_optimized\_not\_supported](#input\_ebs\_optimized\_not\_supported) | List of instance types that do not support EBS optimization | `list(string)` | `[]` | no |
100-
| <a name="input_ng_depends_on"></a> [ng\_depends\_on](#input\_ng\_depends\_on) | List of references to other resources this submodule depends on | `any` | `null` | no |
101100
| <a name="input_node_groups"></a> [node\_groups](#input\_node\_groups) | Map of maps of `eks_node_groups` to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | `{}` | no |
102101
| <a name="input_node_groups_defaults"></a> [node\_groups\_defaults](#input\_node\_groups\_defaults) | map of maps of node groups to create. See "`node_groups` and `node_groups_defaults` keys" section in README.md for more details | `any` | `{}` | no |
103102
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |

modules/node_groups/main.tf

-1
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@ resource "aws_eks_node_group" "workers" {
102102
ignore_changes = [scaling_config[0].desired_size]
103103
}
104104

105-
depends_on = [var.ng_depends_on]
106105
}

modules/node_groups/variables.tf

-8
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ variable "node_groups" {
6464
default = {}
6565
}
6666

67-
# Hack for a homemade `depends_on` https://discuss.hashicorp.com/t/tips-howto-implement-module-depends-on-emulation/2305/2
68-
# Will be removed in Terraform 0.13 with the support of module's `depends_on` https://github.com/hashicorp/terraform/issues/10462
69-
variable "ng_depends_on" {
70-
description = "List of references to other resources this submodule depends on"
71-
type = any
72-
default = null
73-
}
74-
7567
variable "ebs_optimized_not_supported" {
7668
description = "List of instance types that do not support EBS optimization"
7769
type = list(string)

node_groups.tf

+1-7
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,8 @@ module "node_groups" {
1818

1919
tags = var.tags
2020

21-
# Hack to ensure ordering of resource creation.
22-
# This is a homemade `depends_on` https://discuss.hashicorp.com/t/tips-howto-implement-module-depends-on-emulation/2305/2
23-
# Do not create node_groups before other resources are ready and removes race conditions
24-
# Ensure these resources are created before "unlocking" the data source.
25-
# Will be removed in Terraform 0.13
26-
ng_depends_on = [
21+
depends_on = [
2722
aws_eks_cluster.this,
28-
kubernetes_config_map.aws_auth,
2923
aws_iam_role_policy_attachment.workers_AmazonEKSWorkerNodePolicy,
3024
aws_iam_role_policy_attachment.workers_AmazonEKS_CNI_Policy,
3125
aws_iam_role_policy_attachment.workers_AmazonEC2ContainerRegistryReadOnly

0 commit comments

Comments
 (0)