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

com.pulumi.kubernetes.extensions.v1beta1.inputs.NetworkPolicySpecPatchArgs Maven / Gradle / Ivy

There is a newer version: 4.19.0-alpha.1730750641
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.extensions.v1beta1.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.kubernetes.extensions.v1beta1.inputs.NetworkPolicyEgressRulePatchArgs;
import com.pulumi.kubernetes.extensions.v1beta1.inputs.NetworkPolicyIngressRulePatchArgs;
import com.pulumi.kubernetes.meta.v1.inputs.LabelSelectorPatchArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by networking/v1/NetworkPolicySpec.
 * 
 */
public final class NetworkPolicySpecPatchArgs extends com.pulumi.resources.ResourceArgs {

    public static final NetworkPolicySpecPatchArgs Empty = new NetworkPolicySpecPatchArgs();

    /**
     * List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
     * 
     */
    @Import(name="egress")
    private @Nullable Output> egress;

    /**
     * @return List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
     * 
     */
    public Optional>> egress() {
        return Optional.ofNullable(this.egress);
    }

    /**
     * List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default).
     * 
     */
    @Import(name="ingress")
    private @Nullable Output> ingress;

    /**
     * @return List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default).
     * 
     */
    public Optional>> ingress() {
        return Optional.ofNullable(this.ingress);
    }

    /**
     * Selects the pods to which this NetworkPolicy object applies.  The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods.  In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.
     * 
     */
    @Import(name="podSelector")
    private @Nullable Output podSelector;

    /**
     * @return Selects the pods to which this NetworkPolicy object applies.  The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods.  In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.
     * 
     */
    public Optional> podSelector() {
        return Optional.ofNullable(this.podSelector);
    }

    /**
     * List of rule types that the NetworkPolicy relates to. Valid options are "Ingress", "Egress", or "Ingress,Egress". If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
     * 
     */
    @Import(name="policyTypes")
    private @Nullable Output> policyTypes;

    /**
     * @return List of rule types that the NetworkPolicy relates to. Valid options are "Ingress", "Egress", or "Ingress,Egress". If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
     * 
     */
    public Optional>> policyTypes() {
        return Optional.ofNullable(this.policyTypes);
    }

    private NetworkPolicySpecPatchArgs() {}

    private NetworkPolicySpecPatchArgs(NetworkPolicySpecPatchArgs $) {
        this.egress = $.egress;
        this.ingress = $.ingress;
        this.podSelector = $.podSelector;
        this.policyTypes = $.policyTypes;
    }

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

    public static final class Builder {
        private NetworkPolicySpecPatchArgs $;

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

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

        /**
         * @param egress List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder egress(@Nullable Output> egress) {
            $.egress = egress;
            return this;
        }

        /**
         * @param egress List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder egress(List egress) {
            return egress(Output.of(egress));
        }

        /**
         * @param egress List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder egress(NetworkPolicyEgressRulePatchArgs... egress) {
            return egress(List.of(egress));
        }

        /**
         * @param ingress List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default).
         * 
         * @return builder
         * 
         */
        public Builder ingress(@Nullable Output> ingress) {
            $.ingress = ingress;
            return this;
        }

        /**
         * @param ingress List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default).
         * 
         * @return builder
         * 
         */
        public Builder ingress(List ingress) {
            return ingress(Output.of(ingress));
        }

        /**
         * @param ingress List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default).
         * 
         * @return builder
         * 
         */
        public Builder ingress(NetworkPolicyIngressRulePatchArgs... ingress) {
            return ingress(List.of(ingress));
        }

        /**
         * @param podSelector Selects the pods to which this NetworkPolicy object applies.  The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods.  In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.
         * 
         * @return builder
         * 
         */
        public Builder podSelector(@Nullable Output podSelector) {
            $.podSelector = podSelector;
            return this;
        }

        /**
         * @param podSelector Selects the pods to which this NetworkPolicy object applies.  The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods.  In this case, the ingress rules for each are combined additively. This field is NOT optional and follows standard label selector semantics. An empty podSelector matches all pods in this namespace.
         * 
         * @return builder
         * 
         */
        public Builder podSelector(LabelSelectorPatchArgs podSelector) {
            return podSelector(Output.of(podSelector));
        }

        /**
         * @param policyTypes List of rule types that the NetworkPolicy relates to. Valid options are "Ingress", "Egress", or "Ingress,Egress". If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder policyTypes(@Nullable Output> policyTypes) {
            $.policyTypes = policyTypes;
            return this;
        }

        /**
         * @param policyTypes List of rule types that the NetworkPolicy relates to. Valid options are "Ingress", "Egress", or "Ingress,Egress". If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder policyTypes(List policyTypes) {
            return policyTypes(Output.of(policyTypes));
        }

        /**
         * @param policyTypes List of rule types that the NetworkPolicy relates to. Valid options are "Ingress", "Egress", or "Ingress,Egress". If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an Egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
         * 
         * @return builder
         * 
         */
        public Builder policyTypes(String... policyTypes) {
            return policyTypes(List.of(policyTypes));
        }

        public NetworkPolicySpecPatchArgs build() {
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy