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
This commit is contained in:
mark kelly
2018-11-23 13:33:02 +00:00
committed by Max Williams
parent 8d3dd6392f
commit cddac92757
3 changed files with 7 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
- `suspended_processes` to `worker_groups` input (by @bkmeneguello)
- `target_group_arns` to `worker_groups` input (by @zihaoyu)
- `force_detach_policies` to `aws_iam_role` `cluster` and `workers` (by @marky-mark)
### Changed

View File

@@ -50,8 +50,9 @@ resource "aws_security_group_rule" "cluster_https_worker_ingress" {
}
resource "aws_iam_role" "cluster" {
name_prefix = "${var.cluster_name}"
assume_role_policy = "${data.aws_iam_policy_document.cluster_assume_role_policy.json}"
name_prefix = "${var.cluster_name}"
assume_role_policy = "${data.aws_iam_policy_document.cluster_assume_role_policy.json}"
force_detach_policies = true
}
resource "aws_iam_role_policy_attachment" "cluster_AmazonEKSClusterPolicy" {

View File

@@ -105,8 +105,9 @@ resource "aws_security_group_rule" "workers_ingress_cluster_https" {
}
resource "aws_iam_role" "workers" {
name_prefix = "${aws_eks_cluster.this.name}"
assume_role_policy = "${data.aws_iam_policy_document.workers_assume_role_policy.json}"
name_prefix = "${aws_eks_cluster.this.name}"
assume_role_policy = "${data.aws_iam_policy_document.workers_assume_role_policy.json}"
force_detach_policies = true
}
resource "aws_iam_instance_profile" "workers" {