This message was deleted.
# general
s
This message was deleted.
w
Looks like there are two changes needed - both subtle. •
values
is actually a single string that represents a path pattern of values that will match the condition (e.g. it can use
*
) •
statusCode
is a string, not a number With those changes - the below looks like it should work:
Copy code
new aws.elasticloadbalancingv2.ListenerRule(`block-certain-routes`, {
    listenerArn: listener.arn,
    conditions: [{
        field: "path-pattern",
        values: "/test1",
    }],
    actions: [{
        type: "fixed-response",
        fixedResponse: {
            statusCode: "404",
            contentType: "text/plain",
            messageBody: "Not Found"
        }
    }]
});
The TypeScript errors are not being as helpful as they could be here unfortunately.
a
Yeah, it works! Thanks @white-balloon-205 - awesome! 🙂 Adding multiple conditions works, but you have to make sure that you don’t use e.g.
path-pattern
twice (with different values). In this case you have to create to dedicated listener rules then.
Also: @white-balloon-205 You’re doing an amazing job at Pulumi. This is actual the first time where “Infrastructure as Code” is “Infrastructure as Code”. Thanks for the hard work!