Class: AWSCDK::ECS::LogDriverConfig

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ecs/log_driver_config.rb

Overview

The configuration to use when creating a log driver.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_driver:, options: nil, secret_options: nil) ⇒ LogDriverConfig

Returns a new instance of LogDriverConfig.

Parameters:

  • log_driver (String)

    The log driver to use for the container.

  • options (Hash{String => String}, nil) (defaults to: nil)

    The configuration options to send to the log driver.

  • secret_options (Array<AWSCDK::ECS::CfnTaskDefinition::SecretProperty>, nil) (defaults to: nil)

    The secrets to pass to the log configuration.



10
11
12
13
14
15
16
17
# File 'ecs/log_driver_config.rb', line 10

def initialize(log_driver:, options: nil, secret_options: nil)
  @log_driver = log_driver
  Jsii::Type.check_type(@log_driver, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "logDriver")
  @options = options
  Jsii::Type.check_type(@options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "options") unless @options.nil?
  @secret_options = secret_options.is_a?(Array) ? secret_options.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::ECS::CfnTaskDefinition::SecretProperty.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : secret_options
  Jsii::Type.check_type(@secret_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuVGFza0RlZmluaXRpb24uU2VjcmV0UHJvcGVydHkifSwia2luZCI6ImFycmF5In19")), "secretOptions") unless @secret_options.nil?
end

Instance Attribute Details

#log_driverString (readonly)

The log driver to use for the container.

The valid values listed for this parameter are log drivers that the Amazon ECS container agent can communicate with by default.

For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens. For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald, logentries,syslog, splunk, and awsfirelens.

For more information about using the awslogs log driver, see Using the awslogs Log Driver in the Amazon Elastic Container Service Developer Guide.

For more information about using the awsfirelens log driver, see Custom Log Routing in the Amazon Elastic Container Service Developer Guide.

Returns:

  • (String)


37
38
39
# File 'ecs/log_driver_config.rb', line 37

def log_driver
  @log_driver
end

#optionsHash{String => String}? (readonly)

The configuration options to send to the log driver.

Returns:

  • (Hash{String => String}, nil)


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

def options
  @options
end

#secret_optionsArray<AWSCDK::ECS::CfnTaskDefinition::SecretProperty>? (readonly)

Note:

Default: - No secret options provided.

The secrets to pass to the log configuration.



46
47
48
# File 'ecs/log_driver_config.rb', line 46

def secret_options
  @secret_options
end

Class Method Details

.jsii_propertiesObject



48
49
50
51
52
53
54
# File 'ecs/log_driver_config.rb', line 48

def self.jsii_properties
  {
    :log_driver => "logDriver",
    :options => "options",
    :secret_options => "secretOptions",
  }
end

Instance Method Details

#to_jsiiObject



56
57
58
59
60
61
62
63
64
# File 'ecs/log_driver_config.rb', line 56

def to_jsii
  result = {}
  result.merge!({
    "logDriver" => @log_driver,
    "options" => @options,
    "secretOptions" => @secret_options,
  })
  result.compact
end