Method: AWS::EC2::ElasticIp#delete

Defined in:
lib/aws/ec2/elastic_ip.rb

#deletenil Also known as: release

Releases the elastic IP address.

(For non-VPC elastic ips) Releasing an IP address automatically disassociates it from any instance it’s associated with.

Returns:

  • (nil)


102
103
104
105
106
107
108
109
# File 'lib/aws/ec2/elastic_ip.rb', line 102

def delete
  if vpc?
    client.release_address(:allocation_id => allocation_id)
  else
    client.release_address(:public_ip => public_ip)
  end
  nil
end