Class Connections.Builder

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

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

    • create

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

      @Stability(Stable) public Connections.Builder defaultPort(Port defaultPort)
      Default port range for initiating connections to and from this object.

      Default: - No default port

      Parameters:
      defaultPort - Default port range for initiating connections to and from this object. This parameter is required.
      Returns:
      this
    • peer

      @Stability(Stable) public Connections.Builder peer(IPeer peer)
      Class that represents the rule by which others can connect to this connectable.

      This object is required, but will be derived from securityGroup if that is passed.

      Default: Derived from securityGroup if set.

      Parameters:
      peer - Class that represents the rule by which others can connect to this connectable. This parameter is required.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public Connections.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      What securityGroup(s) this object is managing connections for.

      Default: No security groups

      Parameters:
      securityGroups - What securityGroup(s) this object is managing connections for. This parameter is required.
      Returns:
      this
    • build

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