# File lib/fog/aws/requests/compute/associate_address.rb, line 24 def associate_address(instance_id=nil, public_ip=nil, network_interface_id=nil, allocation_id=nil) # Cannot specify an allocation ip and a public IP at the same time. If you have an allocation Id presumably you are in a VPC # so we will null out the public IP public_ip = allocation_id.nil? ? public_ip : nil request( 'Action' => 'AssociateAddress', 'AllocationId' => allocation_id, 'InstanceId' => instance_id, 'NetworkInterfaceId' => network_interface_id, 'PublicIp' => public_ip, :idempotent => true, :parser => Fog::Parsers::Compute::AWS::AssociateAddress.new ) end