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

com.pulumi.kubernetes.networking.v1.inputs.NetworkPolicyEgressRulePatchArgs Maven / Gradle / Ivy

There is a newer version: 4.19.0
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.kubernetes.networking.v1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.kubernetes.networking.v1.inputs.NetworkPolicyPeerPatchArgs;
import com.pulumi.kubernetes.networking.v1.inputs.NetworkPolicyPortPatchArgs;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. This type is beta-level in 1.8
 * 
 */
public final class NetworkPolicyEgressRulePatchArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkPolicyEgressRulePatchArgs Empty = new NetworkPolicyEgressRulePatchArgs();

    /**
     * ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
     * 
     */
    @Import(name="ports")
    private @Nullable Output> ports;

    /**
     * @return ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
     * 
     */
    public Optional>> ports() {
        return Optional.ofNullable(this.ports);
    }

    /**
     * to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
     * 
     */
    @Import(name="to")
    private @Nullable Output> to;

    /**
     * @return to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
     * 
     */
    public Optional>> to() {
        return Optional.ofNullable(this.to);
    }

    private NetworkPolicyEgressRulePatchArgs() {}

    private NetworkPolicyEgressRulePatchArgs(NetworkPolicyEgressRulePatchArgs $) {
        this.ports = $.ports;
        this.to = $.to;
    }

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

    public static final class Builder {
        private NetworkPolicyEgressRulePatchArgs $;

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

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

        /**
         * @param ports ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
         * 
         * @return builder
         * 
         */
        public Builder ports(@Nullable Output> ports) {
            $.ports = ports;
            return this;
        }

        /**
         * @param ports ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
         * 
         * @return builder
         * 
         */
        public Builder ports(List ports) {
            return ports(Output.of(ports));
        }

        /**
         * @param ports ports is a list of destination ports for outgoing traffic. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.
         * 
         * @return builder
         * 
         */
        public Builder ports(NetworkPolicyPortPatchArgs... ports) {
            return ports(List.of(ports));
        }

        /**
         * @param to to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
         * 
         * @return builder
         * 
         */
        public Builder to(@Nullable Output> to) {
            $.to = to;
            return this;
        }

        /**
         * @param to to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
         * 
         * @return builder
         * 
         */
        public Builder to(List to) {
            return to(Output.of(to));
        }

        /**
         * @param to to is a list of destinations for outgoing traffic of pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all destinations (traffic not restricted by destination). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the to list.
         * 
         * @return builder
         * 
         */
        public Builder to(NetworkPolicyPeerPatchArgs... to) {
            return to(List.of(to));
        }

        public NetworkPolicyEgressRulePatchArgs build() {
            return $;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy