Interface IConnectionRule
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IConnectionRule
Syntax (vb)
Public Interface IConnectionRule
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var connectionRule = new ConnectionRule {
FromPort = 123,
// the properties below are optional
Description = "description",
Protocol = "protocol",
ToPort = 123
};
Synopsis
Properties
Description | Description of this connection. |
FromPort | Start of port range for the TCP and UDP protocols, or an ICMP type number. |
Protocol | The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers). |
ToPort | End of port range for the TCP and UDP protocols, or an ICMP code. |
Properties
Description
Description of this connection.
virtual string Description { get; }
Property Value
System.String
Remarks
It is applied to both the ingress rule and the egress rule.
Default: No description
FromPort
Start of port range for the TCP and UDP protocols, or an ICMP type number.
double FromPort { get; }
Property Value
System.Double
Remarks
If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP type number).
Protocol
The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers).
virtual string Protocol { get; }
Property Value
System.String
Remarks
Use -1 to specify all protocols. If you specify -1, or a protocol number other than tcp, udp, icmp, or 58 (ICMPv6), traffic on all ports is allowed, regardless of any ports you specify. For tcp, udp, and icmp, you must specify a port range. For protocol 58 (ICMPv6), you can optionally specify a port range; if you don't, traffic for all types and codes is allowed.
Default: tcp
ToPort
End of port range for the TCP and UDP protocols, or an ICMP code.
virtual Nullable<double> ToPort { get; }
Property Value
System.Nullable<System.Double>
Remarks
If you specify icmp for the IpProtocol property, you can specify -1 as a wildcard (i.e., any ICMP code).
Default: If toPort is not specified, it will be the same as fromPort.