forked from awslabs/amazon-bedrock-agentcore-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·80 lines (71 loc) · 2.29 KB
/
deploy.sh
File metadata and controls
executable file
·80 lines (71 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Deploy script for Basic Agent Runtime CloudFormation stack
# This script deploys a basic AgentCore Runtime with a simple Strands agent
set -e
# Configuration
STACK_NAME="${1:-basic-agent-demo}"
REGION="${2:-us-west-2}"
TEMPLATE_FILE="template.yaml"
echo "=========================================="
echo "Deploying Basic Agent Runtime"
echo "=========================================="
echo "Stack Name: $STACK_NAME"
echo "Region: $REGION"
echo "=========================================="
# Check if template file exists
if [ ! -f "$TEMPLATE_FILE" ]; then
echo "Error: Template file '$TEMPLATE_FILE' not found!"
exit 1
fi
# Deploy the CloudFormation stack
echo ""
echo "Creating CloudFormation stack..."
aws cloudformation create-stack \
--stack-name "$STACK_NAME" \
--template-body file://"$TEMPLATE_FILE" \
--capabilities CAPABILITY_NAMED_IAM \
--region "$REGION"
if [ $? -eq 0 ]; then
echo ""
echo "✓ Stack creation initiated successfully!"
echo ""
echo "Waiting for stack creation to complete..."
echo "This will take approximately 10-15 minutes..."
echo ""
aws cloudformation wait stack-create-complete \
--stack-name "$STACK_NAME" \
--region "$REGION"
if [ $? -eq 0 ]; then
echo ""
echo "=========================================="
echo "✓ Stack deployed successfully!"
echo "=========================================="
echo ""
echo "Stack Outputs:"
aws cloudformation describe-stacks \
--stack-name "$STACK_NAME" \
--query 'Stacks[0].Outputs' \
--output table \
--region "$REGION"
echo ""
echo "Agent Runtime ID:"
aws cloudformation describe-stacks \
--stack-name "$STACK_NAME" \
--query 'Stacks[0].Outputs[?OutputKey==`AgentRuntimeId`].OutputValue' \
--output text \
--region "$REGION"
echo ""
echo "To delete this stack, run:"
echo " ./cleanup.sh $STACK_NAME $REGION"
echo ""
else
echo ""
echo "✗ Stack creation failed or timed out"
echo "Check the CloudFormation console for details"
exit 1
fi
else
echo ""
echo "✗ Failed to initiate stack creation"
exit 1
fi