Class: AWSCDK::Autoscaling::CfnAutoScalingGroup::LaunchTemplateSpecificationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Autoscaling::CfnAutoScalingGroup::LaunchTemplateSpecificationProperty
- Defined in:
- autoscaling/cfn_auto_scaling_group.rb
Overview
Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group.
You must specify the following:
- The ID or the name of the launch template, but not both.
- The version of the launch template.
LaunchTemplateSpecification is property of the AWS::AutoScaling::AutoScalingGroup resource. It is also a property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplate and AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property types.
For information about creating a launch template, see AWS::EC2::LaunchTemplate and Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide .
For examples of launch templates, see Create launch templates .
Instance Attribute Summary collapse
-
#launch_template_id ⇒ String?
readonly
The ID of the launch template.
-
#launch_template_name ⇒ String?
readonly
The name of the launch template.
-
#version ⇒ String
readonly
The version number of the launch template.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(version:, launch_template_id: nil, launch_template_name: nil) ⇒ LaunchTemplateSpecificationProperty
constructor
A new instance of LaunchTemplateSpecificationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(version:, launch_template_id: nil, launch_template_name: nil) ⇒ LaunchTemplateSpecificationProperty
Returns a new instance of LaunchTemplateSpecificationProperty.
2180 2181 2182 2183 2184 2185 2186 2187 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2180 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_id ⇒ String? (readonly)
The ID of the launch template.
You must specify the LaunchTemplateID or the LaunchTemplateName , but not both.
2204 2205 2206 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2204 def launch_template_id @launch_template_id end |
#launch_template_name ⇒ String? (readonly)
The name of the launch template.
You must specify the LaunchTemplateName or the LaunchTemplateID , but not both.
2211 2212 2213 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2211 def launch_template_name @launch_template_name end |
#version ⇒ String (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 .
For an example of using the
Fn::GetAttfunction, see the Examples section of theAWS::AutoScaling::AutoScalingGroupresource.
2197 2198 2199 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2197 def version @version end |
Class Method Details
.jsii_properties ⇒ Object
2213 2214 2215 2216 2217 2218 2219 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2213 def self.jsii_properties { :version => "version", :launch_template_id => "launchTemplateId", :launch_template_name => "launchTemplateName", } end |
Instance Method Details
#to_jsii ⇒ Object
2221 2222 2223 2224 2225 2226 2227 2228 2229 |
# File 'autoscaling/cfn_auto_scaling_group.rb', line 2221 def to_jsii result = {} result.merge!({ "version" => @version, "launchTemplateId" => @launch_template_id, "launchTemplateName" => @launch_template_name, }) result.compact end |