Class: Convection::Model::Template::Resource::EC2Instance

Inherits:
Convection::Model::Template::Resource show all
Includes:
Mixin::Taggable
Defined in:
lib/convection/model/template/resource/aws_ec2_instance.rb

Overview

AWS::EC2::Instance

Instance Attribute Summary

Attributes inherited from Convection::Model::Template::Resource

#exist, #name, #parent, #properties, #resource_attributes, #template

Instance Method Summary collapse

Methods included from Mixin::Taggable

#immutable_metadata, #render_tags, #tag, #tags

Methods inherited from Convection::Model::Template::Resource

#as_attribute, attach_method, #deletion_policy, #depends_on, #initialize, properties, #property, property, #reference, type, #type, #with_output

Methods included from Mixin::Conditional

#condition, #render_condition

Methods included from DSL::Template::Resource

attach_resource

Methods included from DSL::Helpers

#camel_case, included, method_name, #screaming_snake_case, #snake_case

Methods included from DSL::IntrinsicFunctions

#base64, #find_in_map, #fn_and, #fn_equals, #fn_if, #fn_not, #fn_or, #fn_ref, #get_att, #get_azs, #join, #select

Constructor Details

This class inherits a constructor from Convection::Model::Template::Resource

Instance Method Details

#availability_zoneObject #availability_zone(value) ⇒ Object

Overloads:

  • #availability_zoneObject

    Returns the value of the 'AvailabilityZone' CloudFormation property.

  • #availability_zone(value) ⇒ Object

    Sets the 'AvailabilityZone' CloudFormation property.

    Parameters:

    • value

      the value to set the 'AvailabilityZone' CloudFormation property to.



14
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 14

property :availability_zone, 'AvailabilityZone'

#block_device(&block) ⇒ Object

Append a block device mapping



37
38
39
40
41
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 37

def block_device(&block)
  block_device = ResourceProperty::EC2BlockDeviceMapping.new(self)
  block_device.instance_exec(&block) if block
  block_devices << block_device
end

#block_devicesObject #block_devices(value) ⇒ Object

Overloads:

  • #block_devicesObject

    Returns the value of the 'BlockDeviceMappings' CloudFormation property.

  • #block_devices(value) ⇒ Object

    Sets the 'BlockDeviceMappings' CloudFormation property.

    Parameters:

    • value

      the value to set the 'BlockDeviceMappings' CloudFormation property to.



25
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 25

property :block_devices, 'BlockDeviceMappings', :type => :list

#disable_api_terminationObject #disable_api_termination(value) ⇒ Object

Overloads:

  • #disable_api_terminationObject

    Returns the value of the 'DisableApiTermination' CloudFormation property.

  • #disable_api_termination(value) ⇒ Object

    Sets the 'DisableApiTermination' CloudFormation property.

    Parameters:

    • value

      the value to set the 'DisableApiTermination' CloudFormation property to.



23
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 23

property :disable_api_termination, 'DisableApiTermination'

#image_idObject #image_id(value) ⇒ Object

Overloads:

  • #image_idObject

    Returns the value of the 'ImageId' CloudFormation property.

  • #image_id(value) ⇒ Object

    Sets the 'ImageId' CloudFormation property.

    Parameters:

    • value

      the value to set the 'ImageId' CloudFormation property to.



15
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 15

property :image_id, 'ImageId'

#instance_profileObject #instance_profile(value) ⇒ Object

Overloads:

  • #instance_profileObject

    Returns the value of the 'IamInstanceProfile' CloudFormation property.

  • #instance_profile(value) ⇒ Object

    Sets the 'IamInstanceProfile' CloudFormation property.

    Parameters:

    • value

      the value to set the 'IamInstanceProfile' CloudFormation property to.



17
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 17

property :instance_profile, 'IamInstanceProfile'

#instance_typeObject #instance_type(value) ⇒ Object

Overloads:

  • #instance_typeObject

    Returns the value of the 'InstanceType' CloudFormation property.

  • #instance_type(value) ⇒ Object

    Sets the 'InstanceType' CloudFormation property.

    Parameters:

    • value

      the value to set the 'InstanceType' CloudFormation property to.



16
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 16

property :instance_type, 'InstanceType'

#key_nameObject #key_name(value) ⇒ Object

Overloads:

  • #key_nameObject

    Returns the value of the 'KeyName' CloudFormation property.

  • #key_name(value) ⇒ Object

    Sets the 'KeyName' CloudFormation property.

    Parameters:

    • value

      the value to set the 'KeyName' CloudFormation property to.



18
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 18

property :key_name, 'KeyName'

#network_interface(&block) ⇒ Object

Append a network interface to network_interfaces



29
30
31
32
33
34
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 29

def network_interface(&block)
  interface = ResourceProperty::EC2NetworkInterface.new(self)
  interface.instance_exec(&block) if block
  interface.device_index = network_interfaces.count.to_s
  network_interfaces << interface
end

#network_interfacesObject #network_interfaces(value) ⇒ Object

Overloads:

  • #network_interfacesObject

    Returns the value of the 'NetworkInterfaces' CloudFormation property.

  • #network_interfaces(value) ⇒ Object

    Sets the 'NetworkInterfaces' CloudFormation property.

    Parameters:

    • value

      the value to set the 'NetworkInterfaces' CloudFormation property to.



24
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 24

property :network_interfaces, 'NetworkInterfaces', :type => :list

#render(*args) ⇒ Object



50
51
52
53
54
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 50

def render(*args)
  super.tap do |resource|
    render_tags(resource)
  end
end

#security_groupObject #security_group(value) ⇒ Object

Overloads:

  • #security_groupObject

    Returns the value of the 'SecurityGroupIds' CloudFormation property.

  • #security_group(value) ⇒ Object

    Sets the 'SecurityGroupIds' CloudFormation property.

    Parameters:

    • value

      the value to set the 'SecurityGroupIds' CloudFormation property to.



21
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 21

property :security_group, 'SecurityGroupIds', :type => :list

#src_dst_checksObject #src_dst_checks(value) ⇒ Object

Overloads:

  • #src_dst_checksObject

    Returns the value of the 'SourceDestCheck' CloudFormation property.

  • #src_dst_checks(value) ⇒ Object

    Sets the 'SourceDestCheck' CloudFormation property.

    Parameters:

    • value

      the value to set the 'SourceDestCheck' CloudFormation property to.



22
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 22

property :src_dst_checks, 'SourceDestCheck'

#subnetObject #subnet(value) ⇒ Object

Overloads:

  • #subnetObject

    Returns the value of the 'SubnetId' CloudFormation property.

  • #subnet(value) ⇒ Object

    Sets the 'SubnetId' CloudFormation property.

    Parameters:

    • value

      the value to set the 'SubnetId' CloudFormation property to.



19
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 19

property :subnet, 'SubnetId'

#user_dataObject #user_data(value) ⇒ Object

Overloads:

  • #user_dataObject

    Returns the value of the 'UserData' CloudFormation property.

  • #user_data(value) ⇒ Object

    Sets the 'UserData' CloudFormation property.

    Parameters:

    • value

      the value to set the 'UserData' CloudFormation property to.



20
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 20

property :user_data, 'UserData'

#volume(&block) ⇒ Object

Append a volume to volumes



44
45
46
47
48
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 44

def volume(&block)
  volume = ResourceProperty::EC2MountPoint.new(self)
  volume.instance_exec(&block) if block
  volumes << volume
end

#volumesObject #volumes(value) ⇒ Object

Overloads:

  • #volumesObject

    Returns the value of the 'Volumes' CloudFormation property.

  • #volumes(value) ⇒ Object

    Sets the 'Volumes' CloudFormation property.

    Parameters:

    • value

      the value to set the 'Volumes' CloudFormation property to.



26
# File 'lib/convection/model/template/resource/aws_ec2_instance.rb', line 26

property :volumes, 'Volumes', :type => :list