@climatehub/cdk-constructs

Stores cdk constructs useful in constructing our services.

Usage no npm install needed!

<script type="module">
  import climatehubCdkConstructs from 'https://cdn.skypack.dev/@climatehub/cdk-constructs';
</script>

README

What is this?

Stores cdk constructs useful in constructing our services.

Installation

npm install @climatehub/cdk-constructs

Example Usage

import {SingleLambdaBackedRestApi} from '@climatehub/cdk-constructs';

const restApi = new SingleLambdaBackedRestApi(this, 'rest-api', {
  restApiName: `${props.domain}-rest-api`,
  handler: apiHandlerLambda,
  corsEnabled: true,
  loggingOptions: {
    accessLoggingEnabled: true,
    dataTraceEnabled: true,
    metricsEnabled: true,
    tracingEnabled: true,
  },
  resources: new Map<string, string[]>([
    ['/help/contact', ['POST']],
    ['/account', ['GET', 'POST']],
    ['/login', ['POST']],
    ['/logout', ['POST']],
    ['/company', ['POST']],
    ['/investor', ['POST']],
    ['/company/profile/{profileId}', ['PUT']],
    ['/investor/profile/{profileId}', ['PUT']],
    ['/company/account/{accountId}/profile/{profileId}', ['GET']],
    ['/investor/account/{accountId}/profile/{profileId}', ['GET']],
    ['/feedPost', ['POST', 'PUT', 'DELETE']],
    ['/feedPost/{feedPostId}/likedStatus', ['POST']],
    ['/feedPost/{feedPostId}/comment', ['POST', 'PUT', 'DELETE']],
    ['/feedPosts', ['GET']],
    ['/query/companies', ['POST']],
    ['/query/investors', ['POST']]
  ])
});