sparse-intern-71089
11/16/2018, 11:22 AMwhite-balloon-205
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:
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.ancient-match-5870
11/16/2018, 2:54 PMpath-pattern
twice (with different values). In this case you have to create to dedicated listener rules then.ancient-match-5870
11/16/2018, 2:58 PM