Class Protocol
Network protocol.
Inheritance
System.Object
    Protocol
  Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public sealed class Protocol : EnumSyntax (vb)
Public NotInheritable Class Protocol
    Inherits
     EnumRemarks
ExampleMetadata: infused
Examples
TaskDefinition taskDefinition;
Cluster cluster;
// Add a container to the task definition
var specificContainer = taskDefinition.AddContainer("Container", new ContainerDefinitionOptions {
    Image = ContainerImage.FromRegistry("/aws/aws-example-app"),
    MemoryLimitMiB = 2048
});
// Add a port mapping
specificContainer.AddPortMappings(new PortMapping {
    ContainerPort = 7600,
    Protocol = Protocol.TCP
});
new Ec2Service(this, "Service", new Ec2ServiceProps {
    Cluster = cluster,
    TaskDefinition = taskDefinition,
    CloudMapOptions = new CloudMapOptions {
        // Create SRV records - useful for bridge networking
        DnsRecordType = DnsRecordType.SRV,
        // Targets port TCP port 7600 `specificContainer`
        Container = specificContainer,
        ContainerPort = 7600
    }
});Synopsis
Fields
| TCP | TCP. | 
| UDP | UDP. | 
| value__ | 
Fields
TCP
UDP
value__
public int value__Field Value
| Type | Description | 
|---|---|
| System.Int32 |