Class Port
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.Port
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:10:03.534Z")
@Stability(Stable)
public class Port
extends software.amazon.jsii.JsiiObject
Interface for classes that provide the connection-specification parts of a security group rule.
Example:
ApplicationLoadBalancer loadBalancer;
Vpc vpc = new Vpc(this, "MyVPC");
Fleet fleet = Fleet.Builder.create(this, "MyProject")
.computeType(FleetComputeType.MEDIUM)
.environmentType(EnvironmentType.LINUX_CONTAINER)
.baseCapacity(1)
.vpc(vpc)
.build();
fleet.connections.allowTo(loadBalancer, Port.tcp(443));
Project project = Project.Builder.create(this, "MyProject")
.environment(BuildEnvironment.builder()
.fleet(fleet)
.build())
.buildSpec(BuildSpec.fromObject(Map.of()))
.build();
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PortWell-known DNS port (TCP 53).static final PortWell-known DNS port (UDP 53).static final PortWell-known HTTP port (TCP 80).static final PortWell-known HTTPS port (TCP 443).static final PortWell-known IMAP port (TCP 143).static final PortWell-known IMAPS port (TCP 993).static final PortWell-known LDAP port (TCP 389).static final PortWell-known Microsoft SQL Server port (TCP 1433).static final PortWell-known MySQL and Aurora port (TCP 3306).static final PortWell-known NFS port (TCP 2049).static final PortWell-known POP3 port (TCP 110).static final PortWell-known POP3S port (TCP 995).static final PortWell-known PostgreSQL port (TCP 5432).static final PortWell-known Microsoft Remote Desktop Protocol port (TCP 3389).static final PortWell-known SMB port (TCP 445).static final PortWell-known SMTP port (TCP 25).static final PortWell-known SSH port (TCP 22). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Portah()A single AH port.static PortallIcmp()All ICMP traffic.static PortAll ICMPv6 traffic.static PortallTcp()Any TCP traffic.static PortAll traffic.static PortallUdp()Any UDP traffic.static Portesp()A single ESP port.Whether the rule containing this port range can be inlined into a securitygroup or not.static PorticmpPing()ICMP ping (echo) traffic.static PortAll codes for a single ICMP type.static PorticmpTypeAndCode(Number type, Number code) A specific combination of ICMP type and code.static PortA single TCP port.static PortA TCP port range.Produce the ingress/egress rule JSON for the given connection.toString()static PortA single UDP port.static PortA UDP port range.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
DNS_TCP
Well-known DNS port (TCP 53). -
DNS_UDP
Well-known DNS port (UDP 53). -
HTTP
Well-known HTTP port (TCP 80). -
HTTPS
Well-known HTTPS port (TCP 443). -
IMAP
Well-known IMAP port (TCP 143). -
IMAPS
Well-known IMAPS port (TCP 993). -
LDAP
Well-known LDAP port (TCP 389). -
MSSQL
Well-known Microsoft SQL Server port (TCP 1433). -
MYSQL_AURORA
Well-known MySQL and Aurora port (TCP 3306). -
NFS
Well-known NFS port (TCP 2049). -
POP3
Well-known POP3 port (TCP 110). -
POP3_S
Well-known POP3S port (TCP 995). -
POSTGRES
Well-known PostgreSQL port (TCP 5432). -
RDP
Well-known Microsoft Remote Desktop Protocol port (TCP 3389). -
SMB
Well-known SMB port (TCP 445). -
SMTP
Well-known SMTP port (TCP 25). -
SSH
Well-known SSH port (TCP 22).
-
-
Constructor Details
-
Port
protected Port(software.amazon.jsii.JsiiObjectRef objRef) -
Port
protected Port(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
Port
- Parameters:
props- This parameter is required.
-
-
Method Details
-
ah
A single AH port. -
allIcmp
All ICMP traffic. -
allIcmpV6
All ICMPv6 traffic. -
allTcp
Any TCP traffic. -
allTraffic
All traffic. -
allUdp
Any UDP traffic. -
esp
A single ESP port. -
icmpPing
ICMP ping (echo) traffic. -
icmpType
All codes for a single ICMP type.- Parameters:
type- This parameter is required.
-
icmpTypeAndCode
@Stability(Stable) @NotNull public static Port icmpTypeAndCode(@NotNull Number type, @NotNull Number code) A specific combination of ICMP type and code.- Parameters:
type- This parameter is required.code- This parameter is required.- See Also:
-
tcp
A single TCP port.- Parameters:
port- This parameter is required.
-
tcpRange
@Stability(Stable) @NotNull public static Port tcpRange(@NotNull Number startPort, @NotNull Number endPort) A TCP port range.- Parameters:
startPort- This parameter is required.endPort- This parameter is required.
-
udp
A single UDP port.- Parameters:
port- This parameter is required.
-
udpRange
@Stability(Stable) @NotNull public static Port udpRange(@NotNull Number startPort, @NotNull Number endPort) A UDP port range.- Parameters:
startPort- This parameter is required.endPort- This parameter is required.
-
toRuleJson
Produce the ingress/egress rule JSON for the given connection. -
toString
-
getCanInlineRule
Whether the rule containing this port range can be inlined into a securitygroup or not.
-