Skip to content

Commit

Permalink
Enable protection for eks_cluster and managed node group
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Jul 11, 2023
1 parent 0a17f65 commit 5063dc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ resource "aws_eks_cluster" "this" {
aws_cloudwatch_log_group.this,
aws_iam_policy.cni_ipv6_policy,
]

lifecycle {
prevent_destroy = true
}
}

resource "aws_ec2_tag" "cluster_primary_security_group" {
Expand Down
1 change: 1 addition & 0 deletions modules/eks-managed-node-group/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ resource "aws_eks_node_group" "this" {
ignore_changes = [
scaling_config[0].desired_size,
]
prevent_destroy = true
}

tags = merge(
Expand Down

0 comments on commit 5063dc1

Please sign in to comment.