# ServiceConnectProps

Interface for Service Connect configuration.

- Source: [`aws-ecs/lib/base/base-service.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts#L288)
- Type last changed: v2.251.0 · 24 Apr 2026

## Example

```ts
declare const cluster: ecs.Cluster;
declare const taskDefinition: ecs.TaskDefinition;
declare const containerOptions: ecs.ContainerDefinitionOptions;

const container = taskDefinition.addContainer('MyContainer', containerOptions);

container.addPortMappings({
  name: 'api',
  containerPort: 8080,
});

cluster.addDefaultCloudMapNamespace({
  name: 'local',
});

const service = new ecs.FargateService(this, 'Service', {
  cluster,
  taskDefinition,
  minHealthyPercent: 100,
  serviceConnectConfiguration: {
    services: [
      {
        portMappingName: 'api',
        dnsName: 'http-api',
        port: 80,
      },
    ],
  },
});
```

## Properties

- `accessLogConfiguration`: [ServiceConnectAccessLogConfiguration](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ServiceConnectAccessLogConfiguration.html) — The configuration for Service Connect access logs.

  **Default:** undefined - AWS ECS default is disabled, which means that access logs are not recorded

  Access logs provide detailed telemetry about individual requests processed by the　Service Connect proxy.

- `logDriver`: [LogDriver](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.LogDriver.html) = none — The log driver configuration to use for the Service Connect agent logs.

- `namespace`: string — The cloudmap namespace to register this service into.

  **Default:** the cloudmap namespace specified on the cluster.

- `services`: [ServiceConnectService](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ServiceConnectService.html)[] = none — 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.
