Sha256: b0796443b18a0289710827edb1c1e9ca2d32426087f8cdcf3d1a66f18de30d77

Contents?: true

Size: 1.15 KB

Versions: 45

Compression:

Stored size: 1.15 KB

Contents

module Awspec::Type
  class LaunchTemplate < ResourceBase
    attr_accessor :version
    tags_allowed

    def resource_via_client
      @resource_via_client ||= find_launch_template(@display_name)
    end

    def id
      @id ||= resource_via_client.launch_template_id if resource_via_client
    end

    def has_version_number?(version_number)
      launch_template_versions = find_launch_template_versions(@id)
      launch_template_versions.launch_template_versions.each do |launch_template_version|
        return true if launch_template_version.version_number.to_s == version_number.to_s
      end
    end

    # launch_template_versions
    define_method 'launch_template_version' do
      if @version.nil? || @version == 'default'
        @version = '$Default'
      elsif @version == 'latest'
        @version = '$Latest'
      end
      res = ec2_client.describe_launch_template_versions({
                                                           launch_template_id: @id,
                                                           versions: [@version.to_s]
                                                         }).launch_template_versions.first
    end
  end
end

Version data entries

45 entries across 45 versions & 3 rubygems

Version Path
awspec-1.25.1 lib/awspec/type/launch_template.rb
awspec-1.25.0 lib/awspec/type/launch_template.rb
awspec-1.24.4 lib/awspec/type/launch_template.rb
awspec-1.24.3 lib/awspec/type/launch_template.rb
awspec-1.24.2 lib/awspec/type/launch_template.rb
awspec-1.24.1 lib/awspec/type/launch_template.rb
awspec-1.24.0 lib/awspec/type/launch_template.rb
awspec-1.23.0 lib/awspec/type/launch_template.rb
awspec-1.22.1 lib/awspec/type/launch_template.rb
awspec-1.22.0 lib/awspec/type/launch_template.rb
awspec-1.21.1 lib/awspec/type/launch_template.rb
awspec-1.21.0 lib/awspec/type/launch_template.rb
awspec-1.20.0 lib/awspec/type/launch_template.rb
awspec-1.19.2 lib/awspec/type/launch_template.rb
awspec-1.19.1 lib/awspec/type/launch_template.rb
awspec-1.19.0 lib/awspec/type/launch_template.rb
cthiesfork-awspec-1.2.4 lib/awspec/type/launch_template.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/type/launch_template.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/type/launch_template.rb
awspec-1.18.6 lib/awspec/type/launch_template.rb