1 Answer
- Newest
- Most votes
- Most comments
0
There is no EB configuration option that allows you to specify fixed-response listener rules. What you can do instead is use EB's built-in functionality to add resource to the generated Cloudformation template to add a customer listener rule to your ALB with the desired fixed-response configuration. This is accomplished by creating a configuration file in the .ebextensions directory using the Resources key. You will need to find the CloudFormation resource name of the listener you wish to reference to add the rule. In the example below, it is AWSEBV2LoadBalancerListener443.
Example configuration file (.ebextensions/fixedResponse.config):
Resources: fixedResponse404Listener: Type: AWS::ElasticLoadBalancingV2::ListenerRule Properties: Actions: - Type: fixed-response FixedResponseConfig: StatusCode: 200 ContentType: "application/json" MessageBody: "{ \"hello\": \"world\"}" Conditions: - Field: path-pattern PathPatternConfig: Values: - "/my/fixed/response" ListenerArn: { "Ref" : "AWSEBV2LoadBalancerListener443" } Priority: 40000
Relevant documentation:
answered 2 years ago
Relevant content
- asked a year ago
- asked 4 years ago
