Use the AWS Cloud Development Kit to deploy an Amazon S3 Bucket in your desired region and enable regional bucket replications for backups.
- CloudFormation Stack with S3 Bucket, KMS, and StackSet
- CloudFormation StackSet for S3 regional replication
To use self-managed StackSets, you need to create two IAM roles first. You can create them manually using the AWS Management Console or use the official CloudFormation templates provided by AWS:
Modify aws/index.ts
to configure your archive and replication:
const prefix = 'example'
const option = {
prefix,
env: {
region: 'eu-central-1'
},
replications: [
'eu-west-1',
'eu-north-1'
]
}
# Deploy CloudFormation Stack with CDK
$ > npx cdk deploy
[…]
Outputs:
Archive.BucketName = example-archive
Archive.BucketRegion = eu-central-1
Archive.BucketReplications = eu-west-1, eu-north-1