Package org.cdk8s.plus24
Class NetworkPolicy.Builder
- java.lang.Object
-
- org.cdk8s.plus24.NetworkPolicy.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<NetworkPolicy>
- Enclosing class:
- NetworkPolicy
@Stability(Stable) public static final class NetworkPolicy.Builder extends Object implements software.amazon.jsii.Builder<NetworkPolicy>
A fluent builder forNetworkPolicy
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkPolicy
build()
static NetworkPolicy.Builder
create(software.constructs.Construct scope, String id)
NetworkPolicy.Builder
egress(NetworkPolicyTraffic egress)
Egress traffic configuration.NetworkPolicy.Builder
ingress(NetworkPolicyTraffic ingress)
Ingress traffic configuration.NetworkPolicy.Builder
metadata(org.cdk8s.ApiObjectMetadata metadata)
Metadata that all persisted resources must have, which includes all objects users must create.NetworkPolicy.Builder
selector(IPodSelector selector)
Which pods does this policy object applies to.
-
-
-
Method Detail
-
create
@Stability(Stable) public static NetworkPolicy.Builder create(software.constructs.Construct scope, String id)
- Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
NetworkPolicy.Builder
.
-
metadata
@Stability(Stable) public NetworkPolicy.Builder metadata(org.cdk8s.ApiObjectMetadata metadata)
Metadata that all persisted resources must have, which includes all objects users must create.- Parameters:
metadata
- Metadata that all persisted resources must have, which includes all objects users must create. This parameter is required.- Returns:
this
-
egress
@Stability(Stable) public NetworkPolicy.Builder egress(NetworkPolicyTraffic egress)
Egress traffic configuration.Default: - the policy doesn't change egress behavior of the pods it selects.
- Parameters:
egress
- Egress traffic configuration. This parameter is required.- Returns:
this
-
ingress
@Stability(Stable) public NetworkPolicy.Builder ingress(NetworkPolicyTraffic ingress)
Ingress traffic configuration.Default: - the policy doesn't change ingress behavior of the pods it selects.
- Parameters:
ingress
- Ingress traffic configuration. This parameter is required.- Returns:
this
-
selector
@Stability(Stable) public NetworkPolicy.Builder selector(IPodSelector selector)
Which pods does this policy object applies to.This can either be a single pod / workload, or a grouping of pods selected via the
Pods.select
function. Rules is applied to any pods selected by this property. Multiple network policies can select the same set of pods. In this case, the rules for each are combined additively.Note that
Default: - will select all pods in the namespace of the policy.
- Parameters:
selector
- Which pods does this policy object applies to. This parameter is required.- Returns:
this
-
build
@Stability(Stable) public NetworkPolicy build()
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NetworkPolicy>
-
-