Class Port
Interface for classes that provide the connection-specification parts of a security group rule.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class Port : DeputyBase
Syntax (vb)
Public Class Port
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
ApplicationLoadBalancer loadBalancer;
var vpc = new Vpc(this, "MyVPC");
var project = new Project(this, "MyProject", new ProjectProps {
Vpc = vpc,
BuildSpec = BuildSpec.FromObject(new Dictionary<string, object> { })
});
project.Connections.AllowTo(loadBalancer, Port.Tcp(443));
Synopsis
Constructors
Port(IPortProps) | |
Port(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Port(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CanInlineRule | Whether the rule containing this port range can be inlined into a securitygroup or not. |
Methods
Ah() | A single AH port. |
AllIcmp() | All ICMP traffic. |
AllTcp() | Any TCP traffic. |
AllTraffic() | All traffic. |
AllUdp() | Any UDP traffic. |
Esp() | A single ESP port. |
IcmpPing() | ICMP ping (echo) traffic. |
IcmpType(Double) | All codes for a single ICMP type. |
IcmpTypeAndCode(Double, Double) | A specific combination of ICMP type and code. |
Tcp(Double) | A single TCP port. |
TcpRange(Double, Double) | A TCP port range. |
ToRuleJson() | Produce the ingress/egress rule JSON for the given connection. |
ToString() | |
Udp(Double) | A single UDP port. |
UdpRange(Double, Double) | A UDP port range. |
Constructors
Port(IPortProps)
Port(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Port(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Port(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Port(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CanInlineRule
Whether the rule containing this port range can be inlined into a securitygroup or not.
public virtual bool CanInlineRule { get; }
Property Value
System.Boolean
Methods
Ah()
AllIcmp()
AllTcp()
AllTraffic()
AllUdp()
Esp()
IcmpPing()
IcmpType(Double)
All codes for a single ICMP type.
public static Port IcmpType(double type)
Parameters
- type System.Double
Returns
IcmpTypeAndCode(Double, Double)
A specific combination of ICMP type and code.
public static Port IcmpTypeAndCode(double type, double code)
Parameters
- type System.Double
- code System.Double
Returns
Remarks
Tcp(Double)
TcpRange(Double, Double)
A TCP port range.
public static Port TcpRange(double startPort, double endPort)
Parameters
- startPort System.Double
- endPort System.Double
Returns
ToRuleJson()
Produce the ingress/egress rule JSON for the given connection.
public virtual object ToRuleJson()
Returns
System.Object
ToString()
public override string ToString()
Returns
System.String
Udp(Double)
UdpRange(Double, Double)
A UDP port range.
public static Port UdpRange(double startPort, double endPort)
Parameters
- startPort System.Double
- endPort System.Double
Returns