1. Create an S3 bucket
- Type
S3in AWS Console and click
- Set Primary Bucket's Region as
Singapore
- select
Create bucket.
- Write bucket name as Unique Name
- Click
enable
- Click
Create bucket
- Change Region for Backup Bucket
- select
Create bucket.
- Write bucket name as Unique Name
- Click
enable
- Click
Create bucket
2. Configure Cross-Region Replication
- Click Primary Bucket
- Click
Managment
- Click
Create replication rule
- Write rule name
- Select
Apply to all objects in the bucket
- Choose
backup-bucket
- Choose
Create new role
[!NOTE]
You can create policy and rule by yourself too. If you want, please do the following until created policy and rule:
3. Create Policy and Rule at IAM
- Type
IAMin AWS Console and open as new tab
- Click
Policies
- Click
Create policy
- Click
jsonand delete default policy
- Copy and paste the following policy, edit with
your bucket arnand clickNext
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:ListBucket",
"s3:GetReplicationConfiguration",
"s3:GetObjectVersionForReplication",
"s3:GetObjectVersionAcl",
"s3:GetObjectVersionTagging",
"s3:GetObjectRetention",
"s3:GetObjectLegalHold"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::primary-bucket-23042024",
"arn:aws:s3:::primary-bucket-23042024/*",
"arn:aws:s3:::backup-bucket-23042024",
"arn:aws:s3:::backup-bucket-23042024/*"
]
},
{
"Action": [
"s3:ReplicateObject",
"s3:ReplicateDelete",
"s3:ReplicateTags",
"s3:ObjectOwnerOverrideToBucketOwner"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::primary-bucket-23042024/*",
"arn:aws:s3:::backup-bucket-23042024/*"
]
}
]
}
- Write policy name and Click
Create Policy
- Click
Roles
- Click
Create role
- Choose S3 and Click
Next
- Choose
TKK-S3-Cross-Region-Replication-Ruleand ClickNext
- Write
TKK-S3-Cross-Region-Replication-Ruleand ClickCreate role
- Go back to previous tab and choose
TKK-S3-Cross-Region-Replication-Rule
- Select
Change the storage class for the replicated objectsand then in Storage class, selectStandard-IA.
- Click
Save
- Click
No, do not replicate existing objects.and then ClickSubmit
- Select
primary-bucket-23042024, and then selectUpload.
- Click
Add files
- select any file on your local computer, and click
Openand then clickUpload
- Click
Close
- On the Buckets page, select
backup-bucket-23042024to view the file you just uploaded.
Congratulations, you have completed Lab-How To Configure Cross-Region Replication for an S3 Bucket
Repository: AWS Learning Labs




































Top comments (0)