Class ServicePort.Builder

  • All Implemented Interfaces:
    software.amazon.jsii.Builder<ServicePort>
    Enclosing interface:
    ServicePort

    @Stability(Stable)
    public static final class ServicePort.Builder
    extends Object
    implements software.amazon.jsii.Builder<ServicePort>
    A builder for ServicePort
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • name

        @Stability(Stable)
        public ServicePort.Builder name​(String name)
        Parameters:
        name - The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. This maps to the 'Name' field in EndpointPort objects. Optional if only one ServicePort is defined on this service.
        Returns:
        this
      • nodePort

        @Stability(Stable)
        public ServicePort.Builder nodePort​(Number nodePort)
        Parameters:
        nodePort - The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one.
        Returns:
        this
      • build

        @Stability(Stable)
        public ServicePort build()
        Builds the configured instance.
        Specified by:
        build in interface software.amazon.jsii.Builder<ServicePort>
        Returns:
        a new instance of ServicePort
        Throws:
        NullPointerException - if any required attribute was not provided