Class: Ansible::Ruby::Modules::Ec2

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb,
lib/ansible/ruby/modules/custom/cloud/core/amazon/ec2.rb

Overview

Creates or terminates ec2 instances.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#assign_public_ipSymbol?

Returns when provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+.

Returns:

  • (Symbol, nil)

    when provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+



94
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 94

attribute :assign_public_ip

#countInteger?

Returns number of instances to launch.

Returns:

  • (Integer, nil)

    number of instances to launch



72
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 72

attribute :count

#count_tagHash, ...

Returns Used with ‘exact_count’ to determine how many nodes based on a specific tag criteria should be running. This can be expressed in multiple ways and is shown in the EXAMPLES section. For instance, one can request 25 servers that are tagged with “class=webserver”. The specified tag must already exist or be passed in as the ‘instance_tags’ option.

Returns:

  • (Hash, Array<String>, String, nil)

    Used with ‘exact_count’ to determine how many nodes based on a specific tag criteria should be running. This can be expressed in multiple ways and is shown in the EXAMPLES section. For instance, one can request 25 servers that are tagged with “class=webserver”. The specified tag must already exist or be passed in as the ‘instance_tags’ option.



136
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 136

attribute :count_tag

#ebs_optimizedString?

Returns whether instance is using optimized EBS volumes, see U(docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html).

Returns:



128
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 128

attribute :ebs_optimized

#exact_countInteger?

Returns An integer value which indicates how many instances that match the ‘count_tag’ parameter should be running. Instances are either created or terminated based on this value.

Returns:

  • (Integer, nil)

    An integer value which indicates how many instances that match the ‘count_tag’ parameter should be running. Instances are either created or terminated based on this value.



132
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 132

attribute :exact_count

#groupArray<String>, ...

Returns security group (or list of groups) to use with the instance.

Returns:

  • (Array<String>, String, nil)

    security group (or list of groups) to use with the instance



19
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 19

attribute :group

#group_idString?

Returns security group id (or list of ids) to use with the instance.

Returns:

  • (String, nil)

    security group id (or list of ids) to use with the instance



23
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 23

attribute :group_id

#idObject?

Returns identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances. This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on. For details, see the description of client token at U(docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).

Returns:

  • (Object, nil)

    identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances. This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on. For details, see the description of client token at U(docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).



16
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 16

attribute :id

#imageString

Returns I(ami) ID to use for the instance.

Returns:

  • (String)

    I(ami) ID to use for the instance



50
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 50

attribute :image

#instance_idsArray<String>, ...

Returns list of instance ids, currently used for states: absent, running, stopped.

Returns:

  • (Array<String>, String, nil)

    list of instance ids, currently used for states: absent, running, stopped



104
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 104

attribute :instance_ids

#instance_initiated_shutdown_behavior:stop, ...

Returns Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store images (which require termination on shutdown).

Returns:

  • (:stop, :terminate, nil)

    Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store images (which require termination on shutdown).



116
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 116

attribute :instance_initiated_shutdown_behavior

#instance_profile_nameObject?

Returns Name of the IAM instance profile (i.e. what the EC2 console refers to as an “IAM Role”) to use. Boto library must be 2.5.0+.

Returns:

  • (Object, nil)

    Name of the IAM instance profile (i.e. what the EC2 console refers to as an “IAM Role”) to use. Boto library must be 2.5.0+



101
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 101

attribute :instance_profile_name

#instance_tagsHash?

Returns a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; ‘“key”:“value”’ and ‘“key”:“value”,“key”:“value”’.

Returns:

  • (Hash, nil)

    a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; ‘“key”:“value”’ and ‘“key”:“value”,“key”:“value”’



83
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 83

attribute :instance_tags

#instance_typeString

Returns instance type to use for the instance, see U(docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).

Returns:



34
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 34

attribute :instance_type

#kernelObject?

Returns kernel I(eki) to use for the instance.

Returns:

  • (Object, nil)

    kernel I(eki) to use for the instance



54
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 54

attribute :kernel

#key_nameString?

Returns key pair to use on the instance.

Returns:

  • (String, nil)

    key pair to use on the instance



12
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 12

attribute :key_name

#monitoring:yes, ...

Returns enable detailed monitoring (CloudWatch) for instance.

Returns:

  • (:yes, :no, nil)

    enable detailed monitoring (CloudWatch) for instance



76
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 76

attribute :monitoring

#network_interfacesArray<String>, ...

Returns A list of existing network interfaces to attach to the instance at launch. When specifying existing network interfaces, none of the assign_public_ip, private_ip, vpc_subnet_id, group, or group_id parameters may be used. (Those parameters are for creating a new network interface at launch.).

Returns:

  • (Array<String>, String, nil)

    A list of existing network interfaces to attach to the instance at launch. When specifying existing network interfaces, none of the assign_public_ip, private_ip, vpc_subnet_id, group, or group_id parameters may be used. (Those parameters are for creating a new network interface at launch.)



140
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 140

attribute :network_interfaces

#placement_groupObject?

Returns placement group for the instance when using EC2 Clustered Compute.

Returns:

  • (Object, nil)

    placement group for the instance when using EC2 Clustered Compute



87
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 87

attribute :placement_group

#private_ipObject?

Returns the private ip address to assign the instance (from the vpc subnet).

Returns:

  • (Object, nil)

    the private ip address to assign the instance (from the vpc subnet)



98
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 98

attribute :private_ip

#ramdiskObject?

Returns ramdisk I(eri) to use for the instance.

Returns:

  • (Object, nil)

    ramdisk I(eri) to use for the instance



57
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 57

attribute :ramdisk

#regionString?

Returns The AWS region to use. Must be specified if ec2_url is not used. If not specified then the value of the EC2_REGION environment variable, if any, is used. See U(docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region).

Returns:



27
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 27

attribute :region

#source_dest_checkSymbol?

Returns Enable or Disable the Source/Destination checks (for NAT instances and Virtual Routers). When initially creating an instance the EC2 API defaults this to True.

Returns:

  • (Symbol, nil)

    Enable or Disable the Source/Destination checks (for NAT instances and Virtual Routers). When initially creating an instance the EC2 API defaults this to True.



108
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 108

attribute :source_dest_check

#spot_launch_groupString?

Returns:



144
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 144

attribute :spot_launch_group

#spot_priceFloat?

Returns Maximum spot price to bid, If not set a regular on-demand instance is requested. A spot request is made with this maximum bid. When it is filled, the instance is started.

Returns:

  • (Float, nil)

    Maximum spot price to bid, If not set a regular on-demand instance is requested. A spot request is made with this maximum bid. When it is filled, the instance is started.



42
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 42

attribute :spot_price

#spot_type:"one-time", ...

Returns Type of spot request; one of “one-time” or “persistent”. Defaults to “one-time” if not supplied.

Returns:

  • (:"one-time", :persistent, nil)

    Type of spot request; one of “one-time” or “persistent”. Defaults to “one-time” if not supplied.



46
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 46

attribute :spot_type

#spot_wait_timeoutInteger?

Returns how long to wait for the spot instance request to be fulfilled.

Returns:

  • (Integer, nil)

    how long to wait for the spot instance request to be fulfilled



68
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 68

attribute :spot_wait_timeout

#state:present, ...

Returns create, terminate, start, stop or restart instances. The state ‘restarted’ was added in 2.2.

Returns:

  • (:present, :absent, :running, :restarted, :stopped, nil)

    create, terminate, start, stop or restart instances. The state ‘restarted’ was added in 2.2



120
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 120

attribute :state

#tenancy:default, ...

Returns An instance with a tenancy of “dedicated” runs on single-tenant hardware and can only be launched into a VPC. Note that to use dedicated tenancy you MUST specify a vpc_subnet_id as well. Dedicated tenancy is not available for EC2 “micro” instances.

Returns:

  • (:default, :dedicated, nil)

    An instance with a tenancy of “dedicated” runs on single-tenant hardware and can only be launched into a VPC. Note that to use dedicated tenancy you MUST specify a vpc_subnet_id as well. Dedicated tenancy is not available for EC2 “micro” instances.



38
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 38

attribute :tenancy

#termination_protection:yes, ...

Returns Enable or Disable the Termination Protection.

Returns:

  • (:yes, :no, nil)

    Enable or Disable the Termination Protection



112
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 112

attribute :termination_protection

#user_dataObject?

Returns opaque blob of data which is made available to the ec2 instance.

Returns:

  • (Object, nil)

    opaque blob of data which is made available to the ec2 instance



80
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 80

attribute :user_data

#volumesArray<Hash>, ...

Returns a list of hash/dictionaries of volumes to add to the new instance; ‘[“key”:“value”]’; keys allowed are - device_name (str; required), delete_on_termination (bool; False), device_type (deprecated), ephemeral (str), encrypted (bool; False), snapshot (str), volume_type (str), volume_size (int, GB), iops (int) - device_type is deprecated use volume_type, iops must be set when volume_type=‘io1’, ephemeral and snapshot are mutually exclusive.

Returns:

  • (Array<Hash>, Hash, nil)

    a list of hash/dictionaries of volumes to add to the new instance; ‘[“key”:“value”]’; keys allowed are - device_name (str; required), delete_on_termination (bool; False), device_type (deprecated), ephemeral (str), encrypted (bool; False), snapshot (str), volume_type (str), volume_size (int, GB), iops (int) - device_type is deprecated use volume_type, iops must be set when volume_type=‘io1’, ephemeral and snapshot are mutually exclusive.



124
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 124

attribute :volumes

#vpc_subnet_idString?

Returns the subnet ID in which to launch the instance (VPC).

Returns:

  • (String, nil)

    the subnet ID in which to launch the instance (VPC)



90
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 90

attribute :vpc_subnet_id

#wait:yes, ...

Returns wait for the instance to reach its desired state before returning. Does not wait for SSH, see ‘wait_for_connection’ example for details.

Returns:

  • (:yes, :no, nil)

    wait for the instance to reach its desired state before returning. Does not wait for SSH, see ‘wait_for_connection’ example for details.



60
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 60

attribute :wait

#wait_timeoutInteger?

Returns how long before wait gives up, in seconds.

Returns:

  • (Integer, nil)

    how long before wait gives up, in seconds



64
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 64

attribute :wait_timeout

#zoneObject?

Returns AWS availability zone in which to launch the instance.

Returns:

  • (Object, nil)

    AWS availability zone in which to launch the instance



31
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/ec2.rb', line 31

attribute :zone