1 year ago

#350829

test-img

Adnan Yaseen

Target group unhealthy for NLB

I am trying to connect Network Load Balancer with API Gateway. This is the architecture.

Combining the API gateway with network load balancer and VPC endpoint

What has been done so far,

  1. Created VPC with a private and public Subnet and security group with inbound traffic for both Http and Https

  2. Created a new VPC endpoint (AWS services) and selected api-execute from services. Selected VPC, Subnet (public) and Security Group. Fill access policy has been assigned.

  3. Created a new Target Group (IP addresses). Protocol HTTP and Port 80, With above created VPC. In the Targets added the IP of the Subnet which was assigned to the VPC endpoint above

  4. Created a Network Load Balancer (Internet facing, IPV4, VPC and Public Subnet created above. Added a Listener on TCP 80 and assigned the Target Group created above.

  5. Created an API Gateway with type REST API Private. Assigned the VPC Endpoint ID which was created above. Attached a resource policy to the REST API mentioned below,

    { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": "", "Action": "execute-api:Invoke", "Resource": "arn:aws:execute-api:us-west-2::/" }, { "Effect": "Deny", "Principal": "", "Action": "execute-api:Invoke", "Resource": "arn:aws:execute-api:us-west-2::/", "Condition": { "StringNotEquals": { "aws:SourceVpce": "{vpce id}" } } } ] }

After completing all the steps, the target group health status is unhealthy and when I try to access the Network Load Balancer using the static IP assigned to it, it give this error,

Failed to connect to **.***.***.*** port 80 after 21040 ms: Timed out

What I am missing here?

aws-api-gateway

nlb

0 Answers

Your Answer

Accepted video resources