Class: AWSCDK::TagProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
tag_props.rb

Overview

Properties for a tag.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(apply_to_launched_instances: nil, exclude_resource_types: nil, include_resource_types: nil, priority: nil) ⇒ TagProps

Returns a new instance of TagProps.

Parameters:

  • apply_to_launched_instances (Boolean, nil) (defaults to: nil)

    Whether the tag should be applied to instances in an AutoScalingGroup.

  • exclude_resource_types (Array<String>, nil) (defaults to: nil)

    An array of Resource Types that will not receive this tag.

  • include_resource_types (Array<String>, nil) (defaults to: nil)

    An array of Resource Types that will receive this tag.

  • priority (Numeric, nil) (defaults to: nil)

    Priority of the tag operation.



11
12
13
14
15
16
17
18
19
20
# File 'tag_props.rb', line 11

def initialize(apply_to_launched_instances: nil, exclude_resource_types: nil, include_resource_types: nil, priority: nil)
  @apply_to_launched_instances = apply_to_launched_instances
  Jsii::Type.check_type(@apply_to_launched_instances, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "applyToLaunchedInstances") unless @apply_to_launched_instances.nil?
  @exclude_resource_types = exclude_resource_types
  Jsii::Type.check_type(@exclude_resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "excludeResourceTypes") unless @exclude_resource_types.nil?
  @include_resource_types = include_resource_types
  Jsii::Type.check_type(@include_resource_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "includeResourceTypes") unless @include_resource_types.nil?
  @priority = priority
  Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil?
end

Instance Attribute Details

#apply_to_launched_instancesBoolean? (readonly)

Note:

Default: true

Whether the tag should be applied to instances in an AutoScalingGroup.

Returns:

  • (Boolean, nil)


26
27
28
# File 'tag_props.rb', line 26

def apply_to_launched_instances
  @apply_to_launched_instances
end

#exclude_resource_typesArray<String>? (readonly)

Note:

Default: []

An array of Resource Types that will not receive this tag.

An empty array will allow this tag to be applied to all resources. A non-empty array will apply this tag only if the Resource type is not in this array.

Returns:

  • (Array<String>, nil)


35
36
37
# File 'tag_props.rb', line 35

def exclude_resource_types
  @exclude_resource_types
end

#include_resource_typesArray<String>? (readonly)

Note:

Default: []

An array of Resource Types that will receive this tag.

An empty array will match any Resource. A non-empty array will apply this tag only to Resource types that are included in this array.

Returns:

  • (Array<String>, nil)


43
44
45
# File 'tag_props.rb', line 43

def include_resource_types
  @include_resource_types
end

#priorityNumeric? (readonly)

Note:

Default: Default priorities: - 100 for SetTag - 200 for RemoveTag - 50 for tags added directly to CloudFormation resources

Priority of the tag operation.

Higher or equal priority tags will take precedence.

Setting priority will enable the user to control tags when they need to not follow the default precedence pattern of last applied and closest to the construct in the tree.

Returns:

  • (Numeric, nil)


54
55
56
# File 'tag_props.rb', line 54

def priority
  @priority
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
# File 'tag_props.rb', line 56

def self.jsii_properties
  {
    :apply_to_launched_instances => "applyToLaunchedInstances",
    :exclude_resource_types => "excludeResourceTypes",
    :include_resource_types => "includeResourceTypes",
    :priority => "priority",
  }
end

Instance Method Details

#to_jsiiObject



65
66
67
68
69
70
71
72
73
74
# File 'tag_props.rb', line 65

def to_jsii
  result = {}
  result.merge!({
    "applyToLaunchedInstances" => @apply_to_launched_instances,
    "excludeResourceTypes" => @exclude_resource_types,
    "includeResourceTypes" => @include_resource_types,
    "priority" => @priority,
  })
  result.compact
end