Skip to content

Commit cddac92

Browse files
marky-markmax-rocket-internet
authored andcommitted
Destroying cluster causes some issues with removing policies (#196)
* Destroying cluster causes some issues with removing policies use the force detach https://www.terraform.io/docs/providers/aws/r/iam_role.html#force_detach_policies * Destroying cluster causes some issues with removing policies * formatting * Destroying cluster causes some issues with removing policies * CHANGELOG
1 parent 8d3dd63 commit cddac92

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
- `suspended_processes` to `worker_groups` input (by @bkmeneguello)
1313
- `target_group_arns` to `worker_groups` input (by @zihaoyu)
14+
- `force_detach_policies` to `aws_iam_role` `cluster` and `workers` (by @marky-mark)
1415

1516
### Changed
1617

cluster.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
5050
}
5151

5252
resource "aws_iam_role" "cluster" {
53-
name_prefix = "${var.cluster_name}"
54-
assume_role_policy = "${data.aws_iam_policy_document.cluster_assume_role_policy.json}"
53+
name_prefix = "${var.cluster_name}"
54+
assume_role_policy = "${data.aws_iam_policy_document.cluster_assume_role_policy.json}"
55+
force_detach_policies = true
5556
}
5657

5758
resource "aws_iam_role_policy_attachment" "cluster_AmazonEKSClusterPolicy" {

workers.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ resource "aws_security_group_rule" "workers_ingress_cluster_https" {
105105
}
106106

107107
resource "aws_iam_role" "workers" {
108-
name_prefix = "${aws_eks_cluster.this.name}"
109-
assume_role_policy = "${data.aws_iam_policy_document.workers_assume_role_policy.json}"
108+
name_prefix = "${aws_eks_cluster.this.name}"
109+
assume_role_policy = "${data.aws_iam_policy_document.workers_assume_role_policy.json}"
110+
force_detach_policies = true
110111
}
111112

112113
resource "aws_iam_instance_profile" "workers" {

0 commit comments

Comments
 (0)