interface ServiceConnectProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ECS.ServiceConnectProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#ServiceConnectProps |
Java | software.amazon.awscdk.services.ecs.ServiceConnectProps |
Python | aws_cdk.aws_ecs.ServiceConnectProps |
TypeScript (source) | aws-cdk-lib » aws_ecs » ServiceConnectProps |
Interface for Service Connect configuration.
Example
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
| Name | Type | Description |
|---|---|---|
| access | Service | The configuration for Service Connect access logs. |
| log | Log | The log driver configuration to use for the Service Connect agent logs. |
| namespace? | string | The cloudmap namespace to register this service into. |
| services? | Service[] | The list of Services, including a port mapping, terse client alias, and optional intermediate DNS name. |
accessLogConfiguration?
Type:
Service
(optional, default: undefined - AWS ECS default is disabled, which means that access logs are not recorded)
The configuration for Service Connect access logs.
Access logs provide detailed telemetry about individual requests processed by the Service Connect proxy.
logDriver?
Type:
Log
(optional, default: none)
The log driver configuration to use for the Service Connect agent logs.
namespace?
Type:
string
(optional, default: the cloudmap namespace specified on the cluster.)
The cloudmap namespace to register this service into.
services?
Type:
Service[]
(optional, default: 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.

.NET
Go
Java
Python
TypeScript (