Skip to content

Commit 9999d18

Browse files
committed
Set force_destroy on the aws-users module
Offboarding is done by deleting a module block, so DeleteUser has to be able to finish without a hand cleanup of MFA devices, access keys and directly attached policies. Refs #176
1 parent af2a29b commit 9999d18

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎terraform/modules/aws-users/main.tf‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ resource "aws_iam_user" "user" {
44
name = var.user_name
55
path = var.user_path
66

7+
// Offboarding is done by deleting the module block, so a destroy has to be
8+
// able to finish on its own. Without this, DeleteUser returns DeleteConflict
9+
// for any user who still has an MFA device, an access key or a directly
10+
// attached policy, and the apply fails partway through the batch.
11+
force_destroy = true
12+
713
tags = var.user_tags
814
}
915

0 commit comments

Comments
 (0)