Class SubnetFilter

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.SubnetFilter
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-04T00:39:31.396Z") @Stability(Stable) public abstract class SubnetFilter extends software.amazon.jsii.JsiiObject
Contains logic which chooses a set of subnets from a larger list, in conjunction with SubnetSelection, to determine where to place AWS resources such as VPC endpoints, EC2 instances, etc.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ec2.*;
 SubnetFilter subnetFilter = SubnetFilter.availabilityZones(List.of("availabilityZones"));
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    SubnetFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    SubnetFilter(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    availabilityZones(List<String> availabilityZones)
    Chooses subnets which are in one of the given availability zones.
    Chooses subnets which have the provided CIDR netmask.
    Chooses subnets which are inside any of the specified CIDR range.
    byIds(List<String> subnetIds)
    Chooses subnets by id.
    Chooses subnets which contain any of the specified IP addresses.
    Chooses subnets such that there is at most one per availability zone.
    Executes the subnet filtering logic, returning a filtered set of subnets.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • SubnetFilter

      protected SubnetFilter(software.amazon.jsii.JsiiObjectRef objRef)
    • SubnetFilter

      protected SubnetFilter(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • SubnetFilter

      @Stability(Stable) protected SubnetFilter()
  • Method Details

    • availabilityZones

      @Stability(Stable) @NotNull public static SubnetFilter availabilityZones(@NotNull List<String> availabilityZones)
      Chooses subnets which are in one of the given availability zones.

      Parameters:
      availabilityZones - This parameter is required.
    • byCidrMask

      @Stability(Stable) @NotNull public static SubnetFilter byCidrMask(@NotNull Number mask)
      Chooses subnets which have the provided CIDR netmask.

      Parameters:
      mask - This parameter is required.
    • byCidrRanges

      @Stability(Stable) @NotNull public static SubnetFilter byCidrRanges(@NotNull List<String> cidrs)
      Chooses subnets which are inside any of the specified CIDR range.

      Parameters:
      cidrs - List of CIDR ranges to filter subnets from. This parameter is required.
    • byIds

      @Stability(Stable) @NotNull public static SubnetFilter byIds(@NotNull List<String> subnetIds)
      Chooses subnets by id.

      Parameters:
      subnetIds - This parameter is required.
    • containsIpAddresses

      @Stability(Stable) @NotNull public static SubnetFilter containsIpAddresses(@NotNull List<String> ipv4addrs)
      Chooses subnets which contain any of the specified IP addresses.

      Parameters:
      ipv4addrs - This parameter is required.
    • onePerAz

      @Stability(Stable) @NotNull public static SubnetFilter onePerAz()
      Chooses subnets such that there is at most one per availability zone.
    • selectSubnets

      @Stability(Stable) @NotNull public List<ISubnet> selectSubnets(@NotNull List<ISubnet> _subnets)
      Executes the subnet filtering logic, returning a filtered set of subnets.

      Parameters:
      _subnets - This parameter is required.