1.1.6 • Published 23 days ago

@sylvesterllc/aws-constructs v1.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
23 days ago

Bishop CDK Construct Library

Bishop Constructs

Bishop Constructs is a construct library for creating new AWS Infrastructure in a standardize reusable manner.

Publish package to GitHub Packages

Available Constructors

And more...

Installation

  1. Install the npm package:

    npm install @davissylvester/bishop-cdk-constructs --save

    • ensure you have a .npmrc that uses the @sylvesterllc npm registry

Microservice Construct

The Microservice construct provides and easy way to get started with a basic Microservice.

Infrastructure

- API Gateway (Rest API)
- Lambda 
- Dynamodb
- Lambda Authorizer 
  - TokenAuthorizer

Access

All lambdas are created with Read/Write Access to DynamoDB tables

Usage

import { MicroService, MicroserviceProps } from '@davissylvester/bishop-cdk-constructs';

new MicroService(this, 'microservice-test', microServiceProps);

MicroserviceProps

const microServiceProps: MicroserviceProps = {
     GLOBALS: {
         name: `sample-test-app`,
         environments: "dev",
         stackRuntime: Runtime.NODEJS_18_X,          
     },
     API: {
         Name: `sample-test-app`,
         Description: 'This is my new API'
     },
     RESOURCES: {
         AUTHORIZER: {
           name: `jwt-authorizer`,
           codePath: './lambda-functions/authorizer/index.ts',
           handler: 'handler',
           apiPathRoot: '',
           route: '',
       }, 
         LAMBDA: [
             {
                 name: `hello-world`,
                 codePath: './lambda-functions/hello-world/index.ts',
                 handler: 'main',
                 method: 'get',
                 apiPathRoot: 'hello-world',
                 route: '/hello-world'
             },
             {
                 name: `hellow-world2`,
                 codePath: './lambda-functions/hello-world/index.ts',
                 handler: 'main',
                 method: 'get',
                 apiPathRoot: '/hello-world/2',
                 route: '/hello-world/2'
             },
             {
               name: `hello-world3`,
               codePath: './lambda-functions/hello-world/index.ts',
               handler: 'main',
               method: 'get',
               apiPathRoot: '/hello-world/2',
               route: '/hello-world/2/{id}',
               secure: true
           },
         ],
         DYNAMO: {
             TABLES: [
                 {
                     tableName: `sample-audit-history`,
                     primaryKey: {
                         name: 'id',
                         type: AttributeType.STRING,
                     },
                     billingMode: BillingMode.PAY_PER_REQUEST,
                     indexes: [
                         {
                             indexName: 'createdTS',
                             partitionKey: {
                                 name: 'createdTS',
                                 type: AttributeType.NUMBER
                             },
                             projectionType: ProjectionType.ALL
                         },
                         {
                             indexName: 'username',
                             partitionKey: {
                                 name: 'username',
                                 type: AttributeType.STRING
                             },
                             projectionType: ProjectionType.ALL
                         },
                     ]
                 },
             ],
         },
 
     }
 }; 

Best Practice

When using this library it is a good practice to start with a new CDK project

  • npm install -g typescript aws-cdk
  • mkdir my-new-project
  • cd my-new-project
  • cdk init app --language typescript
  • npm i @davissylvester/bishop-cdk-constructs
  • mkdir lambda-functions (holds all your lambda code)

Demo Project

  • Clone the repository
    • git clone https://github.com/davissylvester/bishop-cdk-constructs-demo.git
    • npm i
    • cdk bootstrap
    • cdk deploy

Release Version : 1.0.28

1.1.6

23 days ago

1.1.5

23 days ago

1.1.4

23 days ago

1.1.3

23 days ago

1.1.2

23 days ago

1.1.1

25 days ago

1.1.0

25 days ago

1.0.107

26 days ago

1.0.109

26 days ago

1.0.108

26 days ago

1.0.120

26 days ago

1.0.110

26 days ago

1.0.112

26 days ago

1.0.111

26 days ago

1.0.118

26 days ago

1.0.117

26 days ago

1.0.119

26 days ago

1.0.114

26 days ago

1.0.113

26 days ago

1.0.116

26 days ago

1.0.115

26 days ago

1.0.101

29 days ago

1.0.100

30 days ago

1.0.106

29 days ago

1.0.103

29 days ago

1.0.102

29 days ago

1.0.105

29 days ago

1.0.104

29 days ago

1.0.99

30 days ago

1.0.98

1 month ago

1.0.95

2 months ago

1.0.97

2 months ago

1.0.94

2 months ago

1.0.93

2 months ago

1.0.92

2 months ago

1.0.91

2 months ago

1.0.90

2 months ago

1.0.66

7 months ago

1.0.65

7 months ago

1.0.64

7 months ago

1.0.63

7 months ago

1.0.69

7 months ago

1.0.68

7 months ago

1.0.67

7 months ago

1.0.29

10 months ago

1.0.73

7 months ago

1.0.72

7 months ago

1.0.71

7 months ago

1.0.70

7 months ago

1.0.77

7 months ago

1.0.76

7 months ago

1.0.32

7 months ago

1.0.75

7 months ago

1.0.31

10 months ago

1.0.74

7 months ago

1.0.30

10 months ago

1.0.37

7 months ago

1.0.36

7 months ago

1.0.35

7 months ago

1.0.78

7 months ago

1.0.34

7 months ago

1.0.39

7 months ago

1.0.38

7 months ago

1.0.80

7 months ago

1.0.84

6 months ago

1.0.40

7 months ago

1.0.83

7 months ago

1.0.82

7 months ago

1.0.81

7 months ago

1.0.44

7 months ago

1.0.87

6 months ago

1.0.43

7 months ago

1.0.86

6 months ago

1.0.42

7 months ago

1.0.85

6 months ago

1.0.41

7 months ago

1.0.48

7 months ago

1.0.47

7 months ago

1.0.46

7 months ago

1.0.45

7 months ago

1.0.49

7 months ago

1.0.51

7 months ago

1.0.50

7 months ago

1.0.55

7 months ago

1.0.54

7 months ago

1.0.53

7 months ago

1.0.52

7 months ago

1.0.57

7 months ago

1.0.56

7 months ago

1.0.19

12 months ago

1.0.18

12 months ago

1.0.17

12 months ago

1.0.16

12 months ago

1.0.22

12 months ago

1.0.21

12 months ago

1.0.20

12 months ago

1.0.26

12 months ago

1.0.25

12 months ago

1.0.24

12 months ago

1.0.23

12 months ago

1.0.28

11 months ago

1.0.27

11 months ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

12 months ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago