Class Port.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.Port.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Port>
Enclosing class:
Port

@Stability(Stable) public static final class Port.Builder extends Object implements software.amazon.jsii.Builder<Port>
A fluent builder for Port.
  • Method Details

    • create

      @Stability(Stable) public static Port.Builder create()
      Returns:
      a new instance of Port.Builder.
    • protocol

      @Stability(Stable) public Port.Builder protocol(Protocol protocol)
      The protocol for the range.

      Parameters:
      protocol - The protocol for the range. This parameter is required.
      Returns:
      this
    • stringRepresentation

      @Stability(Stable) public Port.Builder stringRepresentation(String stringRepresentation)
      String representation for this object.

      Parameters:
      stringRepresentation - String representation for this object. This parameter is required.
      Returns:
      this
    • fromPort

      @Stability(Stable) public Port.Builder fromPort(Number fromPort)
      The starting port for the range.

      Default: - Not included in the rule

      Parameters:
      fromPort - The starting port for the range. This parameter is required.
      Returns:
      this
    • toPort

      @Stability(Stable) public Port.Builder toPort(Number toPort)
      The ending port for the range.

      Default: - Not included in the rule

      Parameters:
      toPort - The ending port for the range. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Port build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Port>
      Returns:
      a newly built instance of Port.