I have AWS AutoScale setup with ELB attached. In General, the APIs deployed on EC2 instances of AutoScale are successfully getting requests from Loadbalancer and responses to the clients are okay. However, Now I have developed a new API that requires Client's IP address. In the current setup, Loadbalancer changes the source IP address.
I have gone through this document http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/enable-proxy-protocol.html and I know that it is possible with Proxy Protocol
I have created the policy using this AWS CLI command
aws elb create-load-balancer-policy --load-balancer-name LB-autoscale --policy-name my-ProxyProtocol-policy --policy-type-name ProxyProtocolPolicyType --policy-attributes AttributeName=ProxyProtocol,AttributeValue=true
Question: How to set this load balancer policy for the backend EC2 servers created by AutoScale group automatically? So whenever autoscale group launches a new EC2 instance, the proxyProtocol should be enabled for that instance, and the API deployed on that instance should get the original IP of Client.