enum Protocol
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ECS.Protocol |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsecs#Protocol |
Java | software.amazon.awscdk.services.ecs.Protocol |
Python | aws_cdk.aws_ecs.Protocol |
TypeScript (source) | aws-cdk-lib » aws_ecs » Protocol |
Network protocol.
Example
declare const taskDefinition: ecs.TaskDefinition;
declare const cluster: ecs.Cluster;
// Add a container to the task definition
const specificContainer = taskDefinition.addContainer('Container', {
image: ecs.ContainerImage.fromRegistry('/aws/aws-example-app'),
memoryLimitMiB: 2048,
});
// Add a port mapping
specificContainer.addPortMappings({
containerPort: 7600,
protocol: ecs.Protocol.TCP,
});
new ecs.Ec2Service(this, 'Service', {
cluster,
taskDefinition,
cloudMapOptions: {
// Create SRV records - useful for bridge networking
dnsRecordType: cloudmap.DnsRecordType.SRV,
// Targets port TCP port 7600 `specificContainer`
container: specificContainer,
containerPort: 7600,
},
});
Members
Name | Description |
---|---|
TCP | TCP. |
UDP | UDP. |
TCP
TCP.
UDP
UDP.