mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-18 17:47:31 +01:00
feat: Add a homemade depends_on for MNG submodule to ensure ordering of resource creation (#867)
This commit is contained in:
committed by
GitHub
parent
1e4a908a95
commit
616d30ec67
@@ -52,6 +52,7 @@ No requirements.
|
||||
| cluster\_name | Name of parent cluster | `string` | n/a | yes |
|
||||
| create\_eks | Controls if EKS resources should be created (it affects almost all resources) | `bool` | `true` | no |
|
||||
| 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` | n/a | yes |
|
||||
| ng\_depends\_on | List of references to other resources this submodule depends on | `any` | `null` | no |
|
||||
| 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 |
|
||||
| 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` | n/a | yes |
|
||||
| tags | A map of tags to add to all resources | `map(string)` | n/a | yes |
|
||||
|
||||
@@ -47,4 +47,6 @@ resource "aws_eks_node_group" "workers" {
|
||||
create_before_destroy = true
|
||||
ignore_changes = [scaling_config.0.desired_size]
|
||||
}
|
||||
|
||||
depends_on = [var.ng_depends_on]
|
||||
}
|
||||
|
||||
@@ -18,4 +18,6 @@ resource "random_pet" "node_groups" {
|
||||
subnet_ids = join("|", each.value["subnets"])
|
||||
node_group_name = join("-", [var.cluster_name, each.key])
|
||||
}
|
||||
|
||||
depends_on = [var.ng_depends_on]
|
||||
}
|
||||
|
||||
@@ -34,3 +34,11 @@ variable "node_groups" {
|
||||
type = any
|
||||
default = {}
|
||||
}
|
||||
|
||||
# Hack for a homemade `depends_on` https://discuss.hashicorp.com/t/tips-howto-implement-module-depends-on-emulation/2305/2
|
||||
# Will be removed in Terraform 0.13 with the support of module's `depends_on` https://github.com/hashicorp/terraform/issues/10462
|
||||
variable "ng_depends_on" {
|
||||
description = "List of references to other resources this submodule depends on"
|
||||
type = any
|
||||
default = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user