Show / Hide Table of Contents

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 : Enum
Syntax (vb)
Public NotInheritable Class Protocol
    Inherits

     Enum
Remarks

ExampleMetadata: infused

Examples
TaskDefinition taskDefinition;
Cluster cluster;


// Add a container to the task definition
ContainerDefinition 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

TCP.

public const Protocol TCP
Field Value
Type Description
Protocol

UDP

UDP.

public const Protocol UDP
Field Value
Type Description
Protocol

value__

public int value__
Field Value
Type Description
System.Int32
Back to top Generated by DocFX