Method: AWS::EC2::Instance#associate_elastic_ip
- Defined in:
- lib/aws/ec2/instance.rb
#associate_elastic_ip(elastic_ip) ⇒ nil #associate_elastic_ip(allocation_id) ⇒ nil Also known as: ip_address=
Associates the elastic IP address with this instance.
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
# File 'lib/aws/ec2/instance.rb', line 596 def associate_elastic_ip elastic_ip client_opts = {} client_opts[:instance_id] = self.id if vpc? client_opts[:allocation_id] = elastic_ip.is_a?(ElasticIp) ? elastic_ip.allocation_id : elastic_ip.to_s else client_opts[:public_ip] = elastic_ip.to_s end client.associate_address(client_opts) nil end |