Interface Filter

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
Filter.Jsii$Proxy

@Generated(value="jsii-pacmak/1.110.0 (build 336b265)", date="2025-04-22T23:08:19.957Z") @Stability(Stable) public interface Filter extends software.amazon.jsii.JsiiSerializable
A filter that identifies the subset of objects to which the replication rule applies.

Example:

 IBucket destinationBucket1;
 IBucket destinationBucket2;
 IRole replicationRole;
 IKey kmsKey;
 Bucket sourceBucket = Bucket.Builder.create(this, "SourceBucket")
         // Versioning must be enabled on both the source and destination bucket
         .versioned(true)
         // Optional. If not specified, a new role will be created.
         .replicationRole(replicationRole)
         .replicationRules(List.of(ReplicationRule.builder()
                 // The destination bucket for the replication rule.
                 .destination(destinationBucket1)
                 // The priority of the rule.
                 // Amazon S3 will attempt to replicate objects according to all replication rules.
                 // However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority.
                 // The higher the number, the higher the priority.
                 // It is essential to specify priority explicitly when the replication configuration has multiple rules.
                 .priority(1)
                 .build(), ReplicationRule.builder()
                 .destination(destinationBucket2)
                 .priority(2)
                 // Whether to specify S3 Replication Time Control (S3 RTC).
                 // S3 RTC replicates most objects that you upload to Amazon S3 in seconds,
                 // and 99.99 percent of those objects within specified time.
                 .replicationTimeControl(ReplicationTimeValue.FIFTEEN_MINUTES)
                 // Whether to enable replication metrics about S3 RTC.
                 // If set, metrics will be output to indicate whether replication by S3 RTC took longer than the configured time.
                 .metrics(ReplicationTimeValue.FIFTEEN_MINUTES)
                 // The kms key to use for the destination bucket.
                 .kmsKey(kmsKey)
                 // The storage class to use for the destination bucket.
                 .storageClass(StorageClass.INFREQUENT_ACCESS)
                 // Whether to replicate objects with SSE-KMS encryption.
                 .sseKmsEncryptedObjects(false)
                 // Whether to replicate modifications on replicas.
                 .replicaModifications(true)
                 // Whether to replicate delete markers.
                 // This property cannot be enabled if the replication rule has a tag filter.
                 .deleteMarkerReplication(false)
                 // The ID of the rule.
                 .id("full-settings-rule")
                 // The object filter for the rule.
                 .filter(Filter.builder()
                         // The prefix filter for the rule.
                         .prefix("prefix")
                         // The tag filter for the rule.
                         .tags(List.of(Tag.builder()
                                 .key("tagKey")
                                 .value("tagValue")
                                 .build()))
                         .build())
                 .build()))
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for Filter
    static final class 
    An implementation for Filter
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default String
    An object key name prefix that identifies the object or objects to which the rule applies.
    default List<Tag>
    The tag array used for tag filters.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getPrefix

      @Stability(Stable) @Nullable default String getPrefix()
      An object key name prefix that identifies the object or objects to which the rule applies.

      Default: - applies to all objects

    • getTags

      @Stability(Stable) @Nullable default List<Tag> getTags()
      The tag array used for tag filters.

      The rule applies only to objects that have the tag in this set.

      Default: - applies to all objects

    • builder

      @Stability(Stable) static Filter.Builder builder()
      Returns:
      a Filter.Builder of Filter