This message was deleted.
# typescript
s
This message was deleted.
f
Here's my code:
Copy code
const vpc = new awsx.ec2.Vpc("vpc", {
   numberOfAvailabilityZones: 3,
})

const sgLoadBalancer = new awsx.ec2.SecurityGroup("load-balancer", {
    vpc: vpc,
    egress: [{
        protocol: "all",
        fromPort: 0,
        toPort: 65535,
        cidrBlocks: ["0.0.0.0/0"],
    }],
    ingress: [{
        protocol: "tcp",
        fromPort: 443,
        toPort: 443,
        cidrBlocks: ["0.0.0.0/0"],
        ipv6CidrBlocks: ["::/0"],
    }],
})

const alb = new awsx.elasticloadbalancingv2.ApplicationLoadBalancer("web", {
    accessLogs: {
        bucket: s3AccessLogsBucketName,
        enabled: true,
        prefix: "load-balancer",
    },
    enableDeletionProtection: true,
    external: true,
    securityGroups: [sgLoadBalancer],
    subnets: vpc.publicSubnetIds,
    vpc: vpc,
})

const webTargetGroup = alb.createTargetGroup("web", {
    port: 8001,
    protocol: "HTTP",
    healthCheck: {
        path: "/health",
    },
})

const listener = alb.createListener("web-listener", {
    protocol: "HTTPS",
    sslPolicy: "ELBSecurityPolicy-TLS-1-2-2017-01",
    certificateArn: acm.acmSSLCert.arn,
    defaultActions: [{
        type: "forward",
        targetGroupArn: webTargetGroup.targetGroup.arn,
    }]
})
g
Do you get this error on the first
up
or after making additional changes?
f
any
up
since the alb definitions were added. I since then gave up and resorted to use regular
@pulumi/aws
alb resources, which works.
g
So the ALB was already created and then you added the target group and listener and that's when you got the error?
f
no, they were all added/created together
g
oh, I see
f
the vpc and sg existed, then I added alb, target group and listener
g
I believe you're hitting https://github.com/pulumi/pulumi-awsx/issues/361. Until that's resolved, using the aws package is the best workaround.
f
yes, that's exactly the issue. thanks.