Method: Fog::Compute::AWS::Real#associate_address

Defined in:
lib/fog/compute/requests/aws/associate_address.rb

#associate_address(instance_id, public_ip) ⇒ Object

Associate an elastic IP address with an instance

Parameters

  • instance_id<~String> - Id of instance to associate address with

  • public_ip<~String> - Public ip to assign to instance

Returns

  • response<~Excon::Response>:

    • body<~Hash>:

      • ‘requestId’<~String> - Id of request

      • ‘return’<~Boolean> - success?

Amazon API Reference



21
22
23
24
25
26
27
28
29
# File 'lib/fog/compute/requests/aws/associate_address.rb', line 21

def associate_address(instance_id, public_ip)
  request(
    'Action'      => 'AssociateAddress',
    'InstanceId'  => instance_id,
    'PublicIp'    => public_ip,
    :idempotent   => true,
    :parser       => Fog::Parsers::Compute::AWS::Basic.new
  )
end