Class: AWSCDK::ECS::AWSLogDriver

Inherits:
LogDriver
  • Object
show all
Defined in:
ecs/aws_log_driver.rb

Overview

A log driver that sends log information to CloudWatch Logs.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ AWSLogDriver

Constructs a new instance of the AwsLogDriver class.

Parameters:



11
12
13
14
15
# File 'ecs/aws_log_driver.rb', line 11

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::ECS::AWSLogDriverProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkF3c0xvZ0RyaXZlclByb3BzIn0=")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



17
18
19
20
21
22
# File 'ecs/aws_log_driver.rb', line 17

def self.jsii_overridable_methods
  {
    :log_group => { kind: :property, name: "logGroup", is_optional: true },
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope, container_definition) ⇒ AWSCDK::ECS::LogDriverConfig

Called when the log driver is configured on a container.

Parameters:

Returns:



43
44
45
46
47
# File 'ecs/aws_log_driver.rb', line 43

def bind(scope, container_definition)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(container_definition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckRlZmluaXRpb24ifQ==")), "containerDefinition")
  jsii_call_method("bind", [scope, container_definition])
end

#log_groupAWSCDK::Logs::ILogGroup?

The log group to send log streams to.

Only available after the LogDriver has been bound to a ContainerDefinition.

Returns:



29
30
31
# File 'ecs/aws_log_driver.rb', line 29

def log_group()
  jsii_get_property("logGroup")
end

#log_group=(value) ⇒ Object



33
34
35
36
# File 'ecs/aws_log_driver.rb', line 33

def log_group=(value)
  Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5JTG9nR3JvdXAifQ==")), "logGroup") unless value.nil?
  jsii_set_property("logGroup", value)
end