Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions aws/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ module "cluster" {
| <a name="input_name"></a> [name](#input\_name) | Name for this EKS cluster | `string` | n/a | yes |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Prefix to be applied to created resources | `list(string)` | `[]` | no |
| <a name="input_node_groups"></a> [node\_groups](#input\_node\_groups) | Node groups to create in this cluster | <pre>map(object({<br> capacity_type = optional(string, "ON_DEMAND")<br> instance_types = list(string),<br> enforce_imdsv2 = optional(bool, false)<br> max_size = number<br> max_unavailable = optional(number, 3)<br> min_size = number<br> }))</pre> | n/a | yes |
| <a name="input_prevent_log_group_destroy"></a> [prevent\_log\_group\_destroy](#input\_prevent\_log\_group\_destroy) | When true, the CloudWatch log group will be protected from deletion. Terraform will fail if a destroy is attempted on this resource. | `bool` | `false` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be applied to all created resources | `map(string)` | `{}` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions aws/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module "eks_cluster" {
k8s_version = var.k8s_version
log_retention_in_days = var.log_retention_in_days
name = module.cluster_name.full
prevent_log_group_destroy = var.prevent_log_group_destroy
private_subnet_ids = module.network.private_subnet_ids
public_subnet_ids = module.network.public_subnet_ids
tags = var.tags
Expand Down
1 change: 1 addition & 0 deletions aws/cluster/modules/eks-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
| <a name="input_log_retention_in_days"></a> [log\_retention\_in\_days](#input\_log\_retention\_in\_days) | How many days until control plane logs are purged | `number` | `7` | no |
| <a name="input_name"></a> [name](#input\_name) | Name for this EKS cluster | `string` | n/a | yes |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Prefix to be applied to created resources | `list(string)` | `[]` | no |
| <a name="input_prevent_log_group_destroy"></a> [prevent\_log\_group\_destroy](#input\_prevent\_log\_group\_destroy) | When true, the CloudWatch log group will be protected from deletion. Terraform will fail if a destroy is attempted on this resource. | `bool` | `false` | no |
| <a name="input_private_subnet_ids"></a> [private\_subnet\_ids](#input\_private\_subnet\_ids) | Private subnets which should be used by this cluster | `list(string)` | n/a | yes |
| <a name="input_public_subnet_ids"></a> [public\_subnet\_ids](#input\_public\_subnet\_ids) | Public subnets which should be used by this cluster | `list(string)` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be applied to created resources | `map(string)` | `{}` | no |
Expand Down
2 changes: 2 additions & 0 deletions aws/cluster/modules/eks-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ resource "aws_iam_role_policy_attachment" "control_plane" {
resource "aws_cloudwatch_log_group" "eks" {
name = "/aws/eks/${local.name}/cluster"
retention_in_days = var.log_retention_in_days

skip_destroy = var.prevent_log_group_destroy
}

resource "aws_security_group" "control_plane" {
Expand Down
7 changes: 7 additions & 0 deletions aws/cluster/modules/eks-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ variable "namespace" {
default = []
}

variable "prevent_log_group_destroy" {
type = bool
default = false
description = "When true, the CloudWatch log group will be protected from deletion. Terraform will fail if a destroy is attempted on this resource."
}


variable "private_subnet_ids" {
type = list(string)
description = "Private subnets which should be used by this cluster"
Expand Down
6 changes: 6 additions & 0 deletions aws/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ variable "node_groups" {
}))
}

variable "prevent_log_group_destroy" {
type = bool
default = false
description = "When true, the CloudWatch log group will be protected from deletion. Terraform will fail if a destroy is attempted on this resource."
}

variable "tags" {
type = map(string)
description = "Tags to be applied to all created resources"
Expand Down
Loading