From ec9210e91cd5fac356d99c00dc143171231f0aa5 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Mon, 22 Jan 2024 16:53:31 -0500 Subject: [PATCH 01/18] S3 to S3 Replication in SAM --- s3-s3-replication-sam/README.md | 76 +++++++++++++++++ s3-s3-replication-sam/example-pattern.json | 67 +++++++++++++++ s3-s3-replication-sam/src/app.js | 10 +++ s3-s3-replication-sam/template.yaml | 97 ++++++++++++++++++++++ 4 files changed, 250 insertions(+) create mode 100644 s3-s3-replication-sam/README.md create mode 100644 s3-s3-replication-sam/example-pattern.json create mode 100644 s3-s3-replication-sam/src/app.js create mode 100644 s3-s3-replication-sam/template.yaml diff --git a/s3-s3-replication-sam/README.md b/s3-s3-replication-sam/README.md new file mode 100644 index 000000000..bafa34f01 --- /dev/null +++ b/s3-s3-replication-sam/README.md @@ -0,0 +1,76 @@ +# AWS S3 Replication Pattern + +This pattern enables you to replicate objects across Amazon S3 buckets, providing a reliable and scalable solution for data redundancy and disaster recovery. + +**Key Benefits**: + +- **Data Redundancy and Durability**: + S3 replication ensures that your data is replicated across multiple S3 buckets, offering redundancy and safeguarding against data loss. +- **Disaster Recovery**: + By replicating your data to a different region or account, you establish a robust disaster recovery strategy. In the event of an outage or data corruption, you can quickly restore operations using the replicated data. +- **Global Content Distribution**: + Replicate frequently accessed data to different geographical locations, reducing latency and enhancing the user experience for global audiences. +- **Compliance and Data Retention**: + Address compliance requirements by replicating data to a separate account or region. This ensures data integrity and facilitates adherence to regulatory standards. +- **Operational Efficiency**: + S3 replication operates asynchronously, allowing you to focus on other tasks while data is efficiently copied in the background. + + +Learn more about this pattern at Serverless Land Patterns: [https://serverlessland.com/patterns/s3-s3-replication-sam](https://serverlessland.com/patterns/s3-s3-replication-sam) + +**Important**: This application utilizes various AWS services, and there are associated costs after Free Tier usage. Please refer to the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any incurred AWS costs. No warranty is implied in this example. + +## Requirements + +* [Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. Ensure that the IAM user used has sufficient permissions to make necessary AWS service calls and manage resources. +* [Install and configure AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) +* [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +* [Install AWS Serverless Application Model (AWS SAM)](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html) + +## Deployment Instructions + +1. Create a new directory, navigate to that directory in a terminal, and clone the GitHub repository: + ```bash + git clone https://github.com/aws-samples/serverless-patterns + ``` +1. Change the directory to the pattern directory: + ```bash + cd s3-s3-replication-sam + ``` +1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file: + ```bash + sam deploy --guided + ``` +1. During the prompts: + * Enter a stack name. + * Enter the desired AWS Region. + * Allow SAM CLI to create IAM roles with the required permissions. + + Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in the future to use these defaults. + +1. Note the outputs from the SAM deployment process. These contain the resource names and/or ARNs used for testing. + +## How it Works + +Explain how the service interaction works. + +## Testing + +Provide steps to trigger the integration and show what should be observed if successful. + +## Cleanup + +1. Delete the stack: + ```bash + aws cloudformation delete-stack --stack-name STACK_NAME + ``` +1. Confirm the stack has been deleted: + ```bash + aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus" + ``` + +---- + +Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +SPDX-License-Identifier: MIT-0 \ No newline at end of file diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json new file mode 100644 index 000000000..cf423b5d6 --- /dev/null +++ b/s3-s3-replication-sam/example-pattern.json @@ -0,0 +1,67 @@ +{ + "title": "S3 to S3 replication", + "description": "Create a stack template that you can use to replicate objects between S3 buckets across AWS accounts and regions.", + "language": "Python", + "level": "200", + "framework": "SAM", + "introBox": { + "headline": "How it works", + "text": [ + "Data Redundancy and Durability: Safeguard against data loss with automatic and asynchronous replication of objects between S3 buckets.", + "Disaster Recovery: Establish a robust disaster recovery strategy by replicating data to different regions or accounts.", + "Global Content Distribution: Reduce latency and enhance user experience by replicating frequently accessed data to various geographical locations.", + "Compliance and Data Retention: Address regulatory standards and compliance requirements by replicating data to separate accounts or regions.", + "Operational Efficiency: Asynchronous replication allows you to focus on other tasks while data is efficiently copied in the background.", + "Cross-Region Replication (CRR): Achieve low-latency access for users in different AWS regions by replicating data across regions.", + "Same-Region Replication (SRR): Ensure redundancy, compliance, or operational efficiency by copying data to a separate bucket within the same region.", + "Cross-Account Replication: Securely share data across AWS accounts by replicating objects to a destination bucket in a different account.", + "Granular Control: Configure replication rules at the bucket level for precise control over which objects to replicate and where.", + "Flexible Implementation: Leverage native S3 replication features to configure replication behavior through JSON-based, structured language." + ] + + }, + "gitHub": { + "template": { + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/s3-s3-replication-sam", + "templateURL": "serverless-patterns/s3-s3-replication-sam", + "projectFolder": "s3-s3-replication-sam", + "templateFile": "s3-s3-replication-sam.py" + } + }, + "resources": { + "bullets": [ + { + "text": "Call Athena with Step Functions", + "link": "https://docs.aws.amazon.com/step-functions/latest/dg/connect-athena.html" + }, + { + "text": "Amazon Athena - Serverless Interactive Query Service", + "link": "https://aws.amazon.com/athena/" + } + ] + }, + "deploy": { + "text": [ + "sam deploy" + ] + }, + "testing": { + "text": [ + "See the GitHub repo for detailed testing instructions." + ] + }, + "cleanup": { + "text": [ + "Delete the stack: sam delete." + ] + }, + "authors": [ + { + "name": "Jorge Tovar", + "image": "https://avatars.githubusercontent.com/u/21094604?v=4", + "bio": "Software Architect, passionate about serverless technologies and cloud computing.", + "linkedin": "www.linkedin.com/in/jorgetovar-sa", + "twitter": "https://twitter.com/jorgetovar621" + } + ] +} diff --git a/s3-s3-replication-sam/src/app.js b/s3-s3-replication-sam/src/app.js new file mode 100644 index 000000000..cb3c4d9c1 --- /dev/null +++ b/s3-s3-replication-sam/src/app.js @@ -0,0 +1,10 @@ +/*! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: MIT-0 + */ + +'use strict' + +exports.handler = async (event) => { + // Lambda handler code + console.log(JSON.stringify(event, 0, null)) +} \ No newline at end of file diff --git a/s3-s3-replication-sam/template.yaml b/s3-s3-replication-sam/template.yaml new file mode 100644 index 000000000..74730db5f --- /dev/null +++ b/s3-s3-replication-sam/template.yaml @@ -0,0 +1,97 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: 'S3 Replication Template' + +Parameters: + + BucketSourceName: + Description: "Bucket Source Name (must be unique)" + Type: String + + BucketReplicaName: + Description: "Bucket Replica Name (must be unique)" + Type: String + +Resources: + + ReplicationRole: + Type: 'AWS::IAM::Role' + Properties: + AssumeRolePolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: 'Allow' + Principal: + Service: 's3.amazonaws.com' + Action: 'sts:AssumeRole' + Policies: + - PolicyName: 'ReplicationPolicy' + PolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: 'Allow' + Action: + - 's3:GetBucketVersioning' + - 's3:ListBucket' + - s3:GetReplicationConfiguration + - s3:GetObjectVersionForReplication + - s3:GetObjectVersionAcl + - s3:GetObjectVersionTagging + - s3:GetObjectRetention + - s3:GetObjectLegalHold + Resource: '*' + - Effect: 'Allow' + Action: + - 's3:ReplicateObject' + - 's3:ReplicateDelete' + - 's3:ReplicateTags' + - 's3:GetObjectVersionTagging' + - 's3:ObjectOwnerOverrideToBucketOwner' + + Resource: '*' + + BucketSource: + Type: 'AWS::S3::Bucket' + Properties: + VersioningConfiguration: + Status: 'Enabled' + ReplicationConfiguration: + Role: !GetAtt ReplicationRole.Arn + Rules: + - Destination: + Bucket: !GetAtt BucketReplica.Arn + Prefix: '' + Status: 'Enabled' + BucketName: !Ref BucketSourceName + + BucketReplica: + Type: 'AWS::S3::Bucket' + Properties: + VersioningConfiguration: + Status: 'Enabled' + BucketName: !Ref BucketReplicaName + + BucketReplicaPolicy: + Type: AWS::S3::BucketPolicy + Properties: + Bucket: !Ref BucketReplica + PolicyDocument: + Version: 2012-10-17 + Statement: + - Sid: "Object Level Permissions" + Effect: "Allow" + Principal: + AWS: !GetAtt ReplicationRole.Arn + Action: + - "s3:ReplicateObject" + - "s3:ReplicateDelete" + Resource: !Sub "arn:aws:s3:::${BucketReplica}/*" + - Sid: "Bucket Level Permissions" + Effect: "Allow" + Principal: + AWS: !GetAtt ReplicationRole.Arn + Action: + - "s3:List*" + - "s3:GetBucketVersioning" + - "s3:PutBucketVersioning" + Resource: !Sub "arn:aws:s3:::${BucketReplica}" \ No newline at end of file From acf70641ae16464704fa44a6acb94efd8bc53e6f Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Mon, 22 Jan 2024 16:56:06 -0500 Subject: [PATCH 02/18] S3 to S3 Replication in SAM --- s3-s3-replication-sam/src/app.js | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 s3-s3-replication-sam/src/app.js diff --git a/s3-s3-replication-sam/src/app.js b/s3-s3-replication-sam/src/app.js deleted file mode 100644 index cb3c4d9c1..000000000 --- a/s3-s3-replication-sam/src/app.js +++ /dev/null @@ -1,10 +0,0 @@ -/*! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: MIT-0 - */ - -'use strict' - -exports.handler = async (event) => { - // Lambda handler code - console.log(JSON.stringify(event, 0, null)) -} \ No newline at end of file From 8c8196b02562eafdc6c7d5bd7347bce374dba9f9 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 10:56:36 -0500 Subject: [PATCH 03/18] Update s3-s3-replication-sam/README.md Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/README.md b/s3-s3-replication-sam/README.md index bafa34f01..834add02d 100644 --- a/s3-s3-replication-sam/README.md +++ b/s3-s3-replication-sam/README.md @@ -1,4 +1,4 @@ -# AWS S3 Replication Pattern +# AWS S3 Bucket Replication This pattern enables you to replicate objects across Amazon S3 buckets, providing a reliable and scalable solution for data redundancy and disaster recovery. From 22d44c6ab7722290633f02f0e5a39255dd05a21a Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:07:24 -0500 Subject: [PATCH 04/18] Update s3-s3-replication-sam/README.md Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/README.md b/s3-s3-replication-sam/README.md index 834add02d..a820eea9e 100644 --- a/s3-s3-replication-sam/README.md +++ b/s3-s3-replication-sam/README.md @@ -71,6 +71,6 @@ Provide steps to trigger the integration and show what should be observed if suc ---- -Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 \ No newline at end of file From e74c8f4280ed6ada8341d6ab6f613a6034e6f2a2 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:07:32 -0500 Subject: [PATCH 05/18] Update s3-s3-replication-sam/example-pattern.json Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index cf423b5d6..57b824bf7 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -1,5 +1,5 @@ { - "title": "S3 to S3 replication", + "title": "AWS S3 bucket replication", "description": "Create a stack template that you can use to replicate objects between S3 buckets across AWS accounts and regions.", "language": "Python", "level": "200", From 73fbd9b5e8bc41be5ce0bbac07244930a0ecb13f Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:07:40 -0500 Subject: [PATCH 06/18] Update s3-s3-replication-sam/example-pattern.json Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 57b824bf7..90403df76 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -1,6 +1,6 @@ { "title": "AWS S3 bucket replication", - "description": "Create a stack template that you can use to replicate objects between S3 buckets across AWS accounts and regions.", + "description": "This pattern sets up replication between S3 buckets.", "language": "Python", "level": "200", "framework": "SAM", From 304033e8956b534ce5d60377527186872cbc0867 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:11:40 -0500 Subject: [PATCH 07/18] S3 replication --- s3-s3-replication-sam/README.md | 20 ++++++++++++-------- s3-s3-replication-sam/example-pattern.json | 13 +++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/s3-s3-replication-sam/README.md b/s3-s3-replication-sam/README.md index 834add02d..9b1b558f4 100644 --- a/s3-s3-replication-sam/README.md +++ b/s3-s3-replication-sam/README.md @@ -1,6 +1,6 @@ # AWS S3 Bucket Replication -This pattern enables you to replicate objects across Amazon S3 buckets, providing a reliable and scalable solution for data redundancy and disaster recovery. +This pattern demonstrates how to replicate S3 bucket objects to multiple S3 buckets. Implemented with SAM. **Key Benefits**: @@ -52,25 +52,29 @@ Learn more about this pattern at Serverless Land Patterns: [https://serverlessla ## How it Works -Explain how the service interaction works. +S3 replication in the same region involves copying objects from one S3 bucket to another within the same AWS region. When replication is configured, S3 automatically copies objects from the source bucket to the destination bucket, ensuring redundancy and data durability. This process helps in scenarios such as data backup, compliance requirements, and minimizing latency for accessing data. + ## Testing -Provide steps to trigger the integration and show what should be observed if successful. +Upload some images to the source bucket, and then check the replication bucket. You should be able to see the same data replicated there. ## Cleanup -1. Delete the stack: +1. Empty buckets ```bash - aws cloudformation delete-stack --stack-name STACK_NAME + aws s3 rm s3://BUCKET_NAME_SOURCE --recursive + aws s3 rm s3://BUCKET_NAME_REPLICA --recursive + ``` -1. Confirm the stack has been deleted: +2. Confirm the stack has been deleted: ```bash - aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus" + sam delete --stack-name STACK_NAME + ``` ---- -Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 \ No newline at end of file diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index cf423b5d6..4dcc6485a 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -7,18 +7,11 @@ "introBox": { "headline": "How it works", "text": [ - "Data Redundancy and Durability: Safeguard against data loss with automatic and asynchronous replication of objects between S3 buckets.", - "Disaster Recovery: Establish a robust disaster recovery strategy by replicating data to different regions or accounts.", - "Global Content Distribution: Reduce latency and enhance user experience by replicating frequently accessed data to various geographical locations.", - "Compliance and Data Retention: Address regulatory standards and compliance requirements by replicating data to separate accounts or regions.", + "Data Redundancy and Durability: Safeguard against data loss with automatic and asynchronous replication of objects between S3 buckets.", "Global Content Distribution: Reduce latency and enhance user experience by replicating frequently accessed data to various geographical locations.", + "Compliance and Data Retention: Address regulatory standards and compliance requirements by replicating data to separate regions.", "Operational Efficiency: Asynchronous replication allows you to focus on other tasks while data is efficiently copied in the background.", - "Cross-Region Replication (CRR): Achieve low-latency access for users in different AWS regions by replicating data across regions.", - "Same-Region Replication (SRR): Ensure redundancy, compliance, or operational efficiency by copying data to a separate bucket within the same region.", - "Cross-Account Replication: Securely share data across AWS accounts by replicating objects to a destination bucket in a different account.", - "Granular Control: Configure replication rules at the bucket level for precise control over which objects to replicate and where.", - "Flexible Implementation: Leverage native S3 replication features to configure replication behavior through JSON-based, structured language." + "Same-Region Replication (SRR): Ensure redundancy, compliance, or operational efficiency by copying data to a separate bucket within the same region." ] - }, "gitHub": { "template": { From 08c7e79e9946cd7efc9cebdfbe843b34d738b914 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:15:16 -0500 Subject: [PATCH 08/18] Update s3-s3-replication-sam/example-pattern.json Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 90403df76..66891511b 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -52,7 +52,7 @@ }, "cleanup": { "text": [ - "Delete the stack: sam delete." + "sam delete" ] }, "authors": [ From f360089c480b3b6d0e61f065db4723ef92453fa3 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:15:26 -0500 Subject: [PATCH 09/18] Update s3-s3-replication-sam/template.yaml Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/template.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/template.yaml b/s3-s3-replication-sam/template.yaml index 74730db5f..f6b3eb5bb 100644 --- a/s3-s3-replication-sam/template.yaml +++ b/s3-s3-replication-sam/template.yaml @@ -1,6 +1,6 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' -Description: 'S3 Replication Template' +Description: 'S3 bucket replication' Parameters: From 7fe5575a277f02da742cece1b9d6df181d3b081c Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 29 Feb 2024 11:17:15 -0500 Subject: [PATCH 10/18] S3 replication --- s3-s3-replication-sam/example-pattern.json | 10 +++++----- s3-s3-replication-sam/template.yaml | 10 +++++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 22ff9c3fe..d39d283a8 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -18,18 +18,18 @@ "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/s3-s3-replication-sam", "templateURL": "serverless-patterns/s3-s3-replication-sam", "projectFolder": "s3-s3-replication-sam", - "templateFile": "s3-s3-replication-sam.py" + "templateFile": "template.yaml" } }, "resources": { "bullets": [ { - "text": "Call Athena with Step Functions", - "link": "https://docs.aws.amazon.com/step-functions/latest/dg/connect-athena.html" + "text": "Replicating Objects", + "link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html" }, { - "text": "Amazon Athena - Serverless Interactive Query Service", - "link": "https://aws.amazon.com/athena/" + "text": "Cross Region Replication", + "link": "https://www.youtube.com/watch?v=_6admeBN-lI" } ] }, diff --git a/s3-s3-replication-sam/template.yaml b/s3-s3-replication-sam/template.yaml index 74730db5f..6a46bad3b 100644 --- a/s3-s3-replication-sam/template.yaml +++ b/s3-s3-replication-sam/template.yaml @@ -39,7 +39,9 @@ Resources: - s3:GetObjectVersionTagging - s3:GetObjectRetention - s3:GetObjectLegalHold - Resource: '*' + Resource: + - !Sub "arn:aws:s3:::${BucketSource}" + - !Sub "arn:aws:s3:::${BucketReplica}" - Effect: 'Allow' Action: - 's3:ReplicateObject' @@ -47,8 +49,10 @@ Resources: - 's3:ReplicateTags' - 's3:GetObjectVersionTagging' - 's3:ObjectOwnerOverrideToBucketOwner' - - Resource: '*' + Resource: + - !Sub "arn:aws:s3:::${BucketSource}" + - !Sub "arn:aws:s3:::${BucketReplica}" + BucketSource: Type: 'AWS::S3::Bucket' From c695e1dc79fd80b7e0c423fff72f102919b0ef81 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Tue, 26 Mar 2024 09:58:52 -0500 Subject: [PATCH 11/18] Update s3-s3-replication-sam/example-pattern.json Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index df2715607..16053bade 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -53,7 +53,7 @@ "name": "Jorge Tovar", "image": "https://avatars.githubusercontent.com/u/21094604?v=4", "bio": "Software Architect, passionate about serverless technologies and cloud computing.", - "linkedin": "www.linkedin.com/in/jorgetovar-sa", + "linkedin": "jorgetovar-sa", "twitter": "https://twitter.com/jorgetovar621" } ] From 7321c19736922d554327689fe896cb25ddc91e32 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Tue, 26 Mar 2024 10:06:35 -0500 Subject: [PATCH 12/18] Update links and improve how it works --- s3-s3-replication-sam/example-pattern.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 16053bade..f0148c090 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -7,10 +7,7 @@ "introBox": { "headline": "How it works", "text": [ - "Data Redundancy and Durability: Safeguard against data loss with automatic and asynchronous replication of objects between S3 buckets.", "Global Content Distribution: Reduce latency and enhance user experience by replicating frequently accessed data to various geographical locations.", - "Compliance and Data Retention: Address regulatory standards and compliance requirements by replicating data to separate regions.", - "Operational Efficiency: Asynchronous replication allows you to focus on other tasks while data is efficiently copied in the background.", - "Same-Region Replication (SRR): Ensure redundancy, compliance, or operational efficiency by copying data to a separate bucket within the same region." + "This pattern sets up S3 replication between two buckets. The replication configuration is set up in the source bucket, and the destination bucket is set up to receive the replicated objects. The replication configuration is set up to replicate all objects in the source bucket to the destination bucket." ] }, "gitHub": { @@ -29,7 +26,7 @@ }, { "text": "Cross Region Replication", - "link": "https://www.youtube.com/watch?v=_6admeBN-lI" + "link": "https://aws.amazon.com/about-aws/whats-new/2019/09/amazon-s3-introduces-same-region-replication/" } ] }, From b5c9cc9f0bbd9aa2fcf4b7f248c55979bc68f383 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Wed, 17 Apr 2024 07:17:17 -0500 Subject: [PATCH 13/18] Update example-pattern.json Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com> --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index f0148c090..6cb8821a8 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -25,7 +25,7 @@ "link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html" }, { - "text": "Cross Region Replication", + "text": "Same Region Replication", "link": "https://aws.amazon.com/about-aws/whats-new/2019/09/amazon-s3-introduces-same-region-replication/" } ] From 6e85a3620bbecad9e372287d690d63a1200662c1 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 9 May 2024 20:19:02 -0500 Subject: [PATCH 14/18] Add youtube cross region replication --- s3-s3-replication-sam/example-pattern.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index f0148c090..4cf73f363 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -26,7 +26,7 @@ }, { "text": "Cross Region Replication", - "link": "https://aws.amazon.com/about-aws/whats-new/2019/09/amazon-s3-introduces-same-region-replication/" + "link": "https://www.youtube.com/watch?v=_6admeBN-lI&themeRefresh=1" } ] }, From 88b3228c90cb7618d4a234f50bdf7abc6d3253a9 Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Thu, 9 May 2024 20:22:43 -0500 Subject: [PATCH 15/18] Links to relevant documentation --- s3-s3-replication-sam/example-pattern.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 6cb8821a8..9c7502ad2 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -20,13 +20,9 @@ }, "resources": { "bullets": [ - { - "text": "Replicating Objects", - "link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html" - }, { "text": "Same Region Replication", - "link": "https://aws.amazon.com/about-aws/whats-new/2019/09/amazon-s3-introduces-same-region-replication/" + "link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html#srr-scenario" } ] }, From ef87e0d4bc23afe339e11b9e306faba46c9e9930 Mon Sep 17 00:00:00 2001 From: Ben <9841563+bfreiberg@users.noreply.github.com> Date: Thu, 23 May 2024 10:34:40 -0700 Subject: [PATCH 16/18] Add final pattern file --- .../s3-s3-replication-sam.json | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 s3-s3-replication-sam/s3-s3-replication-sam.json diff --git a/s3-s3-replication-sam/s3-s3-replication-sam.json b/s3-s3-replication-sam/s3-s3-replication-sam.json new file mode 100644 index 000000000..726897ba5 --- /dev/null +++ b/s3-s3-replication-sam/s3-s3-replication-sam.json @@ -0,0 +1,72 @@ +{ + "title": "AWS S3 bucket replication", + "description": "This pattern sets up replication between S3 buckets.", + "language": "Python", + "level": "200", + "framework": "SAM", + "introBox": { + "headline": "How it works", + "text": [ + "This pattern sets up S3 replication between two buckets. The replication configuration is set up in the source bucket, and the destination bucket is set up to receive the replicated objects. The replication configuration is set up to replicate all objects in the source bucket to the destination bucket." + ] + }, + "gitHub": { + "template": { + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/s3-s3-replication-sam", + "templateURL": "serverless-patterns/s3-s3-replication-sam", + "projectFolder": "s3-s3-replication-sam", + "templateFile": "template.yaml" + } + }, + "resources": { + "bullets": [ + { + "text": "Same Region Replication", + "link": "https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html#srr-scenario" + } + ] + }, + "deploy": { + "text": [ + "sam deploy" + ] + }, + "testing": { + "text": [ + "See the GitHub repo for detailed testing instructions." + ] + }, + "cleanup": { + "text": [ + "sam delete" + ] + }, + "authors": [ + { + "name": "Jorge Tovar", + "image": "https://avatars.githubusercontent.com/u/21094604?v=4", + "bio": "Software Architect, passionate about serverless technologies and cloud computing.", + "linkedin": "jorgetovar-sa", + "twitter": "https://twitter.com/jorgetovar621" + } + ], + "patternArch": { + "icon1": { + "x": 20, + "y": 50, + "service": "s3", + "label": "Source S3 bucket" + }, + "icon2": { + "x": 80, + "y": 50, + "service": "s3", + "label": "Destination S3 bucket" + }, + "line1": { + "from": "icon1", + "to": "icon2", + "label": "Replication" + } + } +} From 16de67361a43d77bc07b35eb8ff78c194ded528a Mon Sep 17 00:00:00 2001 From: Ben <9841563+bfreiberg@users.noreply.github.com> Date: Thu, 23 May 2024 10:38:47 -0700 Subject: [PATCH 17/18] Fix service name --- s3-s3-replication-sam/s3-s3-replication-sam.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-s3-replication-sam/s3-s3-replication-sam.json b/s3-s3-replication-sam/s3-s3-replication-sam.json index 726897ba5..a890db6f5 100644 --- a/s3-s3-replication-sam/s3-s3-replication-sam.json +++ b/s3-s3-replication-sam/s3-s3-replication-sam.json @@ -1,5 +1,5 @@ { - "title": "AWS S3 bucket replication", + "title": "Amazon S3 bucket replication", "description": "This pattern sets up replication between S3 buckets.", "language": "Python", "level": "200", From 4c1d55dea1ca92fa5d24a206cdfeb7eef77e6d1d Mon Sep 17 00:00:00 2001 From: Jorge Tovar Date: Tue, 28 May 2024 09:25:24 -0500 Subject: [PATCH 18/18] Amazon S3 replication name --- s3-s3-replication-sam/README.md | 2 +- s3-s3-replication-sam/example-pattern.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/s3-s3-replication-sam/README.md b/s3-s3-replication-sam/README.md index 9b1b558f4..f4314aaad 100644 --- a/s3-s3-replication-sam/README.md +++ b/s3-s3-replication-sam/README.md @@ -1,4 +1,4 @@ -# AWS S3 Bucket Replication +# Amazon S3 Bucket Replication This pattern demonstrates how to replicate S3 bucket objects to multiple S3 buckets. Implemented with SAM. diff --git a/s3-s3-replication-sam/example-pattern.json b/s3-s3-replication-sam/example-pattern.json index 9c7502ad2..1ff4275da 100644 --- a/s3-s3-replication-sam/example-pattern.json +++ b/s3-s3-replication-sam/example-pattern.json @@ -1,5 +1,5 @@ { - "title": "AWS S3 bucket replication", + "title": "Amazon S3 bucket replication", "description": "This pattern sets up replication between S3 buckets.", "language": "Python", "level": "200",