private static void DeleteRole(string roleName) { using (var identityClient = new Amazon.IdentityManagement.AmazonIdentityManagementServiceClient()) { identityClient.DeleteRolePolicy(new Amazon.IdentityManagement.Model.DeleteRolePolicyRequest { PolicyName = policyName, RoleName = roleName }); identityClient.DeleteRole(new Amazon.IdentityManagement.Model.DeleteRoleRequest { RoleName = roleName }); } }
private void DeleteRole(string roleName) { using (var identityClient = new Amazon.IdentityManagement.AmazonIdentityManagementServiceClient()) { identityClient.DeleteRolePolicy(new Amazon.IdentityManagement.Model.DeleteRolePolicyRequest { PolicyName = policyName, RoleName = roleName }); Thread.Sleep(2000); identityClient.DeleteRole(new Amazon.IdentityManagement.Model.DeleteRoleRequest { RoleName = roleName }); Thread.Sleep(2000); } }