You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
# Coffee Store CDK
2
2
3
-
This is a "walking skeleton" AWS Lambda app, using **TypeScript**, **CDK**, **Vitest**, and **Github Actions**. It is fully
4
-
deployable, includes tests, and has a Github Actions workflow that will perform integration tests on an ephemeral
3
+
This is a "walking skeleton" AWS Lambda app, using **TypeScript**, [**CDK**](https://aws.amazon.com/cdk/), [**Vitest**](https://vitest.dev), and [**GitHub Actions**](https://github.com/features/actions). It is fully
4
+
deployable, includes tests, and has a Github Actions workflow that will perform remote tests on an ephemeral
5
5
deployment in AWS.
6
6
7
7
In other words you can use this repo as a basis for making your own TypeScript Lambda-based applications.
8
8
9
9
## Other CDK examples
10
10
11
-
This example is part of a collection of CDK examples - others are as follows:
11
+
This example is part of a collection of CDK examples I have created - others are as follows:
12
12
13
13
*[CDK bare-bones app for TypeScript](https://github.com/symphoniacloud/cdk-bare-bones) - Base project for any TypeScript app using CDK for deployment to AWS. **Try this first if you are getting started with CDK.**
14
14
*[Coffee Store Web Basic](https://github.com/symphoniacloud/coffee-store-web-basic) - Website hosting on AWS with CloudFront and S3
15
15
*[Coffee Store Web Full](https://github.com/symphoniacloud/coffee-store-web-full) - A further extension of _Coffee Store Web Basic_ that is a real working demo of a production-ready website project, including TLS certificates, DNS hosting, Github Actions Workflows, multiple CDK environments (prod vs test vs dev)
16
16
17
17
## How this project works
18
18
19
-
This example deploys a CDK _App_ that deploys a Lambda Function, together with a [Lambda Function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) to make it accessible over HTTP.
19
+
This example deploys a [CDK _App_](https://docs.aws.amazon.com/cdk/v2/guide/apps.html) that deploys a Lambda Function, together with a [Lambda Function URL](https://docs.aws.amazon.com/lambda/latest/dg/lambda-urls.html) to make it accessible over HTTP.
20
20
21
21
To build the Lambda function, this example uses the [`NodejsFunction` CDK Construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html) which performs build actions as part of the deploy process. In this configuration the Construct:
22
22
@@ -25,12 +25,11 @@ To build the Lambda function, this example uses the [`NodejsFunction` CDK Constr
25
25
26
26
### "CDK as build tool"
27
27
28
-
Using `NodejsFunction` makes CDK a build tool and not just a deployment tool. In the past I've been hesitant to use this feature since it didn't feel like it worked well for me.
28
+
Using `NodejsFunction` makes CDK a build tool and not just a deployment tool.
29
+
Fellow old-timey developers like me might be concerned by this, however I feel like `NodejsFunction` is "good enough" for many small to medium size TS Lambda projects.
29
30
30
-
As of August 2022, however, I feel like `NodejsFunction` is probably "good enough" for many small to medium size TS Lambda projects.
31
-
32
-
If you'd like more control over your build process then swap `NodejsFunction` for the standard CDK `Function` construct, and add a _build_ phase to your project.
33
-
To see an example of this, including a wrapper script for ESBuild, see the [earlier version of this project](https://github.com/symphoniacloud/coffee-store-cdk/tree/57a209a28be7eabe468125ea1d5dc0f81433fcd2).
31
+
If you'd like more control over your build process then swap `NodejsFunction` for the standard [CDK `Function` construct](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html),
32
+
and add a _build_ phase to your project. To see an example of this, including a wrapper script for ESBuild, see the [earlier version of this project](https://github.com/symphoniacloud/coffee-store-cdk/tree/57a209a28be7eabe468125ea1d5dc0f81433fcd2).
34
33
35
34
## Prerequisites
36
35
@@ -114,7 +113,7 @@ If you want to run remote tests via the IDE:
114
113
### Running remote tests targeting an ephemeral stack
115
114
116
115
Alternatively the remote test can run against an _ephemeral_ stack - i.e. a new stack will be deployed as part of
117
-
test setup, and then torn down as part of test cleanup. To use this method **don't**
116
+
test setup, and then torn down as part of test cleanup. Not surprisingly this method takes a lot longer to run! To use this method **don't**
118
117
specify a `STACK_NAME` value in the environment.
119
118
120
119
E.g. if you run `npm run remote-tests`**with no**`STACK_NAME` you will see something like the following in the console output
Copy file name to clipboardExpand all lines: github-actions-prereqs/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ with a suitably powerful role then you don't have much work to do! You have two
23
23
24
24
* Either create a new Github Secret (org or repo scope) named `ACTIONS_ROLE_ARN`, with the value being the ARN of the
25
25
IAM role Github Actions should assume.
26
-
* OR change the Github actions workflow [template](/.github/workflows/buildAndTest.yml)updating, how `role-to-assume` is configured (e.g. you could hard code
26
+
* OR change the Github actions workflow [template](/.github/workflows/buildAndTest.yml)and change how `role-to-assume` is configured (e.g. you could hard code
27
27
the ARN or specify a different secret).
28
28
29
29
## 2 - If you've already configured Github OIDC in your AWS account, but need a new role for this project
0 commit comments