Class: AWSCDK::EC2::CfnLaunchTemplate::LaunchTemplateTagSpecificationProperty

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

Overview

Specifies the tags to apply to the launch template during creation.

To specify the tags for the resources that are created during instance launch, use AWS::EC2::LaunchTemplate TagSpecification .

LaunchTemplateTagSpecification is a property of AWS::EC2::LaunchTemplate .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resource_type: nil, tags: nil) ⇒ LaunchTemplateTagSpecificationProperty

Returns a new instance of LaunchTemplateTagSpecificationProperty.

Parameters:

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

    The type of resource.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    The tags for the resource.



2590
2591
2592
2593
2594
2595
# File 'ec2/cfn_launch_template.rb', line 2590

def initialize(resource_type: nil, tags: nil)
  @resource_type = resource_type
  Jsii::Type.check_type(@resource_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceType") unless @resource_type.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#resource_typeString? (readonly)

The type of resource.

To tag a launch template, ResourceType must be launch-template .



2603
2604
2605
# File 'ec2/cfn_launch_template.rb', line 2603

def resource_type
  @resource_type
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

The tags for the resource.



2608
2609
2610
# File 'ec2/cfn_launch_template.rb', line 2608

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



2610
2611
2612
2613
2614
2615
# File 'ec2/cfn_launch_template.rb', line 2610

def self.jsii_properties
  {
    :resource_type => "resourceType",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



2617
2618
2619
2620
2621
2622
2623
2624
# File 'ec2/cfn_launch_template.rb', line 2617

def to_jsii
  result = {}
  result.merge!({
    "resourceType" => @resource_type,
    "tags" => @tags,
  })
  result.compact
end