Class: AWSCDK::EC2::CfnSpotFleet::SpotFleetTagSpecificationProperty

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

Overview

The tags for a Spot Fleet resource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of SpotFleetTagSpecificationProperty.

Parameters:

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

    The type of resource.

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

    The tags.



2940
2941
2942
2943
2944
2945
# File 'ec2/cfn_spot_fleet.rb', line 2940

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.

Currently, the only resource type that is supported is instance . To tag the Spot Fleet request on creation, use the TagSpecifications parameter in [SpotFleetRequestConfigData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetRequestConfigData.html) .



2953
2954
2955
# File 'ec2/cfn_spot_fleet.rb', line 2953

def resource_type
  @resource_type
end

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

The tags.



2958
2959
2960
# File 'ec2/cfn_spot_fleet.rb', line 2958

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



2960
2961
2962
2963
2964
2965
# File 'ec2/cfn_spot_fleet.rb', line 2960

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

Instance Method Details

#to_jsiiObject



2967
2968
2969
2970
2971
2972
2973
2974
# File 'ec2/cfn_spot_fleet.rb', line 2967

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