Class Filter
A filter that identifies the subset of objects to which the replication rule applies.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.S3
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Filter : Object, IFilter
Syntax (vb)
Public Class Filter
Inherits Object
Implements IFilter
Remarks
ExampleMetadata: infused
Examples
IBucket destinationBucket1;
IBucket destinationBucket2;
IKey kmsKey;
var sourceBucket = new Bucket(this, "SourceBucket", new BucketProps {
// Versioning must be enabled on both the source and destination bucket
Versioned = true,
ReplicationRules = new [] { new ReplicationRule {
// 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
}, new ReplicationRule {
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 = new Filter {
// The prefix filter for the rule.
Prefix = "prefix",
// The tag filter for the rule.
Tags = new [] { new Tag {
Key = "tagKey",
Value = "tagValue"
} }
}
} }
});
Synopsis
Constructors
Filter() |
Properties
Prefix | An object key name prefix that identifies the object or objects to which the rule applies. |
Tags | The tag array used for tag filters. |
Constructors
Filter()
public Filter()
Properties
Prefix
An object key name prefix that identifies the object or objects to which the rule applies.
public string Prefix { get; set; }
Property Value
System.
Remarks
Default: - applies to all objects
Tags
The tag array used for tag filters.
public ITag[] Tags { get; set; }
Property Value
ITag[]
Remarks
The rule applies only to objects that have the tag in this set.
Default: - applies to all objects