Skip to content

Commit 3cb5bf8

Browse files
author
Bob Strahan
committed
Merge branch 'develop'
2 parents 548a46e + 141235b commit 3cb5bf8

File tree

3 files changed

+337
-716
lines changed

3 files changed

+337
-716
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.13
1+
0.3.14-wip

docs/govcloud-deployment.md

Lines changed: 18 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -33,57 +33,30 @@ graph TB
3333

3434
## Deployment Process
3535

36-
### Step 1: Standard Build Process
36+
### Step 1: Generate GovCloud Template
3737

38-
First, run the standard build process to create all Lambda functions and artifacts:
38+
First, generate the GovCloud-compatible template - this run the standard build process first to create all Lambda functions and artifacts, and then creates a stripped down version for GovCloud:
3939

4040
```bash
4141
# Build for GovCloud region
42-
python publish.py my-bucket-govcloud my-prefix us-gov-west-1
42+
python scripts/generate_govcloud_template.py my-bucket-govcloud my-prefix us-gov-west-1
4343

4444
# Or build for commercial region first (for testing)
45-
python publish.py my-bucket my-prefix us-east-1
45+
python scripts/generate_govcloud_template.py my-bucket my-prefix us-east-1
4646
```
4747

48-
### Step 2: Generate GovCloud Template
48+
### Step 2: Deploy to GovCloud
4949

50-
After the build completes, generate the GovCloud-compatible template:
50+
Deploy the generated template to GovCloud using the AWS CloudFormation console (recommended) or deploy using AWS CLI e.g:
5151

5252
```bash
53-
# Generate GovCloud template from processed template
54-
python scripts/generate_govcloud_template.py
55-
56-
# Optional: Use custom input/output paths
57-
python scripts/generate_govcloud_template.py \
58-
--input .aws-sam/packaged.yaml \
59-
--output my-govcloud-template.yaml \
60-
--verbose
61-
```
62-
63-
### Step 3: Deploy to GovCloud
64-
65-
Deploy the generated template to GovCloud:
66-
67-
```bash
68-
# Deploy using SAM
69-
sam deploy \
70-
--template-file template-govcloud.yaml \
71-
--stack-name my-idp-govcloud-stack \
72-
--region us-gov-west-1 \
73-
--capabilities CAPABILITY_IAM \
74-
--parameter-overrides \
75-
IDPPattern="Pattern2 - Packet processing with Textract and Bedrock" \
76-
MaxConcurrentWorkflows=50
77-
78-
# Or deploy using AWS CLI
7953
aws cloudformation deploy \
80-
--template-file template-govcloud.yaml \
54+
--template-file .aws-sam/idp-govcloud.yaml \
8155
--stack-name my-idp-govcloud-stack \
8256
--region us-gov-west-1 \
8357
--capabilities CAPABILITY_IAM \
8458
--parameter-overrides \
85-
IDPPattern="Pattern2 - Packet processing with Textract and Bedrock" \
86-
MaxConcurrentWorkflows=50
59+
IDPPattern="Pattern2 - Packet processing with Textract and Bedrock"
8760
```
8861

8962
## Services Removed in GovCloud
@@ -119,6 +92,12 @@ The following services are automatically removed from the GovCloud template:
11992
- Chat with document features
12093
- Text-to-SQL query capabilities
12194

95+
### HITL Support
96+
- SageMaker A2I Human-in-the-Loop
97+
- Private workforce configuration
98+
- Human review workflows
99+
100+
122101
## Core Services Retained
123102

124103
The following essential services remain available:
@@ -148,10 +127,6 @@ The following essential services remain available:
148127
- ✅ Post-processing Lambda hooks
149128
- ✅ Evaluation and reporting systems
150129

151-
### HITL Support
152-
- ✅ SageMaker A2I Human-in-the-Loop
153-
- ✅ Private workforce configuration
154-
- ✅ Human review workflows
155130

156131
## Access Methods
157132

@@ -160,102 +135,18 @@ Without the web UI, you can interact with the system through:
160135
### 1. Direct S3 Upload
161136
```bash
162137
# Upload documents directly to input bucket
163-
aws s3 cp my-document.pdf s3://my-input-bucket/documents/
138+
aws s3 cp my-document.pdf s3://InputBucket/my-document.pdf
164139

165-
# Monitor processing status
166-
aws dynamodb scan \
167-
--table-name MyStack-TrackingTable \
168-
--region us-gov-west-1
169-
```
170140

171-
### 2. CLI Tools
141+
### 2. Check progress
142+
Using the lookup script
172143
```bash
173144
# Use the lookup script to check document status
174145
./scripts/lookup_file_status.sh documents/my-document.pdf MyStack
175-
176-
# Or use default stack name (IDP)
177-
./scripts/lookup_file_status.sh documents/my-document.pdf
178-
```
179-
180-
### 3. SDK Integration
181-
```python
182-
import boto3
183-
184-
# Initialize clients
185-
s3_client = boto3.client('s3', region_name='us-gov-west-1')
186-
dynamodb = boto3.resource('dynamodb', region_name='us-gov-west-1')
187-
188-
# Upload document
189-
s3_client.upload_file('local-doc.pdf', 'my-input-bucket', 'docs/local-doc.pdf')
190-
191-
# Check processing status
192-
tracking_table = dynamodb.Table('MyStack-TrackingTable')
193-
response = tracking_table.get_item(
194-
Key={'PK': 'doc#docs/local-doc.pdf', 'SK': 'none'}
195-
)
196-
print(f"Status: {response['Item']['Status']}")
197-
198-
# Download results
199-
s3_client.download_file('my-output-bucket', 'docs/local-doc.pdf.json', 'results.json')
200-
```
201-
202-
### 4. REST API Alternative
203-
If you need programmatic API access, you can deploy a simple Lambda function with API Gateway:
204-
205-
```yaml
206-
# Optional: Add to your stack
207-
SimpleAPIFunction:
208-
Type: AWS::Serverless::Function
209-
Properties:
210-
CodeUri: src/simple-api/
211-
Handler: index.handler
212-
Runtime: python3.12
213-
Events:
214-
Api:
215-
Type: Api
216-
Properties:
217-
Path: /documents
218-
Method: post
219-
RestApiId: !Ref SimpleRestApi
220-
221-
SimpleRestApi:
222-
Type: AWS::Serverless::Api
223-
Properties:
224-
StageName: v1
225-
EndpointConfiguration: REGIONAL
226-
```
227-
228-
## Configuration Management
229-
230-
Without the UI, configuration is managed through:
231-
232-
### 1. S3 Configuration Files
233-
Edit configuration files directly in the configuration bucket:
234-
235-
```bash
236-
# Download current configuration
237-
aws s3 cp s3://my-config-bucket/config_library/pattern-2/bank-statement-sample/config.yaml ./
238-
239-
# Edit and upload back
240-
aws s3 cp ./config.yaml s3://my-config-bucket/config_library/pattern-2/bank-statement-sample/
241146
```
242147

243-
### 2. DynamoDB Configuration Table
244-
Update configuration through the DynamoDB table:
148+
Or navigate to the AWS Step Functions workflow using the link in the stack Outputs tab in CloudFormation, to visually monitor workflow progress.
245149

246-
```bash
247-
# View current configuration
248-
aws dynamodb get-item \
249-
--table-name MyStack-ConfigurationTable \
250-
--key '{"Configuration": {"S": "Default"}}' \
251-
--region us-gov-west-1
252-
253-
# Update configuration (JSON format)
254-
aws dynamodb put-item \
255-
--table-name MyStack-ConfigurationTable \
256-
--item file://new-config.json \
257-
--region us-gov-west-1
258-
```
259150

260151
## Monitoring & Troubleshooting
261152

@@ -323,14 +214,6 @@ The following features are not available:
323214

324215
### Common Issues
325216

326-
**Template Validation Errors**
327-
```bash
328-
# Validate template before deployment
329-
aws cloudformation validate-template \
330-
--template-body file://template-govcloud.yaml \
331-
--region us-gov-west-1
332-
```
333-
334217
**Missing Dependencies**
335218
- Ensure all Bedrock models are enabled in the region
336219
- Verify IAM permissions for service roles

0 commit comments

Comments
 (0)