Skip to content

Commit 84fa6f5

Browse files
authored
ci action revamp + runtime & timeout bump + docs fixes (#2)
* bump the runtime and timeout * update github action workflow * update docs
1 parent dc2a202 commit 84fa6f5

File tree

6 files changed

+61
-13
lines changed

6 files changed

+61
-13
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
pull_request:
1010
branches:
1111
- master
12+
schedule:
13+
# “At 00:00 on Sunday.”
14+
- cron: "0 0 * * 0"
15+
workflow_dispatch:
1216

1317
jobs:
1418
terraform:
@@ -21,7 +25,7 @@ jobs:
2125
- name: Setup Python
2226
uses: actions/setup-python@v4
2327
with:
24-
python-version: '3.8'
28+
python-version: '3.9'
2529

2630
- name: Setup SAM
2731
uses: aws-actions/setup-sam@v2
@@ -56,3 +60,28 @@ jobs:
5660
awslocal s3 ls
5761
awslocal dynamodb list-tables
5862
awslocal sqs list-queues
63+
64+
- name: Send a Slack notification
65+
if: failure() || github.event_name != 'pull_request'
66+
uses: ravsamhq/notify-slack-action@v2
67+
with:
68+
status: ${{ job.status }}
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
notification_title: "{workflow} has {status_message}"
71+
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}>"
72+
footer: "Linked Repo <{repo_url}|{repo}> | <{run_url}|View Workflow run>"
73+
notify_when: "failure"
74+
env:
75+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
76+
77+
- name: Generate a Diagnostic Report
78+
if: failure()
79+
run: |
80+
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz
81+
82+
- name: Upload the Diagnostic Report
83+
if: failure()
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: diagnose.json.gz
87+
path: ./diagnose.json.gz

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ The products in an anonymous cart are terminated after some time, while an authe
4040
- [LocalSurf](https://docs.localstack.cloud/user-guide/tools/localsurf/) to repoint AWS service calls to LocalStack in the web app.
4141

4242

43-
Start LocalStack Pro with the `LOCALSTACK_API_KEY` pre-configured:
43+
Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
4444

4545
```shell
46-
export LOCALSTACK_API_KEY=<your-api-key>
46+
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
4747
EXTRA_CORS_ALLOWED_ORIGINS=http://localhost:8080 DEBUG=1 localstack start
4848
```
4949

backend/.aws-sam/build.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file is auto generated by SAM CLI build command
2+
3+
[function_build_definitions.6c90d28a-c1e2-4294-ac80-43b2221a2dd3]
4+
codeuri = "/Users/harshcasper/code/localstack/sample-serverless-shopping-cart-apigateway-lambda-cognito/backend/shopping-cart-service"
5+
runtime = "python3.9"
6+
architecture = "x86_64"
7+
handler = "list_cart.lambda_handler"
8+
manifest_hash = ""
9+
packagetype = "Zip"
10+
functions = ["ListCartFunction", "AddToCartFunction", "UpdateCartFunction", "MigrateCartFunction", "CheckoutCartFunction", "GetCartTotalFunction", "DeleteFromCartFunction", "CartDBStreamHandler"]
11+
12+
[layer_build_definitions.217fe41b-0e6c-4278-8e53-87251d2dd100]
13+
layer_name = "UtilsLayer"
14+
codeuri = "/Users/harshcasper/code/localstack/sample-serverless-shopping-cart-apigateway-lambda-cognito/backend/layers"
15+
build_method = "python3.9"
16+
compatible_runtimes = ["python3.9"]
17+
architecture = "x86_64"
18+
manifest_hash = ""
19+
layer = "UtilsLayer"

backend/auth.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Description: >
88
99
Globals:
1010
Function:
11-
Timeout: 3
11+
Timeout: 300
1212

1313
Resources:
1414
CognitoUserPool:

backend/product-mock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Parameters:
1010

1111
Globals:
1212
Function:
13-
Timeout: 5
13+
Timeout: 300
1414
Tracing: Active
1515
AutoPublishAlias: live
16-
Runtime: python3.8
16+
Runtime: python3.9
1717
MemorySize: 256
1818
Environment:
1919
Variables:

backend/shoppingcart-service.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ Parameters:
2020

2121
Globals:
2222
Function:
23-
Timeout: 5
23+
Timeout: 300
2424
MemorySize: 512
2525
Tracing: Active
2626
AutoPublishAlias: live
27-
Runtime: python3.8
27+
Runtime: python3.9
2828
Layers:
2929
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPython:3
3030
Environment:
@@ -50,9 +50,9 @@ Resources:
5050
Properties:
5151
ContentUri: ./layers/
5252
CompatibleRuntimes:
53-
- python3.8
53+
- python3.9
5454
Metadata:
55-
BuildMethod: python3.8
55+
BuildMethod: python3.9
5656

5757
CartApi:
5858
Type: AWS::Serverless::Api
@@ -250,7 +250,7 @@ Resources:
250250
Properties:
251251
CodeUri: shopping-cart-service/
252252
Handler: migrate_cart.lambda_handler
253-
Timeout: 30
253+
Timeout: 300
254254
Layers:
255255
- !Ref UtilsLayer
256256
Environment:
@@ -276,7 +276,7 @@ Resources:
276276
Properties:
277277
CodeUri: shopping-cart-service/
278278
Handler: checkout_cart.lambda_handler
279-
Timeout: 10
279+
Timeout: 300
280280
Layers:
281281
- !Ref UtilsLayer
282282
Environment:
@@ -301,7 +301,7 @@ Resources:
301301
Properties:
302302
CodeUri: shopping-cart-service/
303303
Handler: get_cart_total.lambda_handler
304-
Timeout: 10
304+
Timeout: 300
305305
Layers:
306306
- !Ref UtilsLayer
307307
Role: !GetAtt ListCartRole.Arn

0 commit comments

Comments
 (0)