Class NetworkPolicyIpBlock

  • All Implemented Interfaces:
    INetworkPolicyPeer, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

    @Generated(value="jsii-pacmak/1.71.0 (build f1f58ae)",
               date="2022-11-24T11:18:28.478Z")
    @Stability(Stable)
    public class NetworkPolicyIpBlock
    extends software.constructs.Construct
    implements INetworkPolicyPeer
    Describes a particular CIDR (Ex.

    "192.168.1.1/24","2001:db9::/64") that is allowed to the pods matched by a network policy selector. The except entry describes CIDRs that should not be included within this rule.

    • Constructor Detail

      • NetworkPolicyIpBlock

        protected NetworkPolicyIpBlock​(software.amazon.jsii.JsiiObjectRef objRef)
      • NetworkPolicyIpBlock

        protected NetworkPolicyIpBlock​(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Method Detail

      • anyIpv4

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock anyIpv4​(@NotNull
                                                   software.constructs.Construct scope,
                                                   @NotNull
                                                   String id)
        Any IPv4 address.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
      • anyIpv6

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock anyIpv6​(@NotNull
                                                   software.constructs.Construct scope,
                                                   @NotNull
                                                   String id)
        Any IPv6 address.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
      • ipv4

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock ipv4​(@NotNull
                                                software.constructs.Construct scope,
                                                @NotNull
                                                String id,
                                                @NotNull
                                                String cidrIp,
                                                @Nullable
                                                List<String> except)
        Create an IPv4 peer from a CIDR.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        cidrIp - This parameter is required.
        except -
      • ipv4

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock ipv4​(@NotNull
                                                software.constructs.Construct scope,
                                                @NotNull
                                                String id,
                                                @NotNull
                                                String cidrIp)
        Create an IPv4 peer from a CIDR.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        cidrIp - This parameter is required.
      • ipv6

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock ipv6​(@NotNull
                                                software.constructs.Construct scope,
                                                @NotNull
                                                String id,
                                                @NotNull
                                                String cidrIp,
                                                @Nullable
                                                List<String> except)
        Create an IPv6 peer from a CIDR.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        cidrIp - This parameter is required.
        except -
      • ipv6

        @Stability(Stable)
        @NotNull
        public static NetworkPolicyIpBlock ipv6​(@NotNull
                                                software.constructs.Construct scope,
                                                @NotNull
                                                String id,
                                                @NotNull
                                                String cidrIp)
        Create an IPv6 peer from a CIDR.

        Parameters:
        scope - This parameter is required.
        id - This parameter is required.
        cidrIp - This parameter is required.
      • getCidr

        @Stability(Stable)
        @NotNull
        public String getCidr()
        A string representing the IP Block Valid examples are "192.168.1.1/24" or "2001:db9::/64".
      • getExcept

        @Stability(Stable)
        @Nullable
        public List<String> getExcept()
        A slice of CIDRs that should not be included within an IP Block Valid examples are "192.168.1.1/24" or "2001:db9::/64". Except values will be rejected if they are outside the CIDR range.