Class: AWSCDK::EC2::CfnInstance::LaunchTemplateSpecificationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/cfn_instance.rb

Overview

Specifies a launch template to use when launching an Amazon EC2 instance.

You must specify the following:

  • The ID or the name of the launch template, but not both.
  • The version of the launch template.

For information about creating a launch template, see AWS::EC2::LaunchTemplate and Create a launch template in the Amazon EC2 User Guide . For example launch templates, see the Examples for AWS::EC2::LaunchTemplate .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version:, launch_template_id: nil, launch_template_name: nil) ⇒ LaunchTemplateSpecificationProperty

Returns a new instance of LaunchTemplateSpecificationProperty.

Parameters:

  • version (String)

    The version number of the launch template. You must specify this property.

  • launch_template_id (String, nil) (defaults to: nil)

    The ID of the launch template.

  • launch_template_name (String, nil) (defaults to: nil)

    The name of the launch template.



1788
1789
1790
1791
1792
1793
1794
1795
# File 'ec2/cfn_instance.rb', line 1788

def initialize(version:, launch_template_id: nil, launch_template_name: nil)
  @version = version
  Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "version")
  @launch_template_id = launch_template_id
  Jsii::Type.check_type(@launch_template_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchTemplateId") unless @launch_template_id.nil?
  @launch_template_name = launch_template_name
  Jsii::Type.check_type(@launch_template_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchTemplateName") unless @launch_template_name.nil?
end

Instance Attribute Details

#launch_template_idString? (readonly)

The ID of the launch template.

You must specify either the launch template ID or the launch template name, but not both.



1810
1811
1812
# File 'ec2/cfn_instance.rb', line 1810

def launch_template_id
  @launch_template_id
end

#launch_template_nameString? (readonly)

The name of the launch template.

You must specify either the launch template ID or the launch template name, but not both.



1817
1818
1819
# File 'ec2/cfn_instance.rb', line 1817

def launch_template_name
  @launch_template_name
end

#versionString (readonly)

The version number of the launch template. You must specify this property.

To specify the default version of the template, use the Fn::GetAtt intrinsic function to retrieve the DefaultVersionNumber attribute of the launch template. To specify the latest version of the template, use Fn::GetAtt to retrieve the LatestVersionNumber attribute. For more information, see AWS::EC2:LaunchTemplate return values for Fn::GetAtt .



1803
1804
1805
# File 'ec2/cfn_instance.rb', line 1803

def version
  @version
end

Class Method Details

.jsii_propertiesObject



1819
1820
1821
1822
1823
1824
1825
# File 'ec2/cfn_instance.rb', line 1819

def self.jsii_properties
  {
    :version => "version",
    :launch_template_id => "launchTemplateId",
    :launch_template_name => "launchTemplateName",
  }
end

Instance Method Details

#to_jsiiObject



1827
1828
1829
1830
1831
1832
1833
1834
1835
# File 'ec2/cfn_instance.rb', line 1827

def to_jsii
  result = {}
  result.merge!({
    "version" => @version,
    "launchTemplateId" => @launch_template_id,
    "launchTemplateName" => @launch_template_name,
  })
  result.compact
end