3

I followed the tutorial to create a VPC link to my private elb balancer. https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-api-with-vpclink-cli.html

But it failed, and got an error message "statusMessage": "NLB ARN is malformed".

I do find the ELB with same ARN by elbv2 cli, so the ARN must be a legal one...

I can't find document to solve the problem. anyone can help me? thank you.

what i did is as following.

$ aws elbv2 describe-load-balancers --load-balancer-arns arn:aws:elasticloadbalancing:ap-northeast-1:846239845603:loadbalancer/app/v2-api-balancer/db49ab0ecaef1de8

{
"LoadBalancers": [
{
"Scheme": "internal",
"SecurityGroups": [
"sg-9282b8f4"
],
"LoadBalancerArn": "arn:aws:elasticloadbalancing:ap-northeast-1:846239845603:loadbalancer/app/v2-api-balancer/db49ab0ecaef1de8",
"State": {
"Code": "active"
},
"CreatedTime": "2017-10-18T04:27:28.780Z",
"VpcId": "vpc-dbe3f2be",
"DNSName": "internal-v2-api-balancer-988454399.ap-northeast-1.elb.amazonaws.com",
"AvailabilityZones": [
{
"SubnetId": "subnet-7642062e",
"ZoneName": "ap-northeast-1c"
},
{
"SubnetId": "subnet-c454fa8d",
"ZoneName": "ap-northeast-1b"
}
],
"IpAddressType": "ipv4",
"Type": "application",
"LoadBalancerName": "v2-api-balancer",
"CanonicalHostedZoneId": "Z14GRHDCWA56QT"
}
]
}

$ aws apigateway create-vpc-link \ 
--name my-test-vpc-link-1 \
--target-arns "arn:aws:elasticloadbalancing:ap-northeast-1:846239845603:loadbalancer/app/v2-api-balancer/db49ab0ecaef1de8" 

{
"name": "my-test-vpc-link-1",
"targetArns": [
"arn:aws:elasticloadbalancing:ap-northeast-1:846239845603:loadbalancer/app/v2-api-balancer/db49ab0ecaef1de8"
],
"id": "7eexgn",
"status": "PENDING"
}

$ aws apigateway get-vpc-link --vpc-link-id 7eexgn

{
"id": "7eexgn",
"targetArns": [
"arn:aws:elasticloadbalancing:ap-northeast-1:846239845603:loadbalancer/app/v2-api-balancer/db49ab0ecaef1de8"
],
"status": "FAILED",
"name": "my-test-vpc-link-1",
"statusMessage": "NLB ARN is malformed"
}

Wanchia Tsai
  • 31
  • 1
  • 4
  • 1
    Note the string `/app/` in the ARN. That is an *Application* Load Balancer. A *Network* Load Balancer would have `/net/` here. – Michael - sqlbot Mar 08 '18 at 12:55
  • I was also mistakenly using an application load balancer (Terraform default) and seeing this error message. It's definitely end user error but the error message could also be better. – pdoherty926 Aug 27 '21 at 16:57

1 Answers1

11

VPC Links must be to a network LB. Looks like you are trying to use an application LB.

https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-nlb-for-vpclink-using-console.html