All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.docker.inputs.ContainerPortArgs Maven / Gradle / Ivy

There is a newer version: 4.7.0-alpha.1705607229+34a07055
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.docker.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


public final class ContainerPortArgs extends com.pulumi.resources.ResourceArgs {

    public static final ContainerPortArgs Empty = new ContainerPortArgs();

    /**
     * Port exposed out of the container. If not given a free random port `>= 32768` will be used.
     * 
     */
    @Import(name="external")
    private @Nullable Output external;

    /**
     * @return Port exposed out of the container. If not given a free random port `>= 32768` will be used.
     * 
     */
    public Optional> external() {
        return Optional.ofNullable(this.external);
    }

    /**
     * Port within the container.
     * 
     */
    @Import(name="internal", required=true)
    private Output internal;

    /**
     * @return Port within the container.
     * 
     */
    public Output internal() {
        return this.internal;
    }

    /**
     * IP address/mask that can access this port. Defaults to `0.0.0.0`.
     * 
     */
    @Import(name="ip")
    private @Nullable Output ip;

    /**
     * @return IP address/mask that can access this port. Defaults to `0.0.0.0`.
     * 
     */
    public Optional> ip() {
        return Optional.ofNullable(this.ip);
    }

    /**
     * Protocol that can be used over this port. Defaults to `tcp`.
     * 
     */
    @Import(name="protocol")
    private @Nullable Output protocol;

    /**
     * @return Protocol that can be used over this port. Defaults to `tcp`.
     * 
     */
    public Optional> protocol() {
        return Optional.ofNullable(this.protocol);
    }

    private ContainerPortArgs() {}

    private ContainerPortArgs(ContainerPortArgs $) {
        this.external = $.external;
        this.internal = $.internal;
        this.ip = $.ip;
        this.protocol = $.protocol;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(ContainerPortArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private ContainerPortArgs $;

        public Builder() {
            $ = new ContainerPortArgs();
        }

        public Builder(ContainerPortArgs defaults) {
            $ = new ContainerPortArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param external Port exposed out of the container. If not given a free random port `>= 32768` will be used.
         * 
         * @return builder
         * 
         */
        public Builder external(@Nullable Output external) {
            $.external = external;
            return this;
        }

        /**
         * @param external Port exposed out of the container. If not given a free random port `>= 32768` will be used.
         * 
         * @return builder
         * 
         */
        public Builder external(Integer external) {
            return external(Output.of(external));
        }

        /**
         * @param internal Port within the container.
         * 
         * @return builder
         * 
         */
        public Builder internal(Output internal) {
            $.internal = internal;
            return this;
        }

        /**
         * @param internal Port within the container.
         * 
         * @return builder
         * 
         */
        public Builder internal(Integer internal) {
            return internal(Output.of(internal));
        }

        /**
         * @param ip IP address/mask that can access this port. Defaults to `0.0.0.0`.
         * 
         * @return builder
         * 
         */
        public Builder ip(@Nullable Output ip) {
            $.ip = ip;
            return this;
        }

        /**
         * @param ip IP address/mask that can access this port. Defaults to `0.0.0.0`.
         * 
         * @return builder
         * 
         */
        public Builder ip(String ip) {
            return ip(Output.of(ip));
        }

        /**
         * @param protocol Protocol that can be used over this port. Defaults to `tcp`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(@Nullable Output protocol) {
            $.protocol = protocol;
            return this;
        }

        /**
         * @param protocol Protocol that can be used over this port. Defaults to `tcp`.
         * 
         * @return builder
         * 
         */
        public Builder protocol(String protocol) {
            return protocol(Output.of(protocol));
        }

        public ContainerPortArgs build() {
            if ($.internal == null) {
                throw new MissingRequiredPropertyException("ContainerPortArgs", "internal");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy