public static async Task <(bool exists, string id)> CognitoUserPoolClientExists( this AmazonCognitoIdentityProviderClient client, string userPoolId, string name) { var userPoolClients = await client.ListUserPoolClientsAsync(new ListUserPoolClientsRequest { MaxResults = 10, UserPoolId = userPoolId }); var matchingClient = userPoolClients.UserPoolClients.FirstOrDefault(x => x.ClientName == name); return(matchingClient != null, matchingClient?.ClientId); }