Skip to content

Commit f03fe35

Browse files
committed
update runner for stateful deployment
1 parent 21190da commit f03fe35

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

.github/workflows/deploy-stateful-dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ run-name: Deploy stateful resources to AWS DEV by @${{ github.actor }}
33

44
on:
55
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- main
9+
paths:
10+
- "cloudformation/stateful.yml"
11+
- "stateful.sh"
612

713
jobs:
814
deploy:

.github/workflows/deploy-stateful.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ run-name: Deploy stateful resources to AWS PROD by @${{ github.actor }}
33

44
on:
55
workflow_dispatch:
6+
paths:
7+
- "cloudformation/stateful.yml"
8+
- "stateful.sh"
69

710
jobs:
8-
deploy:
11+
deploy-dev:
912
runs-on: ubuntu-latest
13+
environment: "AWS DEV"
1014
steps:
1115
- uses: actions/checkout@v3
1216
- uses: aws-actions/setup-sam@v2
@@ -17,4 +21,20 @@ jobs:
1721
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
1822
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
1923
aws-region: us-east-1
20-
- run: ./stateful.sh
24+
- run: ./stateful.sh
25+
deploy-prod:
26+
runs-on: ubuntu-latest
27+
needs:
28+
- deploy-dev
29+
environment: "AWS PROD"
30+
steps:
31+
- uses: actions/checkout@v3
32+
- uses: aws-actions/setup-sam@v2
33+
with:
34+
use-installer: true
35+
- uses: aws-actions/configure-aws-credentials@v2
36+
with:
37+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
38+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
39+
aws-region: us-east-1
40+
- run: ./stateful.sh

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- main
99
paths:
1010
- "code/**"
11-
- "cloudformation/**"
11+
- "cloudformation/lambda.yml"
1212
- "docs/**"
1313
- "deploy-dev.sh"
1414
- "deploy.sh"

cloudformation/stateful.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ Resources:
1919
ProfileDataTable:
2020
Type: AWS::DynamoDB::Table
2121
Properties:
22+
BillingMode: PAY_PER_REQUEST
23+
DeletionProtectionEnabled: True
24+
OnDemandThroughput:
25+
MaxReadRequestUnits: 5
26+
MaxWriteRequestUnits: 5
2227
TableName: !Ref ProfileDataTableName
2328
AttributeDefinitions:
2429
-
@@ -28,9 +33,6 @@ Resources:
2833
-
2934
AttributeName: !Ref HashKeyElementName
3035
KeyType: HASH
31-
ProvisionedThroughput:
32-
ReadCapacityUnits: 5
33-
WriteCapacityUnits: 5
3436
Tags:
3537
- Key: "project"
3638
Value: "infra-resume-book"

0 commit comments

Comments
 (0)