Class: AWSCDK::Logs::CfnTransformer::ListToMapProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_transformer.rb

Overview

This processor takes a list of objects that contain key fields, and converts them into a map of target keys.

For more information about this processor including examples, see listToMap in the CloudWatch Logs User Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil) ⇒ ListToMapProperty

Returns a new instance of ListToMapProperty.

Parameters:

  • key (String)

    The key of the field to be extracted as keys in the generated map.

  • source (String)

    The key in the log event that has a list of objects that will be converted to a map.

  • flatten (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    A Boolean value to indicate whether the list will be flattened into single items.

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

    If you set flatten to true , use flattenedElement to specify which element, first or last , to keep.

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

    The key of the field that will hold the generated map.

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

    If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.



970
971
972
973
974
975
976
977
978
979
980
981
982
983
# File 'logs/cfn_transformer.rb', line 970

def initialize(key:, source:, flatten: nil, flattened_element: nil, target: nil, value_key: nil)
  @key = key
  Jsii::Type.check_type(@key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  @source = source
  Jsii::Type.check_type(@source, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "source")
  @flatten = flatten
  Jsii::Type.check_type(@flatten, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "flatten") unless @flatten.nil?
  @flattened_element = flattened_element
  Jsii::Type.check_type(@flattened_element, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "flattenedElement") unless @flattened_element.nil?
  @target = target
  Jsii::Type.check_type(@target, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "target") unless @target.nil?
  @value_key = value_key
  Jsii::Type.check_type(@value_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "valueKey") unless @value_key.nil?
end

Instance Attribute Details

#flattenBoolean, ... (readonly)

A Boolean value to indicate whether the list will be flattened into single items.

Specify true to flatten the list. The default is false



1001
1002
1003
# File 'logs/cfn_transformer.rb', line 1001

def flatten
  @flatten
end

#flattened_elementString? (readonly)

If you set flatten to true , use flattenedElement to specify which element, first or last , to keep.

You must specify this parameter if flatten is true



1008
1009
1010
# File 'logs/cfn_transformer.rb', line 1008

def flattened_element
  @flattened_element
end

#keyString (readonly)

The key of the field to be extracted as keys in the generated map.



989
990
991
# File 'logs/cfn_transformer.rb', line 989

def key
  @key
end

#sourceString (readonly)

The key in the log event that has a list of objects that will be converted to a map.



994
995
996
# File 'logs/cfn_transformer.rb', line 994

def source
  @source
end

#targetString? (readonly)

The key of the field that will hold the generated map.



1013
1014
1015
# File 'logs/cfn_transformer.rb', line 1013

def target
  @target
end

#value_keyString? (readonly)

If this is specified, the values that you specify in this parameter will be extracted from the source objects and put into the values of the generated map.

Otherwise, original objects in the source list will be put into the values of the generated map.



1020
1021
1022
# File 'logs/cfn_transformer.rb', line 1020

def value_key
  @value_key
end

Class Method Details

.jsii_propertiesObject



1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
# File 'logs/cfn_transformer.rb', line 1022

def self.jsii_properties
  {
    :key => "key",
    :source => "source",
    :flatten => "flatten",
    :flattened_element => "flattenedElement",
    :target => "target",
    :value_key => "valueKey",
  }
end

Instance Method Details

#to_jsiiObject



1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'logs/cfn_transformer.rb', line 1033

def to_jsii
  result = {}
  result.merge!({
    "key" => @key,
    "source" => @source,
    "flatten" => @flatten,
    "flattenedElement" => @flattened_element,
    "target" => @target,
    "valueKey" => @value_key,
  })
  result.compact
end