Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add depends on eks modify readme #116

Merged
merged 6 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ You can find more about this project in Anton Babenko stream:
- [Base project name](#base-project-name)
- [Unique prefix of resource names](#unique-prefix-of-resource-names)
- [Separators](#separators)
- [Depends_on](#depends_on)
- [Resource names](#resource-names)
- [Variable names](#variable-names)
- [Output names](#output-names)
Expand Down Expand Up @@ -570,6 +571,18 @@ The `local.name` value is then used as a prefix for all `name` and `name_prefix`

> Use `name_prefix` where possible

#### Depends_on

When you need to add depends_on to resource or module you should add it in end and put empty line in front of it. Example:
halfb00t marked this conversation as resolved.
Show resolved Hide resolved
```
resource "aws_eks_addon" "coredns" {
...
addon_version = var.addon_coredns_version

depends_on = [module.eks]
}
```

#### Resource names

- The resource type should not be duplicated in the resource name (either partially or in full):
Expand Down
9 changes: 8 additions & 1 deletion terraform/layer1-aws/aws-eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ EOT
})
}
}

depends_on = [module.vpc]
}

Expand All @@ -192,6 +193,8 @@ resource "aws_eks_addon" "vpc_cni" {
tags = {
Environment = local.env
}

depends_on = [module.eks]
}

resource "aws_eks_addon" "kube_proxy" {
Expand All @@ -205,6 +208,8 @@ resource "aws_eks_addon" "kube_proxy" {
tags = {
Environment = local.env
}

depends_on = [module.eks]
}

resource "aws_eks_addon" "coredns" {
Expand All @@ -214,8 +219,10 @@ resource "aws_eks_addon" "coredns" {
addon_name = "coredns"
resolve_conflicts = "OVERWRITE"
addon_version = var.addon_coredns_version
depends_on = [module.eks]

tags = {
Environment = local.env
}

depends_on = [module.eks]
}
3 changes: 3 additions & 0 deletions terraform/layer2-k8s/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.