Application Load Balancer

Create the Load Balancer

Create a new Application Load Balancer, following the AWS documentation.

Choose the following values:

Scheme

internet-facing

Load balancer IP address type

IPv4

VPC

{your VPC}

Security group

{your new security group}

Choose any default listener, as you will set the listeners in the next step.

Add the listener rules

  1. Add the following listener rules, replacing the values for:

NEW_USER_POOL

NEW_CLIENT_ID

NEW_DNS

NEW_PORT = probably 9600

Name Tag
Priority
Conditions (if)
Actions (then)

header-based

5

HTTP Header Api-Request is true

  1. Authenticate using Cognito

    • User pool ID: NEW_USER_POOL

    • Client ID: NEW_CLIENT_ID

    • Session cookie name: AWSELBAuthSessionCookie

    • Session timeout: 604800

    • On unauthenticated: authenticate

    • Scope: openid

  2. Forward to target group

    • graph-build-api : 1 (100%)

    • Target group stickiness: Off

rule1

10

HTTP Host Header is {NEW_DNS}

  1. Authenticate using Cognito

    • User pool ID: NEW_USER_POOL

    • Client ID: NEW_CLIENT_ID

    • Session cookie name: AWSELBAuthSessionCookie

    • Session timeout: 604800

    • On unauthenticated: authenticate

    • Scope: openid

  2. Forward to target group

    • graph-build-ui : 1 (100%)

    • Target group stickiness: Off

Default

Last (default)

If no other rule applies

Redirect to HTTPS://NEW_DNS:NEW_PORT/#{path}?#{query}

  • Status code: HTTP_301

Last updated