In Order to Whitelist my API Endpoints Served on AWS ElasticBeanstalk:
I would like to return a fixed response from an Application Load Balancer (ALB) in my Elastic Beanstalk environment when it receives unexpected requests.
I need to do this in a reproducible and automated way. Currently I configure my Elastic Beanstalk apps with CloudFormation templates and .ebextensions.
I know how to do configure the fixed response manually in the console by adding a listener rule:
I haven't been able to find a combination of option settings that support this in .ebextensions.
Also, unless I am missing something, CloudFormation appears to expose the same options as .ebextensions through OptionSettings on the environment here.
Is it possible to configure a fixed response in either .ebextensions or CloudFormation?
If not, is there another automation-friendly approach to accomplish the same? Perhaps through an AWS API?