Skip to content

Conversation

@usama-khan98
Copy link
Contributor

@usama-khan98 usama-khan98 commented Nov 18, 2024

Issue #, if available: 2516

Description of changes:
New SAM templates to create Private REST API Gateway in multiple accounts and integrate with the central account.

This pattern deploys four separate AWS accounts: a client account with an EC2 instance and VPC Endpoint for testing, a central account hosting the main API Gateway and routing components, an account with an ECS Fargate service behind a private API Gateway, and another account with a Lambda function integrated with Amazon Bedrock for image generation. Each account contains its own AWS resources to ensure proper communication and isolation.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

2. During the prompts:
- Enter **stack name** and desired **AWS Region**.
- Enter **Instance type** either `t2.micro` or `t2.small`
- Enter **unique [AMI Id](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html)** from chosen region.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What AMI do I need to search for?


## How it works

This pattern utilizes four accounts and their respective templates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This pattern utilizes four accounts and their respective templates.
This pattern utilizes three accounts and their respective templates.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this and others, keep one at the root folder if necessary

@@ -0,0 +1,80 @@
{
"title": "Enabling East/West Communication in Multi-Account AWS Architectures with Private API Gateway",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title needs to be 75 characters or less, please reword

"name": "Usama Ali Khan",
"image": "https://media.licdn.com/dms/image/v2/D4E03AQHcLMpZ1LV9UQ/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1685892371158?e=1737590400&v=beta&t=RaPZkIgm7m3thW4PyKSQNn_w9fMbYBeu5PPrQ6K4vBU",
"bio": "Usama is a Technical Account Manager at Amazon Web Services.",
"linkedin": "https://www.linkedin.com/in/usama-ali-khan/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"linkedin": "https://www.linkedin.com/in/usama-ali-khan/"
"linkedin": "usama-ali-khan"

"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/sfn-athena-cdk-python",
"templateURL": "serverless-patterns/multi-account-private-apigw",
"projectFolder": "multi-account-private-apigw",
"templateFile": "multi-account-private-apigw/centralAccount/template.yaml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"templateFile": "multi-account-private-apigw/centralAccount/template.yaml"
"templateFile": "centralAccount/template.yaml"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove as well

Comment on lines 139 to 142
3. For **/image** path, use the following curl command (*you can update the prompt and image name as needed*):
```bash
curl --location --request POST 'https://abcdefghij.execute-api.eu-west-1.amazonaws.com/Prod/image' \
--data 'A bustling futuristic city at night with neon signs, towering skyscrapers, flying vehicles, and busy street life, in the rain. Detailed and atmospheric.' --output image.jpg
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still relevant?

## Testing
1. Once you have deployed all the Stacks, [connect to your EC2 instance using SSH](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-to-linux-instance.html) or [using EC2 Instance Connect](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-linux-inst-eic.html) in **Central Account**.

2. After connecting to the EC2 instance, run the following `curl` command from the outputs to test the **/text** path (you can add `-v` flag for verbose response):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "from the outputs"?

Copy link
Contributor

@bfreiberg bfreiberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks almost perfect, just some minor adjustments

usama-khan98 and others added 4 commits November 28, 2024 11:56
Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com>
Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com>
Co-authored-by: Ben <9841563+bfreiberg@users.noreply.github.com>
@bfreiberg
Copy link
Contributor

Looks good, thanks for your contribution. Your pattern will be merged to Serverlessland soon.

@julianwood julianwood merged commit 1a14f18 into aws-samples:main Dec 10, 2024
@usama-khan98 usama-khan98 deleted the usama-khan98-feature-multi-account-private-apigw branch December 10, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants