diff --git a/iac/resources/quicksight-access.yml b/iac/resources/quicksight-access.yml index 7cc1d403b..272844e81 100644 --- a/iac/resources/quicksight-access.yml +++ b/iac/resources/quicksight-access.yml @@ -20,7 +20,8 @@ QuicksightAccessLambdaFunction: COGNITO_DOMAIN: !Sub https://${QuicksightAccessUserPoolDomain}.auth.${AWS::Region}.amazoncognito.com Tags: Environment: !Ref Environment - Timeout: 10 + Timeout: 20 + MemorySize: 512 # this lambda lives in the protected subnets of a different VPC than the other lambdas # because it needs (limited) internet access to call cognito and quicksight APIs and these services do not have VPC endpoints # see https://govukverify.atlassian.net/wiki/spaces/PLAT/pages/3531735041/VPC diff --git a/src/handlers/cognito-quicksight-access/handler.ts b/src/handlers/cognito-quicksight-access/handler.ts index 91e0146e2..965537d12 100644 --- a/src/handlers/cognito-quicksight-access/handler.ts +++ b/src/handlers/cognito-quicksight-access/handler.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { getLogger } from '../../shared/powertools'; import type { APIGatewayProxyEventV2, APIGatewayProxyResultV2 } from 'aws-lambda'; import { quicksightClient } from '../../shared/clients'; @@ -30,10 +29,7 @@ export interface UserInfoResponse { } export const handler = async (event: APIGatewayProxyEventV2): Promise => { - console.warn({ event }); - console.warn({ region, cci: process.env.COGNITO_CLIENT_ID, cd: process.env.COGNITO_DOMAIN }); const code = event?.queryStringParameters?.code; - console.warn({ code }); if (code === null || code === undefined || code.length === 0) { return { statusCode: 400, @@ -45,11 +41,8 @@ export const handler = async (event: APIGatewayProxyEventV2): Promise => { const url = `${getCognitoDomain()}/oauth2/userInfo`; - console.warn('calling userInfo endpoint', url, `Bearer ${tokens.access_token}`); const response = await fetch(url, { method: 'GET', @@ -130,7 +121,6 @@ const getEmbedUrl = async (accountId: string, username: string): Promise }); try { - console.warn('calling quicksight', request.input); return await makeUrlRequest(request); } catch (error) { throw new Error(