Skip to content

Commit

Permalink
Fixed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Biswanath Mukherjee committed Feb 8, 2024
1 parent 163489a commit 2348299
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
5 changes: 2 additions & 3 deletions s3-b2bi-s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -40,15 +40,14 @@ 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:

- Enter a stack name. I am assuming stack name to be `b2bi-stack2`.
- 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
Expand Down
10 changes: 5 additions & 5 deletions s3-b2bi-s3/example-pattern.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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": {
Expand All @@ -46,8 +46,8 @@
},
"cleanup": {
"text": [
"Delete the Amazon S3 input bucket content: <code>aws s3 rm s3://{EDI214InputBucketName} --recursive</code> --region {my-region}",
"Delete the Amazon S3 input bucket content: <code>aws s3 rm s3://{EDI214OutputBucketName} --recursive</code> --region {my-region}",
"Delete the Amazon S3 input bucket content: <code>aws s3 rm s3://{EDI214InputBucketName} --recursive --region {my-region}</code>",
"Delete the Amazon S3 output bucket content: <code>aws s3 rm s3://{EDI214OutputBucketName} --recursive --region {my-region}</code>",
"Delete the stack1: <code>sam delete --stack-name {b2bi-stack2}</code>.",
"Delete the stack1: <code>sam delete --stack-name {b2bi-stack1}</code>."
]
Expand Down
6 changes: 4 additions & 2 deletions s3-b2bi-s3/template1.yaml → s3-b2bi-s3/template-part1.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion s3-b2bi-s3/template2.yaml → s3-b2bi-s3/template-part2.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down

0 comments on commit 2348299

Please sign in to comment.