-1

I have an Elastic Beanstalk environment with load balancer. Also I have an hosted zone associated with the load balancer in order to access the environment via custom domain name.

Now I want a static IP to use in Tableau Trusted Authentication. I am confused. I can't figure out from where I can get the required static IP.

The answer accepted on this question is 5 years old and things have changed since then.

halfer
  • 19,824
  • 17
  • 99
  • 186
ujjwal garg
  • 711
  • 3
  • 8
  • 18
  • Possible duplicate of [Elastic IP on application deployed using Elastic Beanstalk](https://stackoverflow.com/questions/10475287/elastic-ip-on-application-deployed-using-elastic-beanstalk) – Chacko Jan 05 '18 at 06:33

2 Answers2

2

Sadly there is no way to auto asign an Elastic-ip on a load balancer since AWS only provides support for the DNS.

But there is another solution, to add a script that auto asign an ip to an instance on boot. As the next references suggest.

https://support.asperasoft.com/hc/en-us/articles/216129788-Server-on-Demand-with-EIP-and-Autoscale#prereqs

https://blog.cloudthat.com/auto-attach-elastic-ip-to-ec2-classic-instance-for-autoscaling/

https://github.com/skymill/aws-ec2-assign-elastic-ip

You need to do the next steps:

  1. Set aside as many elastic ip as the max number of instances in your Auto Scaling Group

  2. Create an instance with the current Elastic Beanstalk AMI

  3. Install aws-ec2-assign-elastic-ip using python's pip.

  4. Add the current script to the instance

    #!/bin/sh
    #
    # This script is launched at boot, and assigns an AWS elastic ip.
    
    AWS_ACCESS_KEY_ID=#<acces_key_value>#
    AWS_SECRET_ACCESS_KEY=#<Secret_key_Value>#
    
    #Regions Virgina: us-east1   Oregon: us-west2 ...
    AWS_DEFAULT_REGION=#<EB_ENV_REGION>#
    
    #Set of valid IP comma(,) separated
    VALID_IP_VALUES=<IP_VALUE>,<IP_VALUE>,<...>
    
    
    /usr/local/bin/aws-ec2-assign-elastic-ip --region  $AWS_DEFAULT_REGION --access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --valid-ips $VALID_IP_VALUES
    
  5. Add this script at /etc/rc.local

    bash /usr/local/bin/auto-assign-eip.sh
    
  6. Create a new base AMI using this instance, and set it as your EB AMI.

0

You mean you want to access the elastic beanstalk application using Static IP? If you want to access your application using static IP then go and spin up a EC2 and deploy your application. The assign a static Elastic IP to that instance. Elastic IP is a static public IP which wont change unless you release it. For more about AWS Elastic IP see the below link.

AWS Elastic IP

Vaisakh PS
  • 1,181
  • 2
  • 10
  • 19
  • I tried assocating an elastic IP to ec2 instance but it didn't work. I guess I need to associate IP to elastic beanstalk load balancer. – ujjwal garg Jan 04 '18 at 13:31