Class: AWSCDK::ECS::FluentdLogDriverProps

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

Overview

Specifies the fluentd 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, address: nil, async: nil, async_connect: nil, buffer_limit: nil, max_retries: nil, retry_wait: nil, sub_second_precision: nil) ⇒ FluentdLogDriverProps

Returns a new instance of FluentdLogDriverProps.

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.

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

    By default, the logging driver connects to localhost:24224.

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

    Docker connects to Fluentd in the background.

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

    Docker connects to Fluentd in the background.

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

    The amount of data to buffer before flushing to disk.

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

    The maximum number of retries.

  • retry_wait (AWSCDK::Duration, nil) (defaults to: nil)

    How long to wait between retries.

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

    Generates event logs in nanosecond resolution.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'ecs/fluentd_log_driver_props.rb', line 20

def initialize(env: nil, env_regex: nil, labels: nil, tag: nil, address: nil, async: nil, async_connect: nil, buffer_limit: nil, max_retries: nil, retry_wait: nil, sub_second_precision: 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?
  @address = address
  Jsii::Type.check_type(@address, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "address") unless @address.nil?
  @async = async
  Jsii::Type.check_type(@async, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "async") unless @async.nil?
  @async_connect = async_connect
  Jsii::Type.check_type(@async_connect, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "asyncConnect") unless @async_connect.nil?
  @buffer_limit = buffer_limit
  Jsii::Type.check_type(@buffer_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "bufferLimit") unless @buffer_limit.nil?
  @max_retries = max_retries
  Jsii::Type.check_type(@max_retries, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxRetries") unless @max_retries.nil?
  @retry_wait = retry_wait
  Jsii::Type.check_type(@retry_wait, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "retryWait") unless @retry_wait.nil?
  @sub_second_precision = sub_second_precision
  Jsii::Type.check_type(@sub_second_precision, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "subSecondPrecision") unless @sub_second_precision.nil?
end

Instance Attribute Details

#addressString? (readonly)

Note:

Default: - address not set.

By default, the logging driver connects to localhost:24224.

Supply the address option to connect to a different address. tcp(default) and unix sockets are supported.

Returns:

  • (String, nil)


88
89
90
# File 'ecs/fluentd_log_driver_props.rb', line 88

def address
  @address
end

#asyncBoolean? (readonly)

Note:

Default: - false

Docker connects to Fluentd in the background.

Messages are buffered until the connection is established.

Returns:

  • (Boolean, nil)


96
97
98
# File 'ecs/fluentd_log_driver_props.rb', line 96

def async
  @async
end

#async_connectBoolean? (readonly)

Deprecated.

use async instead

Note:

Default: - false

Docker connects to Fluentd in the background.

Messages are buffered until the connection is established.

Returns:

  • (Boolean, nil)


105
106
107
# File 'ecs/fluentd_log_driver_props.rb', line 105

def async_connect
  @async_connect
end

#buffer_limitNumeric? (readonly)

Note:

Default: - The amount of RAM available to the container.

The amount of data to buffer before flushing to disk.

Returns:

  • (Numeric, nil)


110
111
112
# File 'ecs/fluentd_log_driver_props.rb', line 110

def buffer_limit
  @buffer_limit
end

#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)


53
54
55
# File 'ecs/fluentd_log_driver_props.rb', line 53

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)


62
63
64
# File 'ecs/fluentd_log_driver_props.rb', line 62

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)


71
72
73
# File 'ecs/fluentd_log_driver_props.rb', line 71

def labels
  @labels
end

#max_retriesNumeric? (readonly)

Note:

Default: - 4294967295 (2**32 - 1).

The maximum number of retries.

Returns:

  • (Numeric, nil)


115
116
117
# File 'ecs/fluentd_log_driver_props.rb', line 115

def max_retries
  @max_retries
end

#retry_waitAWSCDK::Duration? (readonly)

Note:

Default: - 1 second

How long to wait between retries.

Returns:



120
121
122
# File 'ecs/fluentd_log_driver_props.rb', line 120

def retry_wait
  @retry_wait
end

#sub_second_precisionBoolean? (readonly)

Note:

Default: - false

Generates event logs in nanosecond resolution.

Returns:

  • (Boolean, nil)


125
126
127
# File 'ecs/fluentd_log_driver_props.rb', line 125

def sub_second_precision
  @sub_second_precision
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)


79
80
81
# File 'ecs/fluentd_log_driver_props.rb', line 79

def tag
  @tag
end

Class Method Details

.jsii_propertiesObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'ecs/fluentd_log_driver_props.rb', line 127

def self.jsii_properties
  {
    :env => "env",
    :env_regex => "envRegex",
    :labels => "labels",
    :tag => "tag",
    :address => "address",
    :async => "async",
    :async_connect => "asyncConnect",
    :buffer_limit => "bufferLimit",
    :max_retries => "maxRetries",
    :retry_wait => "retryWait",
    :sub_second_precision => "subSecondPrecision",
  }
end

Instance Method Details

#to_jsiiObject



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'ecs/fluentd_log_driver_props.rb', line 143

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "env" => @env,
    "envRegex" => @env_regex,
    "labels" => @labels,
    "tag" => @tag,
    "address" => @address,
    "async" => @async,
    "asyncConnect" => @async_connect,
    "bufferLimit" => @buffer_limit,
    "maxRetries" => @max_retries,
    "retryWait" => @retry_wait,
    "subSecondPrecision" => @sub_second_precision,
  })
  result.compact
end