/// <summary> /// Internal method that cleans up the created identity pool (along with associated /// clients/roles) for testing /// </summary> public override async void Dispose() { try { await identityClient.DeleteIdentityPoolAsync(new DeleteIdentityPoolRequest() { IdentityPoolId = identityPoolId }).ConfigureAwait(false); await managementClient.DetachRolePolicyAsync(new DetachRolePolicyRequest() { PolicyArn = policyArn, RoleName = roleName }).ConfigureAwait(false); await managementClient.DeletePolicyAsync(new DeletePolicyRequest() { PolicyArn = policyArn }).ConfigureAwait(false); await managementClient.DeleteRoleAsync(new DeleteRoleRequest() { RoleName = roleName }).ConfigureAwait(false); identityClient.Dispose(); managementClient.Dispose(); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); } base.Dispose(); }
protected virtual void Dispose(bool disposing) { if (!_disposed && disposing) { cognitoClient.Dispose(); stsClient.Dispose(); _disposed = true; } }