Class: AWSCDK::ECS::JournaldLogDriverProps

Inherits:
BaseLogDriverProps
  • Object
show all
Defined in:
ecs/journald_log_driver_props.rb

Overview

Specifies the journald log driver configuration options.

Source

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env: nil, env_regex: nil, labels: nil, tag: nil) ⇒ JournaldLogDriverProps

Returns a new instance of JournaldLogDriverProps.

Parameters:

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

    The env option takes an array of keys.

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

    The env-regex option is similar to and compatible with env.

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

    The labels option takes an array of keys.

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

    By default, Docker uses the first 12 characters of the container ID to tag log messages.



13
14
15
16
17
18
19
20
21
22
# File 'ecs/journald_log_driver_props.rb', line 13

def initialize(env: nil, env_regex: nil, labels: nil, tag: nil)
  @env = env
  Jsii::Type.check_type(@env, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "env") unless @env.nil?
  @env_regex = env_regex
  Jsii::Type.check_type(@env_regex, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "envRegex") unless @env_regex.nil?
  @labels = labels
  Jsii::Type.check_type(@labels, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "labels") unless @labels.nil?
  @tag = tag
  Jsii::Type.check_type(@tag, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "tag") unless @tag.nil?
end

Instance Attribute Details

#envArray<String>? (readonly)

Note:

Default: - No env

The env option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

Returns:

  • (Array<String>, nil)


32
33
34
# File 'ecs/journald_log_driver_props.rb', line 32

def env
  @env
end

#env_regexString? (readonly)

Note:

Default: - No envRegex

The env-regex option is similar to and compatible with env.

Its value is a regular expression to match logging-related environment variables. It is used for advanced log tag options.

Returns:

  • (String, nil)


41
42
43
# File 'ecs/journald_log_driver_props.rb', line 41

def env_regex
  @env_regex
end

#labelsArray<String>? (readonly)

Note:

Default: - No labels

The labels option takes an array of keys.

If there is collision between label and env keys, the value of the env takes precedence. Adds additional fields to the extra attributes of a logging message.

Returns:

  • (Array<String>, nil)


50
51
52
# File 'ecs/journald_log_driver_props.rb', line 50

def labels
  @labels
end

#tagString? (readonly)

Note:

Default: - The first 12 characters of the container ID

By default, Docker uses the first 12 characters of the container ID to tag log messages.

Refer to the log tag option documentation for customizing the log tag format.

Returns:

  • (String, nil)


58
59
60
# File 'ecs/journald_log_driver_props.rb', line 58

def tag
  @tag
end

Class Method Details

.jsii_propertiesObject



60
61
62
63
64
65
66
67
# File 'ecs/journald_log_driver_props.rb', line 60

def self.jsii_properties
  {
    :env => "env",
    :env_regex => "envRegex",
    :labels => "labels",
    :tag => "tag",
  }
end

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
# File 'ecs/journald_log_driver_props.rb', line 69

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "env" => @env,
    "envRegex" => @env_regex,
    "labels" => @labels,
    "tag" => @tag,
  })
  result.compact
end