# ServiceConnectService

Interface for service connect Service props.

- 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#L325)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ecs as ecs } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as interfaces_kms } from 'aws-cdk-lib/interfaces';

declare const keyRef: interfaces_kms.IKeyRef;
declare const role: iam.Role;
const serviceConnectService: ecs.ServiceConnectService = {
  portMappingName: 'portMappingName',

  // the properties below are optional
  discoveryName: 'discoveryName',
  dnsName: 'dnsName',
  idleTimeout: cdk.Duration.minutes(30),
  ingressPortOverride: 123,
  perRequestTimeout: cdk.Duration.minutes(30),
  port: 123,
  tls: {
    awsPcaAuthorityArn: 'awsPcaAuthorityArn',
    kmsKey: keyRef,
    role: role,
  },
};
```

## Properties

- `discoveryName`: string = port mapping name — Optionally specifies an intermediate dns name to register in the CloudMap namespace.

  This is required if you wish to use the same port mapping name in more than one service.

- `dnsName`: string = No alias is created. The service is reachable at `portMappingName.namespace:port`. — The terse DNS alias to use for this port mapping in the service connect mesh.

  Service Connect-enabled clients will be able to reach this service at
  http://dnsName:port.

  **Default:** No alias is created. The service is reachable at `portMappingName.namespace:port`.

- `idleTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP. — The amount of time in seconds a connection for Service Connect will stay active while idle.

  A value of 0 can be set to disable `idleTimeout`.

  If `idleTimeout` is set to a time that is less than `perRequestTimeout`, the connection will close
  when the `idleTimeout` is reached and not the `perRequestTimeout`.

  **Default:** Duration.minutes(5) for HTTP/HTTP2/GRPC, Duration.hours(1) for TCP.

- `ingressPortOverride`: number = none — Optional.

  The port on the Service Connect agent container to use for traffic ingress to this service.

- `perRequestTimeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = Duration.seconds(15) — The amount of time waiting for the upstream to respond with a complete response per request for Service Connect.

  A value of 0 can be set to disable `perRequestTimeout`.
  Can only be set when the `appProtocol` for the application container is HTTP/HTTP2/GRPC.

  If `idleTimeout` is set to a time that is less than `perRequestTimeout`, the connection will close
  when the `idleTimeout` is reached and not the `perRequestTimeout`.

- `port`: number = the container port specified by the port mapping in portMappingName. — The port for clients to use to communicate with this service via Service Connect.

  **Default:** the container port specified by the port mapping in portMappingName.

- `portMappingName`: string (required) — portMappingName specifies which port and protocol combination should be used for this service connect service.

- `tls`: [ServiceConnectTlsConfiguration](/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.ServiceConnectTlsConfiguration.html) = none — A reference to an object that represents a Transport Layer Security (TLS) configuration.
