Class: AWSCDK::EC2::CfnSpotFleet::FleetLaunchTemplateSpecificationProperty

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

Overview

Specifies the launch template to be used by the Spot Fleet request for configuring Amazon EC2 instances.

You must specify the following:

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

FleetLaunchTemplateSpecification is a property of the AWS::EC2::SpotFleet resource.

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

For examples of launch templates, see Examples .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of FleetLaunchTemplateSpecificationProperty.

Parameters:

  • version (String)

    The version number of the launch template.

  • 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.



1020
1021
1022
1023
1024
1025
1026
1027
# File 'ec2/cfn_spot_fleet.rb', line 1020

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 the LaunchTemplateId or the LaunchTemplateName , but not both.



1042
1043
1044
# File 'ec2/cfn_spot_fleet.rb', line 1042

def launch_template_id
  @launch_template_id
end

#launch_template_nameString? (readonly)

The name of the launch template.

You must specify the LaunchTemplateName or the LaunchTemplateId , but not both.



1049
1050
1051
# File 'ec2/cfn_spot_fleet.rb', line 1049

def launch_template_name
  @launch_template_name
end

#versionString (readonly)

The version number of the launch template.

Specifying $Latest or $Default for the template version number is not supported. However, you can specify LatestVersionNumber or DefaultVersionNumber using the Fn::GetAtt intrinsic function. For more information, see Fn::GetAtt .



1035
1036
1037
# File 'ec2/cfn_spot_fleet.rb', line 1035

def version
  @version
end

Class Method Details

.jsii_propertiesObject



1051
1052
1053
1054
1055
1056
1057
# File 'ec2/cfn_spot_fleet.rb', line 1051

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

Instance Method Details

#to_jsiiObject



1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'ec2/cfn_spot_fleet.rb', line 1059

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