https://pulumi.com logo
#aws
Title
# aws
t

tall-scientist-89115

09/03/2020, 8:50 AM
Hey, fairly new here. Attempting to import an existing load balancer and I'm hitting a length constraint on the import identifier:
Copy code
const main = new aws.elb.LoadBalancer("qa-elb", {
    name: "qa-elb",
    ...
}, { import: "arn:aws:elasticloadbalancing:us-west-2:115325214166:loadbalancer/app/a-really-long-arn1233412asd1 });
=> error: Preview failed: refreshing urnpulumistaging-managed-infra:infraawselb/loadBalancerLoadBalancerredjade qa Error retrieving ELB: ValidationError: LoadBalancer name cannot be longer than 32 characters Is there any way to work around this? Thanks!
b

broad-dog-22463

09/03/2020, 9:49 AM
Hi @tall-scientist-89115 Drop the ARN and just add the name of the LoadBalancer to the import...
that should work
t

tall-scientist-89115

09/03/2020, 3:15 PM
No luck there, tried the DNS name (the-name-122293299.us-west-2.elb.amazonaws.com) and the name name (the-name)
b

broad-dog-22463

09/03/2020, 4:14 PM
So the name of the ELB in the import statement needs to be the name of the ELB in the resource declaration
t

tall-scientist-89115

09/03/2020, 5:02 PM
Right on, yeah it is, here is the full statement for reference (this yields not found):
Copy code
const main = new aws.elb.LoadBalancer("redjade-qa", {
    name: "redjade-qa",
    availabilityZones: ["us-west-2c", "us-west-2a"],
    listeners: [{
        instancePort: 80,
        instanceProtocol: "http",
        lbPort: 80,
        lbProtocol: "http",
    }, {
      instancePort: 443,
      instanceProtocol: "https",
      lbPort: 443,
      lbProtocol: "https"
    }],
}, { import: "redjade-qa" });
The actual resource copied out of the UI:
Copy code
Name
redjade-qa
ARN
arn:aws:elasticloadbalancing:us-west-2:115325214166:loadbalancer/app/redjade-qa/ac143d25c93cb8fa
DNS name
<http://redjade-qa-122293299.us-west-2.elb.amazonaws.com|redjade-qa-122293299.us-west-2.elb.amazonaws.com>
b

broad-dog-22463

09/03/2020, 5:42 PM
so you are all good now?
t

tall-scientist-89115

09/03/2020, 5:51 PM
Nah sadly, I was just stating that the name does match the existing resource
You're saying that
redjade-qa
should work? The ARN should also work but it's too long. Is there anything else I can try?
ended up just recreating it manually