Sha256: 3d866735f7c29cc717d833a19e529288da34e3f9a0e15059c0152123f157a2db

Contents?: true

Size: 1.36 KB

Versions: 12

Compression:

Stored size: 1.36 KB

Contents

require_relative '../resource'

module Convection
  module Model
    class Template
      class Resource
        ##
        # AWS::EC2::Instance
        ##
        class EC2Instance < Resource
          include Model::Mixin::Taggable

          type 'AWS::EC2::Instance'
          property :availability_zone, 'AvailabilityZone'
          property :image_id, 'ImageId'
          property :instance_type, 'InstanceType'
          property :instance_profile, 'IamInstanceProfile'
          property :key_name, 'KeyName'
          property :subnet, 'SubnetId'
          property :user_data, 'UserData'
          property :security_group, 'SecurityGroupIds', :type => :list
          property :src_dst_checks, 'SourceDestCheck'
          property :disable_api_termination, 'DisableApiTermination'
          property :network_interfaces, 'NetworkInterfaces', :type => :list

          # Append a network interface to network_interfaces
          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

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
convection-0.2.15 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.14 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.13 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.12 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.11 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.10 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.9 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.8 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.7 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.6 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.5 lib/convection/model/template/resource/aws_ec2_instance.rb
convection-0.2.4 lib/convection/model/template/resource/aws_ec2_instance.rb