ServiceConnectProps

class aws_cdk.aws_ecs.ServiceConnectProps(*, log_driver=None, namespace=None, services=None)

Bases: object

Interface for Service Connect configuration.

Parameters:
  • log_driver (Optional[LogDriver]) – The log driver configuration to use for the Service Connect agent logs. Default: - none

  • namespace (Optional[str]) – The cloudmap namespace to register this service into. Default: the cloudmap namespace specified on the cluster.

  • services (Optional[Sequence[Union[ServiceConnectService, Dict[str, Any]]]]) – The list of Services, including a port mapping, terse client alias, and optional intermediate DNS name. This property may be left blank if the current ECS service does not need to advertise any ports via Service Connect. Default: none

ExampleMetadata:

infused

Example:

# cluster: ecs.Cluster
# task_definition: ecs.TaskDefinition


custom_service = ecs.FargateService(self, "CustomizedService",
    cluster=cluster,
    task_definition=task_definition,
    service_connect_configuration=ecs.ServiceConnectProps(
        log_driver=ecs.LogDrivers.aws_logs(
            stream_prefix="sc-traffic"
        ),
        services=[ecs.ServiceConnectService(
            port_mapping_name="api",
            dns_name="customized-api",
            port=80,
            ingress_port_override=20040,
            discovery_name="custom"
        )
        ]
    )
)

Attributes

log_driver

The log driver configuration to use for the Service Connect agent logs.

Default:
  • none

namespace

The cloudmap namespace to register this service into.

Default:

the cloudmap namespace specified on the cluster.

services

The list of Services, including a port mapping, terse client alias, and optional intermediate DNS name.

This property may be left blank if the current ECS service does not need to advertise any ports via Service Connect.

Default:

none