Skip to content

Commit 3a90070

Browse files
committed
dev: setup buckets #118
1 parent 5fd0b26 commit 3a90070

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

dev/.aws/setup_s3_buckets.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "🚀 Initializing LocalStack S3..."
5+
6+
# Wait for LocalStack to be ready
7+
until awslocal s3 ls; do
8+
echo "⏳ Waiting for LocalStack to be ready..."
9+
sleep 2
10+
done
11+
12+
# Create buckets
13+
echo "📦 Creating S3 buckets..."
14+
awslocal s3 mb s3://${AWS_BUCKET_NAME}
15+
16+
# Set bucket policies/CORS if needed
17+
echo "⚙️ Configuring bucket settings..."
18+
awslocal s3api put-bucket-cors --bucket ${AWS_BUCKET_NAME} --cors-configuration '{
19+
"CORSRules": [
20+
{
21+
"AllowedHeaders": ["*"],
22+
"AllowedMethods": ["GET", "PUT", "POST", "DELETE", "HEAD"],
23+
"AllowedOrigins": ["*"],
24+
"MaxAgeSeconds": 3000
25+
}
26+
]
27+
}'
28+
29+
echo "✅ LocalStack S3 initialization completed!"

0 commit comments

Comments
 (0)