Skip to content
v2.278.0

ReplicationConfigurationProperty Struct ​

A container for replication rules.

You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB. The latest version of the replication configuration XML is V2. For more information about XML V2 replication configurations, see Replication configuration in the Amazon S3 User Guide .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
const replicationConfigurationProperty: s3.CfnBucket.ReplicationConfigurationProperty = {
  role: 'role',
  rules: [{
    destination: {
      bucket: 'bucket',

      // the properties below are optional
      accessControlTranslation: {
        owner: 'owner',
      },
      account: 'account',
      encryptionConfiguration: {
        replicaKmsKeyId: 'replicaKmsKeyId',
      },
      metrics: {
        status: 'status',

        // the properties below are optional
        eventThreshold: {
          minutes: 123,
        },
      },
      replicationTime: {
        status: 'status',
        time: {
          minutes: 123,
        },
      },
      storageClass: 'storageClass',
    },
    status: 'status',

    // the properties below are optional
    deleteMarkerReplication: {
      status: 'status',
    },
    filter: {
      and: {
        prefix: 'prefix',
        tagFilters: [{
          key: 'key',
          value: 'value',
        }],
      },
      prefix: 'prefix',
      tagFilter: {
        key: 'key',
        value: 'value',
      },
    },
    id: 'id',
    prefix: 'prefix',
    priority: 123,
    sourceSelectionCriteria: {
      replicaModifications: {
        status: 'status',
      },
      sseKmsEncryptedObjects: {
        status: 'status',
      },
    },
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_s3 as s3

replication_configuration_property = s3.CfnBucket.ReplicationConfigurationProperty(
    role="role",
    rules=[s3.CfnBucket.ReplicationRuleProperty(
        destination=s3.CfnBucket.ReplicationDestinationProperty(
            bucket="bucket",

            # the properties below are optional
            access_control_translation=s3.CfnBucket.AccessControlTranslationProperty(
                owner="owner"
            ),
            account="account",
            encryption_configuration=s3.CfnBucket.EncryptionConfigurationProperty(
                replica_kms_key_id="replicaKmsKeyId"
            ),
            metrics=s3.CfnBucket.MetricsProperty(
                status="status",

                # the properties below are optional
                event_threshold=s3.CfnBucket.ReplicationTimeValueProperty(
                    minutes=123
                )
            ),
            replication_time=s3.CfnBucket.ReplicationTimeProperty(
                status="status",
                time=s3.CfnBucket.ReplicationTimeValueProperty(
                    minutes=123
                )
            ),
            storage_class="storageClass"
        ),
        status="status",

        # the properties below are optional
        delete_marker_replication=s3.CfnBucket.DeleteMarkerReplicationProperty(
            status="status"
        ),
        filter=s3.CfnBucket.ReplicationRuleFilterProperty(
            and=s3.CfnBucket.ReplicationRuleAndOperatorProperty(
                prefix="prefix",
                tag_filters=[s3.CfnBucket.TagFilterProperty(
                    key="key",
                    value="value"
                )]
            ),
            prefix="prefix",
            tag_filter=s3.CfnBucket.TagFilterProperty(
                key="key",
                value="value"
            )
        ),
        id="id",
        prefix="prefix",
        priority=123,
        source_selection_criteria=s3.CfnBucket.SourceSelectionCriteriaProperty(
            replica_modifications=s3.CfnBucket.ReplicaModificationsProperty(
                status="status"
            ),
            sse_kms_encrypted_objects=s3.CfnBucket.SseKmsEncryptedObjectsProperty(
                status="status"
            )
        )
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.s3.*;

ReplicationConfigurationProperty replicationConfigurationProperty = ReplicationConfigurationProperty.builder()
        .role("role")
        .rules(List.of(ReplicationRuleProperty.builder()
                .destination(ReplicationDestinationProperty.builder()
                        .bucket("bucket")

                        // the properties below are optional
                        .accessControlTranslation(AccessControlTranslationProperty.builder()
                                .owner("owner")
                                .build())
                        .account("account")
                        .encryptionConfiguration(EncryptionConfigurationProperty.builder()
                                .replicaKmsKeyId("replicaKmsKeyId")
                                .build())
                        .metrics(MetricsProperty.builder()
                                .status("status")

                                // the properties below are optional
                                .eventThreshold(ReplicationTimeValueProperty.builder()
                                        .minutes(123)
                                        .build())
                                .build())
                        .replicationTime(ReplicationTimeProperty.builder()
                                .status("status")
                                .time(ReplicationTimeValueProperty.builder()
                                        .minutes(123)
                                        .build())
                                .build())
                        .storageClass("storageClass")
                        .build())
                .status("status")

                // the properties below are optional
                .deleteMarkerReplication(DeleteMarkerReplicationProperty.builder()
                        .status("status")
                        .build())
                .filter(ReplicationRuleFilterProperty.builder()
                        .and(ReplicationRuleAndOperatorProperty.builder()
                                .prefix("prefix")
                                .tagFilters(List.of(TagFilterProperty.builder()
                                        .key("key")
                                        .value("value")
                                        .build()))
                                .build())
                        .prefix("prefix")
                        .tagFilter(TagFilterProperty.builder()
                                .key("key")
                                .value("value")
                                .build())
                        .build())
                .id("id")
                .prefix("prefix")
                .priority(123)
                .sourceSelectionCriteria(SourceSelectionCriteriaProperty.builder()
                        .replicaModifications(ReplicaModificationsProperty.builder()
                                .status("status")
                                .build())
                        .sseKmsEncryptedObjects(SseKmsEncryptedObjectsProperty.builder()
                                .status("status")
                                .build())
                        .build())
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.S3;

var replicationConfigurationProperty = new ReplicationConfigurationProperty {
    Role = "role",
    Rules = new [] { new ReplicationRuleProperty {
        Destination = new ReplicationDestinationProperty {
            Bucket = "bucket",

            // the properties below are optional
            AccessControlTranslation = new AccessControlTranslationProperty {
                Owner = "owner"
            },
            Account = "account",
            EncryptionConfiguration = new EncryptionConfigurationProperty {
                ReplicaKmsKeyId = "replicaKmsKeyId"
            },
            Metrics = new MetricsProperty {
                Status = "status",

                // the properties below are optional
                EventThreshold = new ReplicationTimeValueProperty {
                    Minutes = 123
                }
            },
            ReplicationTime = new ReplicationTimeProperty {
                Status = "status",
                Time = new ReplicationTimeValueProperty {
                    Minutes = 123
                }
            },
            StorageClass = "storageClass"
        },
        Status = "status",

        // the properties below are optional
        DeleteMarkerReplication = new DeleteMarkerReplicationProperty {
            Status = "status"
        },
        Filter = new ReplicationRuleFilterProperty {
            And = new ReplicationRuleAndOperatorProperty {
                Prefix = "prefix",
                TagFilters = new [] { new TagFilterProperty {
                    Key = "key",
                    Value = "value"
                } }
            },
            Prefix = "prefix",
            TagFilter = new TagFilterProperty {
                Key = "key",
                Value = "value"
            }
        },
        Id = "id",
        Prefix = "prefix",
        Priority = 123,
        SourceSelectionCriteria = new SourceSelectionCriteriaProperty {
            ReplicaModifications = new ReplicaModificationsProperty {
                Status = "status"
            },
            SseKmsEncryptedObjects = new SseKmsEncryptedObjectsProperty {
                Status = "status"
            }
        }
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

replicationConfigurationProperty := &ReplicationConfigurationProperty{
	Role: jsii.String("role"),
	Rules: []interface{}{
		&ReplicationRuleProperty{
			Destination: &ReplicationDestinationProperty{
				Bucket: jsii.String("bucket"),

				// the properties below are optional
				AccessControlTranslation: &AccessControlTranslationProperty{
					Owner: jsii.String("owner"),
				},
				Account: jsii.String("account"),
				EncryptionConfiguration: &EncryptionConfigurationProperty{
					ReplicaKmsKeyId: jsii.String("replicaKmsKeyId"),
				},
				Metrics: &MetricsProperty{
					Status: jsii.String("status"),

					// the properties below are optional
					EventThreshold: &ReplicationTimeValueProperty{
						Minutes: jsii.Number(123),
					},
				},
				ReplicationTime: &ReplicationTimeProperty{
					Status: jsii.String("status"),
					Time: &ReplicationTimeValueProperty{
						Minutes: jsii.Number(123),
					},
				},
				StorageClass: jsii.String("storageClass"),
			},
			Status: jsii.String("status"),

			// the properties below are optional
			DeleteMarkerReplication: &DeleteMarkerReplicationProperty{
				Status: jsii.String("status"),
			},
			Filter: &ReplicationRuleFilterProperty{
				And: &ReplicationRuleAndOperatorProperty{
					Prefix: jsii.String("prefix"),
					TagFilters: []interface{}{
						&TagFilterProperty{
							Key: jsii.String("key"),
							Value: jsii.String("value"),
						},
					},
				},
				Prefix: jsii.String("prefix"),
				TagFilter: &TagFilterProperty{
					Key: jsii.String("key"),
					Value: jsii.String("value"),
				},
			},
			Id: jsii.String("id"),
			Prefix: jsii.String("prefix"),
			Priority: jsii.Number(123),
			SourceSelectionCriteria: &SourceSelectionCriteriaProperty{
				ReplicaModifications: &ReplicaModificationsProperty{
					Status: jsii.String("status"),
				},
				SseKmsEncryptedObjects: &SseKmsEncryptedObjectsProperty{
					Status: jsii.String("status"),
				},
			},
		},
	},
}

Properties ​

rolestringrolestrroleStringRolestringRole*string required #
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects.

For more information, see How to Set Up Replication in the Amazon S3 User Guide .

rulesIResolvable | IResolvable | CfnBucket.ReplicationRuleProperty[]rulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]rulesIResolvableRulesIResolvableRulesinterface{} required #
A container for one or more replication rules.

A replication configuration must have at least one rule and can contain a maximum of 1,000 rules.