Skip to content

Commit 7bc9038

Browse files
author
gsbains
committed
added support for private vpc deployment
1 parent 4037cc4 commit 7bc9038

File tree

6 files changed

+209
-25
lines changed

6 files changed

+209
-25
lines changed

docs/DEPLOYMENT.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,62 @@ FAST supports two deployment types for AgentCore Runtime. Set `deployment_type`
6363

6464
**ZIP packaging includes**: The `patterns/<your-pattern>/`, `gateway/`, and `tools/` directories are bundled together with dependencies from `requirements.txt`. This matches the `COPY` commands in the Docker deployment's Dockerfile.
6565

66+
### VPC Deployment (Private Network)
67+
68+
By default, the AgentCore Runtime runs in PUBLIC network mode with internet access. To deploy the runtime into an existing VPC for private network isolation, set `network_mode: VPC` in `infra-cdk/config.yaml` and provide your VPC details:
69+
70+
```yaml
71+
backend:
72+
pattern: strands-single-agent
73+
deployment_type: docker
74+
network_mode: VPC
75+
vpc:
76+
vpc_id: vpc-0abc1234def56789a
77+
subnet_ids:
78+
- subnet-aaaa1111bbbb2222c
79+
- subnet-cccc3333dddd4444e
80+
security_group_ids: # Optional - a default SG is created if omitted
81+
- sg-0abc1234def56789a
82+
```
83+
84+
The `vpc_id` and `subnet_ids` fields are required. The `security_group_ids` field is optional — if omitted, the CDK construct will create a default security group for the runtime.
85+
86+
#### Required VPC Endpoints
87+
88+
When deploying in VPC mode, the runtime runs in private subnets without internet access. Your VPC must have the following VPC endpoints configured so the agent can reach the AWS services it depends on:
89+
90+
| Endpoint | Service | Type |
91+
|----------|---------|------|
92+
| `com.amazonaws.{region}.bedrock-runtime` | Bedrock model invocation | Interface |
93+
| `com.amazonaws.{region}.bedrock-agent-runtime` | AgentCore Runtime | Interface |
94+
| `com.amazonaws.{region}.ssm` | SSM Parameter Store | Interface |
95+
| `com.amazonaws.{region}.secretsmanager` | Secrets Manager | Interface |
96+
| `com.amazonaws.{region}.logs` | CloudWatch Logs | Interface |
97+
| `com.amazonaws.{region}.ecr.api` | ECR API (Docker deployment) | Interface |
98+
| `com.amazonaws.{region}.ecr.dkr` | ECR Docker (Docker deployment) | Interface |
99+
| `com.amazonaws.{region}.s3` | S3 (ZIP deployment, ECR layers) | Gateway |
100+
| `com.amazonaws.{region}.dynamodb` | DynamoDB (feedback table) | Gateway |
101+
102+
Replace `{region}` with your deployment region (e.g. `us-east-1`).
103+
104+
All interface endpoints must have private DNS enabled and must be associated with the same subnets and security groups that allow traffic from the AgentCore Runtime.
105+
106+
#### Subnet Requirements
107+
108+
- Use private subnets (no internet gateway route) for proper network isolation
109+
- Subnets should be in at least two Availability Zones for high availability
110+
- Subnets must have sufficient available IP addresses for the runtime ENIs
111+
112+
#### NAT Gateway Requirement
113+
114+
A NAT Gateway is required for VPC mode. The agent authenticates with Cognito using the OAuth2 client credentials flow, which calls the Cognito hosted UI token endpoint over HTTPS. This endpoint has no VPC endpoint — it can only be reached over the internet. A NAT Gateway in a public subnet with a `0.0.0.0/0` route from your private subnets provides this outbound IPv4 access. All other AWS service traffic (Bedrock, SSM, etc.) stays internal via VPC endpoints.
115+
116+
#### Security Group Configuration
117+
118+
The CDK stack auto-creates a security group for the AgentCore Runtime. This same security group is typically applied to your VPC endpoints. You must add a self-referencing inbound rule to allow the runtime to reach the endpoints:
119+
120+
- Protocol: TCP, Port: 443, Source: the security group itself
121+
66122
## Deployment Steps
67123

68124
### TL;DR version

frontend/package-lock.json

Lines changed: 22 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra-cdk/config.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@ stack_name_base: FAST-stack
22

33
# Optional: Set to automatically create an admin user and email credentials
44
# If not provided, you'll need to manually create users via AWS Console
5-
admin_user_email: null # Example: admin@example.com
5+
admin_user_email: # Example: admin@example.com
66

77
backend:
88
pattern: strands-single-agent # Available patterns: strands-single-agent, langgraph-single-agent
99
deployment_type: docker # Available deployment types: docker (default), zip
10+
network_mode: PUBLIC # Available network modes: PUBLIC (default), VPC
11+
12+
# VPC configuration - required when network_mode is VPC
13+
# Your VPC must have the necessary VPC endpoints for AWS services.
14+
# See docs/DEPLOYMENT.md for the full list of required VPC endpoints.
15+
# vpc:
16+
# vpc_id: vpc-0f8ba75944c47874e
17+
# subnet_ids:
18+
# - subnet-0cc003ad58698abe2
19+
# - subnet-0e4c45095d7998534
20+
# security_group_ids: # Optional - a default SG is created if omitted
21+
# - sg-0abc1234def56789a

0 commit comments

Comments
 (0)