mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
fix(cloudformation): remove the login profile when deleting an IAM user (#3975)
Since login profiles became real state, DeleteUser returns DeleteConflict while one exists, so deleting a stack whose AWS::IAM::User was given a password out of band ended in DELETE_FAILED. The provisioner now deletes the login profile before the user, tolerating a user that has none. The resource-type table notes that the template LoginProfile and PermissionsBoundary properties are ignored.
This commit is contained in:
1 parent
b1e0751764
commit
8af15a71c4
6 files changed
+120
-1
No files matched your search
+3
@@ -314,6 +314,9 @@ public class IamUserCfnProvisioner implements CfnResourceProvisioner {
|
||||
LOG.debugv("IAM user access keys already gone, treating as deleted: {0}", physicalId);
|
||||
}
|
||||
|
||||
CfnDeletes.safeDelete("login profile on user", physicalId,
|
||||
() -> iamService.deleteLoginProfile(physicalId), "NoSuchEntity");
|
||||
|
||||
CfnDeletes.safeDelete("IAM user", physicalId,
|
||||
() -> iamService.deleteUser(physicalId), "NoSuchEntity");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user