Class: AWSCDK::EC2::CfnEC2Fleet::FleetLaunchTemplateSpecificationRequestProperty

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

Overview

Specifies the launch template to be used by the EC2 Fleet 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.

FleetLaunchTemplateSpecificationRequest is a property of the FleetLaunchTemplateConfigRequest property type.

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, launch_template_specification_user_data: nil) ⇒ FleetLaunchTemplateSpecificationRequestProperty

Returns a new instance of FleetLaunchTemplateSpecificationRequestProperty.

Parameters:

  • version (String)

    The launch template version number, $Latest , or $Default . You must specify a value, otherwise the request fails.

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

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


1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
# File 'ec2/cfn_ec2_fleet.rb', line 1461

def initialize(version:, launch_template_id: nil, launch_template_name: nil, launch_template_specification_user_data: 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?
  @launch_template_specification_user_data = launch_template_specification_user_data
  Jsii::Type.check_type(@launch_template_specification_user_data, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "launchTemplateSpecificationUserData") unless @launch_template_specification_user_data.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.



1487
1488
1489
# File 'ec2/cfn_ec2_fleet.rb', line 1487

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.



1494
1495
1496
# File 'ec2/cfn_ec2_fleet.rb', line 1494

def launch_template_name
  @launch_template_name
end

#launch_template_specification_user_dataString? (readonly)



1497
1498
1499
# File 'ec2/cfn_ec2_fleet.rb', line 1497

def launch_template_specification_user_data
  @launch_template_specification_user_data
end

#versionString (readonly)

The launch template version number, $Latest , or $Default . You must specify a value, otherwise the request fails.

If the value is $Latest , Amazon EC2 uses the latest version of the launch template.

If the value is $Default , Amazon EC2 uses the default version of the launch template.



1480
1481
1482
# File 'ec2/cfn_ec2_fleet.rb', line 1480

def version
  @version
end

Class Method Details

.jsii_propertiesObject



1499
1500
1501
1502
1503
1504
1505
1506
# File 'ec2/cfn_ec2_fleet.rb', line 1499

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

Instance Method Details

#to_jsiiObject



1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
# File 'ec2/cfn_ec2_fleet.rb', line 1508

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