From 23482991f5bd0e30a84cde271def3e005d7ed243 Mon Sep 17 00:00:00 2001 From: Biswanath Mukherjee Date: Thu, 8 Feb 2024 17:50:20 +0530 Subject: [PATCH] Fixed review comments --- s3-b2bi-s3/README.md | 5 ++--- s3-b2bi-s3/example-pattern.json | 10 +++++----- s3-b2bi-s3/{template1.yaml => template-part1.yaml} | 6 ++++-- s3-b2bi-s3/{template2.yaml => template-part2.yaml} | 4 +++- 4 files changed, 14 insertions(+), 11 deletions(-) rename s3-b2bi-s3/{template1.yaml => template-part1.yaml} (90%) rename s3-b2bi-s3/{template2.yaml => template-part2.yaml} (84%) diff --git a/s3-b2bi-s3/README.md b/s3-b2bi-s3/README.md index bfdf9b506..3f5d66592 100644 --- a/s3-b2bi-s3/README.md +++ b/s3-b2bi-s3/README.md @@ -26,7 +26,7 @@ Important: this application uses various AWS services and there are costs associ ``` 3. 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 -g -t template1.yaml + sam deploy -g -t template-part1.yaml ``` 4. During the prompts: @@ -40,7 +40,7 @@ Important: this application uses various AWS services and there are costs associ 7. 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 -g -t template2.yaml + sam deploy -g -t template-part2.yaml ``` 8. During the prompts: @@ -48,7 +48,6 @@ Important: this application uses various AWS services and there are costs associ - Enter the desired AWS Region. Please refer to the documentation for the list of supported regions. - Enter `BusinessName`, `Email`, `Phone`, `EDI214InputBucketName`, `EDI214OutputBucketName`, `MyProfileId` and `MyTransformerId`. Please note the last four parameter values should be given as per the output from the `b2bi-stack1` output. - Once you have run `sam deploy --guided` mode once and saved arguments to a configuration file (samconfig.toml), you can use `sam deploy` in future to use these defaults. ## How it works diff --git a/s3-b2bi-s3/example-pattern.json b/s3-b2bi-s3/example-pattern.json index 88dd416be..56d88a0ca 100644 --- a/s3-b2bi-s3/example-pattern.json +++ b/s3-b2bi-s3/example-pattern.json @@ -17,7 +17,7 @@ "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/s3-b2bi-s3", "templateURL": "serverless-patterns/s3-b2bi-s3", "projectFolder": "s3-b2bi-s3", - "templateFile": "template.yaml" + "templateFile": "template-part1.yaml, template-part2.yaml" } }, "resources": { @@ -35,8 +35,8 @@ "deploy": { "text": [ "See the GitHub repo for detailed deployment instructions.", - "sam deploy -g -t template1.yaml", - "sam deploy -g -t template2.yaml" + "sam deploy -g -t template-part1.yaml", + "sam deploy -g -t template-part2.yaml" ] }, "testing": { @@ -46,8 +46,8 @@ }, "cleanup": { "text": [ - "Delete the Amazon S3 input bucket content: aws s3 rm s3://{EDI214InputBucketName} --recursive --region {my-region}", - "Delete the Amazon S3 input bucket content: aws s3 rm s3://{EDI214OutputBucketName} --recursive --region {my-region}", + "Delete the Amazon S3 input bucket content: aws s3 rm s3://{EDI214InputBucketName} --recursive --region {my-region}", + "Delete the Amazon S3 output bucket content: aws s3 rm s3://{EDI214OutputBucketName} --recursive --region {my-region}", "Delete the stack1: sam delete --stack-name {b2bi-stack2}.", "Delete the stack1: sam delete --stack-name {b2bi-stack1}." ] diff --git a/s3-b2bi-s3/template1.yaml b/s3-b2bi-s3/template-part1.yaml similarity index 90% rename from s3-b2bi-s3/template1.yaml rename to s3-b2bi-s3/template-part1.yaml index a7e836fd4..a01e4cd9b 100644 --- a/s3-b2bi-s3/template1.yaml +++ b/s3-b2bi-s3/template-part1.yaml @@ -1,6 +1,6 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 -Description: This SAM Template demonstrates how AWS B2B Data Interchange can transform EDI Files into JSON as per the transformation logic +Description: This is part 1 of a 2 part template to demonstrate how AWS B2B Data Interchange can transform EDI Files into JSON as per the transformation logic. This is part 1 of the template. # Get the required input parameters Parameters: @@ -10,6 +10,8 @@ Parameters: Email: Type: String Description: Please enter email id + AllowedPattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$ + ConstraintDescription: You should enter a valid email Phone: Type: String Description: Please enter phone number @@ -86,7 +88,7 @@ Resources: Properties: BucketName: !Sub "edi-214-output-${AWS::AccountId}-${AWS::Region}" - # Create bucket policy to allow read operations from AWS B2B Data Interchange + # Create bucket policy to allow write operations from AWS B2B Data Interchange EDI214OutputBucketPolicy: Type: AWS::S3::BucketPolicy Properties: diff --git a/s3-b2bi-s3/template2.yaml b/s3-b2bi-s3/template-part2.yaml similarity index 84% rename from s3-b2bi-s3/template2.yaml rename to s3-b2bi-s3/template-part2.yaml index e22cda551..ea4912145 100644 --- a/s3-b2bi-s3/template2.yaml +++ b/s3-b2bi-s3/template-part2.yaml @@ -1,6 +1,6 @@ AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 -Description: SAM Template that creates an EC2 Instance, an Amazon S3 Express One Zone directory bucket and required IAM Role to access the bucket from the instance +Description: This is part 2 of a 2 part template to demonstrate how AWS B2B Data Interchange can transform EDI Files into JSON as per the transformation logic. This is part 1 of the template. # Get the required input parameters Parameters: @@ -10,6 +10,8 @@ Parameters: Email: Type: String Description: Please enter email id + AllowedPattern: ^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$ + ConstraintDescription: You should enter a valid email Phone: Type: String Description: Please enter phone number