Hello, when trying to create aws target group of t...
# general
w
Hello, when trying to create aws target group of type ‘alb’ we get the following:
error: aws:lb/targetGroup:TargetGroup resource 'internal-lb-target-group' has a problem: expected target_type to be one of [instance ip lambda], got alb. Examine values at 'TargetGroup.TargetType'.
The alb type seems to not be supported by pulumi, which is a big problem for our pulumi managed infrastructure.
g
Can you share a bit of your code? I went digging in the code and don't see any reason that it wouldn't be supported, but I want to reproduce if I can so we can open an issue.
w
yes
Copy code
const internalLbTargetGroup = new aws.lb.TargetGroup("internal-lb-target-group", {
    name: "studio-internal-lb-target-group",
    targetType: "alb",
    port: 80,
    protocol: "HTTP",
    vpcId: vpc.id,
    healthCheck: {
        path: "/api/health",
        interval: 10,
        enabled: true,
    },
    tags: {
        Owner: "studio",
        project: "studio"
    },
});
In addition, you can see in the error message that there is no ‘alb’ option - [instance ip lambda] , and also in pulumi docs there is no mention to it, only in the aws docs. https://www.pulumi.com/registry/packages/aws/api-docs/alb/targetgroup/
@great-queen-39697
g
Ok, as I've stood up a similar bit of code, and I can create one with the ALB target type. However, the error is coming when we try to set it to the HTTP protocol. TCP works; HTTP does not. I'm looking into why
Ah, right. ALBs can only have TCP as a target protocol:
6. For Protocol, only TCP is allowed. Select the Port for your target group. This target group port must match the listener port of the Application Load Balancer. Alternatively, you can add or edit the listener port on the Application Load Balancer to match this port.
https://docs.aws.amazon.com/elasticloadbalancing/latest/network/application-load-balancer-target.html#register-application-load-balancer-target
w
thanks @great-queen-39697! i guess the error msg is confusing. anyway, you are the best, thanks again!
🙌 1