-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.ps1
More file actions
37 lines (30 loc) · 1.18 KB
/
deploy.ps1
File metadata and controls
37 lines (30 loc) · 1.18 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
# Deploy OpsForge to AWS
Write-Host "Deploying OpsForge AI to AWS..." -ForegroundColor Cyan
# Check AWS CLI
if (!(Get-Command aws -ErrorAction SilentlyContinue)) {
Write-Host "AWS CLI not found" -ForegroundColor Red
exit 1
}
# Package Lambda
Write-Host "`nPackaging Lambda function..." -ForegroundColor Yellow
.\package_lambda.bat
if (!(Test-Path "opsforge-lambda.zip")) {
Write-Host "Package failed" -ForegroundColor Red
exit 1
}
# Create S3 bucket for deployment
$bucketName = "opsforge-deployment-$(Get-Random)"
Write-Host "`nCreating S3 bucket: $bucketName" -ForegroundColor Yellow
aws s3 mb s3://$bucketName --region us-east-1
# Deploy with SAM
Write-Host "`nDeploying to AWS..." -ForegroundColor Yellow
sam deploy `
--template-file aws/template.yaml `
--stack-name opsforge-ai `
--s3-bucket $bucketName `
--capabilities CAPABILITY_IAM `
--region us-east-1 `
--parameter-overrides AnthropicApiKey=$env:ANTHROPIC_API_KEY
Write-Host "`nDeployment complete!" -ForegroundColor Green
Write-Host "`nGet API endpoint:" -ForegroundColor Cyan
Write-Host "aws cloudformation describe-stacks --stack-name opsforge-ai --query 'Stacks[0].Outputs'" -ForegroundColor Gray