forked from cybergolemai/iac_bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
36 lines (30 loc) · 927 Bytes
/
buildspec.yml
File metadata and controls
36 lines (30 loc) · 927 Bytes
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
version: 0.2
phases:
install:
runtime-versions:
python: 3.11
commands:
- pip install --upgrade pip
- pip install terraform-validator boto3
- curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
- apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
- apt-get update && apt-get install -y terraform
pre_build:
commands:
- terraform init
- terraform validate
- terraform plan -out=tfplan
build:
commands:
- terraform apply -auto-approve tfplan
post_build:
commands:
- aws lambda update-function-code --function-name bedrock-api --zip-file fileb://lambda_function.zip
- aws apigateway create-deployment --rest-api-id $(terraform output -raw api_id) --stage-name api
artifacts:
files:
- '**/*'
base-directory: '.'
cache:
paths:
- '/root/.terraform/**/*'