@return [Time]
@return [String] Returns the attachment id.
@return [Boolean]
@return [Boolean]
@return [Integer] The index of the device for the network
interface attachment on the instance.
@return [String] Returns the attachment id.
@return [Instance] Returns the instance the network interface
is attached to.
@return [String] Returns the instance owner id.
@return [NetworkInterface] Returns the network interface this
is an attachment for.
@return [Symbol] Returns the attachment status.
# File lib/aws/ec2/network_interface/attachment.rb, line 21 def initialize network_interface, details @network_interface = network_interface @attachment_id = details.attachment_id @instance = Instance.new(details.instance_id, :owner_id => details.instance_owner_id, :config => network_interface.config) @instance_owner_id = details.instance_owner_id @device_index = details.device_index @status = details.status.to_sym @attach_time = details.attach_time @delete_on_termination = details.delete_on_termination? end
Allows you to toggle the delete on termination state.
network_interface.attachment.delete_on_termination = false
@param [Boolean] state
# File lib/aws/ec2/network_interface/attachment.rb, line 71 def delete_on_termination= state opts = {} opts[:network_interface_id] = network_interface.id opts[:attachment] = {} opts[:attachment][:attachment_id] = id opts[:attachment][:delete_on_termination] = state network_interface.client.modify_network_interface_attribute(opts) end
Detaches the network interface from the instance.
@param [Hash] options
@option options [Boolean] :force (false) Set true to force
a detachment.
@return [nil]
# File lib/aws/ec2/network_interface/attachment.rb, line 89 def detach options = {} client_opts = {} client_opts[:attachment_id] = attachment_id client_opts[:force] = options[:force] == true network_interface.client.detach_network_interface(client_opts) end