0.5.7 • Published 6 days ago

@scloud/cdk-patterns v0.5.7

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

CDK Patterns

Provides a set of functions that can be called to build common serverless CDK patterns.

This is intended to provide you with the patterns you'll mostly need most of the time and, if you have an edge-case, example code you can reuse that helps you get what you need done more easily.

See also this companion pacage to integrate your CDK infrastructure with Github Actions: @scloud/cdk-github https://www.npmjs.com/package/@scloud/cdk-github

Overview

I'm publishing this to help others because I've been using it for a couple of years now and it's been a real help for projects I've worked on (personal and professional). It's grown organically, accumulating patterns I've reached for repeatedly, so there's no comprehensive documentation at his stage! Please be kind.

A couple of highlights:

  • queueLambda() - creates a Lambda function fed by an SQS queue
  • webAppRoutes - creates a Cloudfront distribution with a bucket for hosting static content (e.g. a React app) and Lambda functions to handle requests made to specific path prefixes
  • cognitoPool - creates a Cognito user pool and optionally configures Google, Facebook and SAML (sso) login
  • ghaUser - if you use Github Actions, this generates an IAM user access key with permission to deploy to resources defined in your stack (see also addGha* functions such as addGhaSecret, addGhaVariable, addGhaLambda etc.)

Release notes

  • 0.5.6: Simplify and improve documentation comment for WebApi
  • 0.5.5: First draft of WebApi pattern (e.g. mobile app backend)
  • 0.5.4: Enable customising Cloudfront defaultBehavior in DistributionProps, which enables us to remove the explicit WebRoutesProps.functionAssociation? in favour of optionally passing this as part of WebRoutesProps.distributionProps
  • 0.5.3: Add BuildsBucket
  • 0.5.2: Add an optional handler to ZipFunctionProps so that a handler other than src/lambda.handler can be specified.
  • 0.5.1: Update WwwRediect prop domain to domainName in to be clearer and more consistent with related constructs
  • 4.3.37: Documentation update.
  • 4.3.36: Fix genetating default https://auth. Cognito URLs if no domain prefix or explicit domain name is passed to the static Cognito creation functions.

Philosophy and contribution

I've refined these patterns since 2020 to keep them as clean, simple and useful as possible. My main aim is to build a library that gives you what you usually need, most of the time. That means it makes assumptions and has some opinions.

Most of the work has focused on Lambdas packaged as zip files. Some of the container code hasn't been touched in a while so this may be less up to date.

If you need something that's more specific / more configurable and isn't catered for you can:

  • Use the source code of existing functions as a starting point to develop CDK code that meets your use-case
  • Open an issue or send me a pull request if you see an opportunity for improvement
0.5.7

6 days ago

0.5.6

2 months ago

0.5.5

2 months ago

0.5.4

3 months ago

0.5.3

3 months ago

0.5.2

5 months ago

0.5.1

5 months ago

0.4.37

5 months ago

0.4.36

5 months ago

0.4.35

5 months ago

0.4.9

7 months ago

0.4.8

7 months ago

0.2.27

8 months ago

0.2.26

8 months ago

0.2.25

8 months ago

0.2.24

8 months ago

0.2.23

8 months ago

0.2.22

8 months ago

0.2.21

8 months ago

0.2.20

8 months ago

0.2.19

8 months ago

0.2.18

8 months ago

0.2.17

8 months ago

0.4.31

6 months ago

0.4.32

5 months ago

0.4.30

6 months ago

0.2.16

8 months ago

0.2.15

8 months ago

0.2.14

8 months ago

0.2.13

8 months ago

0.2.12

8 months ago

0.2.11

8 months ago

0.4.33

5 months ago

0.2.10

8 months ago

0.4.34

5 months ago

0.3.5

8 months ago

0.3.2

8 months ago

0.3.1

8 months ago

0.3.4

8 months ago

0.3.3

8 months ago

0.4.20

6 months ago

0.4.21

6 months ago

0.4.28

6 months ago

0.4.29

6 months ago

0.4.26

6 months ago

0.4.27

6 months ago

0.4.24

6 months ago

0.4.25

6 months ago

0.4.22

6 months ago

0.4.23

6 months ago

0.4.19

6 months ago

0.4.10

7 months ago

0.1.20

10 months ago

0.1.21

9 months ago

0.1.22

9 months ago

0.4.17

6 months ago

0.4.18

6 months ago

0.4.15

7 months ago

0.4.16

7 months ago

0.4.13

7 months ago

0.4.14

7 months ago

0.4.11

7 months ago

0.4.12

7 months ago

0.4.5

7 months ago

0.1.16

10 months ago

0.4.4

7 months ago

0.1.17

10 months ago

0.4.7

7 months ago

0.1.18

10 months ago

0.4.6

7 months ago

0.1.19

10 months ago

0.4.1

7 months ago

0.4.3

7 months ago

0.4.2

7 months ago

0.1.13

10 months ago

0.1.14

10 months ago

0.1.15

10 months ago

0.2.41

8 months ago

0.2.40

8 months ago

0.2.39

8 months ago

0.2.30

8 months ago

0.2.38

8 months ago

0.2.37

8 months ago

0.2.36

8 months ago

0.2.35

8 months ago

0.2.34

8 months ago

0.2.33

8 months ago

0.2.32

8 months ago

0.2.31

8 months ago

0.2.1

9 months ago

0.2.29

8 months ago

0.2.28

8 months ago

0.2.7

9 months ago

0.2.6

9 months ago

0.2.9

9 months ago

0.2.8

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.5

9 months ago

0.2.4

9 months ago

0.1.12

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.0

11 months ago