Package org.cdk8s.plus23.k8s
Class NetworkPolicyEgressRule.Builder
- java.lang.Object
-
- org.cdk8s.plus23.k8s.NetworkPolicyEgressRule.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkPolicyEgressRule>
- Enclosing interface:
- NetworkPolicyEgressRule
@Stability(Stable) public static final class NetworkPolicyEgressRule.Builder extends Object implements software.amazon.jsii.Builder<NetworkPolicyEgressRule>
A builder forNetworkPolicyEgressRule
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkPolicyEgressRule
build()
Builds the configured instance.NetworkPolicyEgressRule.Builder
ports(List<? extends NetworkPolicyPort> ports)
Sets the value ofNetworkPolicyEgressRule.getPorts()
NetworkPolicyEgressRule.Builder
to(List<? extends NetworkPolicyPeer> to)
Sets the value ofNetworkPolicyEgressRule.getTo()
-
-
-
Method Detail
-
ports
@Stability(Stable) public NetworkPolicyEgressRule.Builder ports(List<? extends NetworkPolicyPort> ports)
Sets the value ofNetworkPolicyEgressRule.getPorts()
- Parameters:
ports
- 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.- Returns:
this
-
to
@Stability(Stable) public NetworkPolicyEgressRule.Builder to(List<? extends NetworkPolicyPeer> to)
Sets the value ofNetworkPolicyEgressRule.getTo()
- Parameters:
to
- 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.- Returns:
this
-
build
@Stability(Stable) public NetworkPolicyEgressRule build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NetworkPolicyEgressRule>
- Returns:
- a new instance of
NetworkPolicyEgressRule
- Throws:
NullPointerException
- if any required attribute was not provided
-
-