async function __createApiKey ({ identityId, userId, enabled }) {
  console.log(`Creating API Key for identity ID [${identityId}]`)

  let apiKey
  try {
    apiKey = await apigateway
      .createApiKey({
        description: `Dev Portal API Key for account with Identity Pool user ${identityId} / User Pool user ${userId}`,
        enabled,
        generateDistinctId: true,
        // set the name to the cognito identity ID so we can query API Key by the
        // cognito identity
        name: `${identityId}/${userId}`
      })
      .promise()
  } catch (error) {
    console.error('Failed to create API key:', error)
    throw error
  }
  console.log(`Created API key with ID [${apiKey.id}]`)

  await promisify2(updateCustomerApiKeyId)(identityId, apiKey.id)
  return apiKey
}
Creates and returns an API key for the given identityId and userId.