Class: AWSCDK::ECS::CfnService::ServiceConnectConfigurationProperty

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

Overview

The Service Connect configuration of your Amazon ECS service.

The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.

Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled:, access_log_configuration: nil, log_configuration: nil, namespace: nil, services: nil) ⇒ ServiceConnectConfigurationProperty

Returns a new instance of ServiceConnectConfigurationProperty.

Parameters:



2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
# File 'ecs/cfn_service.rb', line 2532

def initialize(enabled:, access_log_configuration: nil, log_configuration: nil, namespace: nil, services: nil)
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enabled")
  @access_log_configuration = access_log_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::ServiceConnectAccessLogConfigurationProperty.new(**access_log_configuration.transform_keys(&:to_sym)) : access_log_configuration
  Jsii::Type.check_type(@access_log_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5TZXJ2aWNlQ29ubmVjdEFjY2Vzc0xvZ0NvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "accessLogConfiguration") unless @access_log_configuration.nil?
  @log_configuration = log_configuration.is_a?(Hash) ? ::AWSCDK::ECS::CfnService::LogConfigurationProperty.new(**log_configuration.transform_keys(&:to_sym)) : log_configuration
  Jsii::Type.check_type(@log_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuQ2ZuU2VydmljZS5Mb2dDb25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "logConfiguration") unless @log_configuration.nil?
  @namespace = namespace
  Jsii::Type.check_type(@namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "namespace") unless @namespace.nil?
  @services = services
  Jsii::Type.check_type(@services, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNmblNlcnZpY2UuU2VydmljZUNvbm5lY3RTZXJ2aWNlUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "services") unless @services.nil?
end

Instance Attribute Details

#access_log_configurationAWSCDK::IResolvable, ... (readonly)

The configuration for Service Connect access logging.

Access logs capture detailed information about requests made to your service, including request patterns, response codes, and timing data. They can be useful for debugging connectivity issues, monitoring service performance, and auditing service-to-service communication for security and compliance purposes.

To enable access logs, you must also specify a log_configuration in the service_connect_configuration .



2558
2559
2560
# File 'ecs/cfn_service.rb', line 2558

def access_log_configuration
  @access_log_configuration
end

#enabledBoolean, AWSCDK::IResolvable (readonly)

Specifies whether to use Service Connect with this service.



2549
2550
2551
# File 'ecs/cfn_service.rb', line 2549

def enabled
  @enabled
end

#log_configurationAWSCDK::IResolvable, ... (readonly)

The log configuration for the container.

This parameter maps to LogConfig in the docker container create command and the --log-driver option to docker run.

By default, containers use the same logging driver that the Docker daemon uses. However, the container might use a different logging driver than the Docker daemon by specifying a log driver configuration in the container definition.

Understand the following when specifying a log configuration for your containers.

  • Amazon ECS currently supports a subset of the logging drivers available to the Docker daemon. Additional log drivers may be available in future releases of the Amazon ECS container agent.

For tasks on AWS Fargate , the supported log drivers are awslogs , splunk , and awsfirelens .

For tasks hosted on Amazon EC2 instances, the supported log drivers are awslogs , fluentd , gelf , json-file , journald , syslog , splunk , and awsfirelens .

  • This parameter requires version 1.18 of the Docker Remote API or greater on your container instance.
  • For tasks that are hosted on Amazon EC2 instances, the Amazon ECS container agent must register the available logging drivers with the ECS_AVAILABLE_LOGGING_DRIVERS environment variable before containers placed on that instance can use these log configuration options. For more information, see Amazon ECS container agent configuration in the Amazon Elastic Container Service Developer Guide .
  • For tasks that are on AWS Fargate , because you don't have access to the underlying infrastructure your tasks are hosted on, any additional software needed must be installed outside of the task. For example, the Fluentd output aggregators or a remote host running Logstash to send Gelf logs to.


2579
2580
2581
# File 'ecs/cfn_service.rb', line 2579

def log_configuration
  @log_configuration
end

#namespaceString? (readonly)

The namespace name or full Amazon Resource Name (ARN) of the AWS Cloud Map namespace for use with Service Connect.

The namespace must be in the same AWS Region as the Amazon ECS service and cluster. The type of namespace doesn't affect Service Connect. For more information about AWS Cloud Map , see Working with Services in the AWS Cloud Map Developer Guide .



2586
2587
2588
# File 'ecs/cfn_service.rb', line 2586

def namespace
  @namespace
end

#servicesAWSCDK::IResolvable, ... (readonly)

The list of Service Connect service objects.

These are names and aliases (also known as endpoints) that are used by other Amazon ECS services to connect to this service.

This field is not required for a "client" Amazon ECS service that's a member of a namespace only to connect to other services within the namespace. An example of this would be a frontend application that accepts incoming requests from either a load balancer that's attached to the service or by other means.

An object selects a port from the task definition, assigns a name for the AWS Cloud Map service, and a list of aliases (endpoints) and ports for client applications to refer to this service.



2597
2598
2599
# File 'ecs/cfn_service.rb', line 2597

def services
  @services
end

Class Method Details

.jsii_propertiesObject



2599
2600
2601
2602
2603
2604
2605
2606
2607
# File 'ecs/cfn_service.rb', line 2599

def self.jsii_properties
  {
    :enabled => "enabled",
    :access_log_configuration => "accessLogConfiguration",
    :log_configuration => "logConfiguration",
    :namespace => "namespace",
    :services => "services",
  }
end

Instance Method Details

#to_jsiiObject



2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
# File 'ecs/cfn_service.rb', line 2609

def to_jsii
  result = {}
  result.merge!({
    "enabled" => @enabled,
    "accessLogConfiguration" => @access_log_configuration,
    "logConfiguration" => @log_configuration,
    "namespace" => @namespace,
    "services" => @services,
  })
  result.compact
end