Sha256: 310804e7d0c10dd58afdeed5c6aa889852a7138ac9866b743a7e6ac3d28046cc

Contents?: true

Size: 1.18 KB

Versions: 13

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

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

13 entries across 13 versions & 1 rubygems

Version Path
awspec-1.31.0 lib/awspec/type/launch_template.rb
awspec-1.30.0 lib/awspec/type/launch_template.rb
awspec-1.29.3 lib/awspec/type/launch_template.rb
awspec-1.29.2 lib/awspec/type/launch_template.rb
awspec-1.29.1 lib/awspec/type/launch_template.rb
awspec-1.29.0 lib/awspec/type/launch_template.rb
awspec-1.28.2 lib/awspec/type/launch_template.rb
awspec-1.28.1 lib/awspec/type/launch_template.rb
awspec-1.28.0 lib/awspec/type/launch_template.rb
awspec-1.27.1 lib/awspec/type/launch_template.rb
awspec-1.27.0 lib/awspec/type/launch_template.rb
awspec-1.26.0 lib/awspec/type/launch_template.rb
awspec-1.25.2 lib/awspec/type/launch_template.rb