@byaga/cdk-patterns 0.8.1 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,6 @@ export declare class FunctionIntegration extends Function {
16
16
  stack: DeployStack;
17
17
  name: string;
18
18
  constructor(stack: DeployStack, id: string, options: FunctionIntegrationProps);
19
- attach(api: RestApi, httpMethod: string, path: string, props: AddToApiOptions): void;
19
+ attach(api: RestApi, httpMethod: string, path: string, props?: AddToApiOptions): void;
20
20
  }
21
21
  export {};
@@ -0,0 +1,12 @@
1
+ import { LayerVersion, Runtime } from "aws-cdk-lib/aws-lambda";
2
+ import { DeployStack } from "./DeployStack";
3
+ import { LayerVersionOptions } from "aws-cdk-lib/aws-lambda/lib/layers";
4
+ import { Architecture } from "aws-cdk-lib/aws-lambda/lib/architecture";
5
+ interface NodeJsLambdaLayerProps extends LayerVersionOptions {
6
+ readonly compatibleRuntimes?: Runtime[];
7
+ readonly compatibleArchitectures?: Architecture[];
8
+ }
9
+ export declare class NodeJsLambdaLayer extends LayerVersion {
10
+ constructor(stack: DeployStack, id: string, props?: NodeJsLambdaLayerProps);
11
+ }
12
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NodeJsLambdaLayer = void 0;
7
+ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
8
+ const build_node_source_1 = require("./methods/build-node-source");
9
+ const duration_1 = __importDefault(require("./methods/duration"));
10
+ class NodeJsLambdaLayer extends aws_lambda_1.LayerVersion {
11
+ constructor(stack, id, props = {}) {
12
+ console.log("Building Lambda Layer", id);
13
+ const done = (0, duration_1.default)();
14
+ const { buildDir } = (0, build_node_source_1.buildNodeSource)('lambda-layer', id, { dir: 'nodejs' });
15
+ console.log('Build Duration (ms)', done());
16
+ super(stack, stack.genId(id), {
17
+ ...props,
18
+ layerVersionName: stack.genName(id),
19
+ code: aws_lambda_1.Code.fromAsset(buildDir)
20
+ });
21
+ stack.set('lambda-layer', id, this);
22
+ }
23
+ }
24
+ exports.NodeJsLambdaLayer = NodeJsLambdaLayer;
package/lib/index.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  export { ApiCertificate } from "./ApiCertificate";
2
+ export { CognitoApiGatewayAuthorizer } from "./CognitoApiGatewayAuthorizer";
2
3
  export { DeployStack } from "./DeployStack";
3
- export { IDomainConfig } from "./IDomainConfig";
4
+ export { DynamoDbTable } from "./DynamoDbTable";
5
+ export { FunctionIntegration } from "./FunctionIntegration";
4
6
  export { IHostedZoneConfig } from "./IHostedZoneConfig";
7
+ export { IDomainConfig } from "./IDomainConfig";
5
8
  export { IStackArguments } from "./IStackArguments";
6
- export { Role } from "./Role";
7
- export { StaticWebSite } from "./StaticWebSite";
9
+ export { NodeJsLambda } from "./NodeJsLambda";
10
+ export { NodeJsLambdaLayer } from "./NodeJsLambdaLayer";
8
11
  export { Output } from "./Output";
9
12
  export { RestApi } from "./RestApi";
10
- export { NodeJsLambda } from "./NodeJsLambda";
11
- export { DynamoDbTable } from "./DynamoDbTable";
12
- export { FunctionIntegration } from "./FunctionIntegration";
13
+ export { Role } from "./Role";
14
+ export { SsmParameter } from "./SsmParameter";
15
+ export { StaticWebSite } from "./StaticWebSite";
package/lib/index.js CHANGED
@@ -1,21 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FunctionIntegration = exports.DynamoDbTable = exports.NodeJsLambda = exports.RestApi = exports.Output = exports.StaticWebSite = exports.Role = exports.DeployStack = exports.ApiCertificate = void 0;
3
+ exports.StaticWebSite = exports.SsmParameter = exports.Role = exports.RestApi = exports.Output = exports.NodeJsLambdaLayer = exports.NodeJsLambda = exports.FunctionIntegration = exports.DynamoDbTable = exports.DeployStack = exports.CognitoApiGatewayAuthorizer = exports.ApiCertificate = void 0;
4
4
  var ApiCertificate_1 = require("./ApiCertificate");
5
5
  Object.defineProperty(exports, "ApiCertificate", { enumerable: true, get: function () { return ApiCertificate_1.ApiCertificate; } });
6
+ var CognitoApiGatewayAuthorizer_1 = require("./CognitoApiGatewayAuthorizer");
7
+ Object.defineProperty(exports, "CognitoApiGatewayAuthorizer", { enumerable: true, get: function () { return CognitoApiGatewayAuthorizer_1.CognitoApiGatewayAuthorizer; } });
6
8
  var DeployStack_1 = require("./DeployStack");
7
9
  Object.defineProperty(exports, "DeployStack", { enumerable: true, get: function () { return DeployStack_1.DeployStack; } });
8
- var Role_1 = require("./Role");
9
- Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return Role_1.Role; } });
10
- var StaticWebSite_1 = require("./StaticWebSite");
11
- Object.defineProperty(exports, "StaticWebSite", { enumerable: true, get: function () { return StaticWebSite_1.StaticWebSite; } });
12
- var Output_1 = require("./Output");
13
- Object.defineProperty(exports, "Output", { enumerable: true, get: function () { return Output_1.Output; } });
14
- var RestApi_1 = require("./RestApi");
15
- Object.defineProperty(exports, "RestApi", { enumerable: true, get: function () { return RestApi_1.RestApi; } });
16
- var NodeJsLambda_1 = require("./NodeJsLambda");
17
- Object.defineProperty(exports, "NodeJsLambda", { enumerable: true, get: function () { return NodeJsLambda_1.NodeJsLambda; } });
18
10
  var DynamoDbTable_1 = require("./DynamoDbTable");
19
11
  Object.defineProperty(exports, "DynamoDbTable", { enumerable: true, get: function () { return DynamoDbTable_1.DynamoDbTable; } });
20
12
  var FunctionIntegration_1 = require("./FunctionIntegration");
21
13
  Object.defineProperty(exports, "FunctionIntegration", { enumerable: true, get: function () { return FunctionIntegration_1.FunctionIntegration; } });
14
+ var NodeJsLambda_1 = require("./NodeJsLambda");
15
+ Object.defineProperty(exports, "NodeJsLambda", { enumerable: true, get: function () { return NodeJsLambda_1.NodeJsLambda; } });
16
+ var NodeJsLambdaLayer_1 = require("./NodeJsLambdaLayer");
17
+ Object.defineProperty(exports, "NodeJsLambdaLayer", { enumerable: true, get: function () { return NodeJsLambdaLayer_1.NodeJsLambdaLayer; } });
18
+ var Output_1 = require("./Output");
19
+ Object.defineProperty(exports, "Output", { enumerable: true, get: function () { return Output_1.Output; } });
20
+ var RestApi_1 = require("./RestApi");
21
+ Object.defineProperty(exports, "RestApi", { enumerable: true, get: function () { return RestApi_1.RestApi; } });
22
+ var Role_1 = require("./Role");
23
+ Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return Role_1.Role; } });
24
+ var SsmParameter_1 = require("./SsmParameter");
25
+ Object.defineProperty(exports, "SsmParameter", { enumerable: true, get: function () { return SsmParameter_1.SsmParameter; } });
26
+ var StaticWebSite_1 = require("./StaticWebSite");
27
+ Object.defineProperty(exports, "StaticWebSite", { enumerable: true, get: function () { return StaticWebSite_1.StaticWebSite; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byaga/cdk-patterns",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Collection of common patterns used when making AWS CloudFormation templates using CDK",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -15,14 +15,14 @@
15
15
  "author": "VeryFineHat",
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
- "@types/fs-extra": "^11.0.2",
19
- "aws-cdk": "^2.92.0",
20
- "aws-cdk-lib": "^2.92.0",
21
- "constructs": "^10.2.69",
18
+ "@types/fs-extra": "^11.0.3",
19
+ "aws-cdk": "^2.103.1",
20
+ "aws-cdk-lib": "^2.103.1",
21
+ "constructs": "^10.3.0",
22
22
  "fs-extra": "^11.1.1"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/node": "^20.5.0",
26
- "typescript": "^5.1.6"
25
+ "@types/node": "^20.8.9",
26
+ "typescript": "^5.2.2"
27
27
  }
28
28
  }
@@ -1,5 +1,5 @@
1
1
  import {Code, LayerVersion, Runtime} from "aws-cdk-lib/aws-lambda";
2
- import {IDeployStack} from "./IDeployStack";
2
+ import {DeployStack} from "./DeployStack";
3
3
  import {LayerVersionOptions} from "aws-cdk-lib/aws-lambda/lib/layers";
4
4
  import {Architecture} from "aws-cdk-lib/aws-lambda/lib/architecture";
5
5
  import {buildNodeSource} from "./methods/build-node-source";
@@ -11,10 +11,10 @@ interface NodeJsLambdaLayerProps extends LayerVersionOptions {
11
11
  }
12
12
 
13
13
  export class NodeJsLambdaLayer extends LayerVersion {
14
- constructor(stack: IDeployStack, id: string, props: NodeJsLambdaLayerProps = {}) {
14
+ constructor(stack: DeployStack, id: string, props: NodeJsLambdaLayerProps = {}) {
15
15
  console.log("Building Lambda Layer", id);
16
16
  const done = duration()
17
- const buildDir = buildNodeSource('lambda-layer', id, 'nodejs')
17
+ const {buildDir} = buildNodeSource('lambda-layer', id, {dir:'nodejs'})
18
18
  console.log('Build Duration (ms)', done())
19
19
 
20
20
  super(stack, stack.genId(id), {
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export {ApiCertificate} from "./ApiCertificate";
2
+ export {CognitoApiGatewayAuthorizer} from "./CognitoApiGatewayAuthorizer";
2
3
  export {DeployStack} from "./DeployStack";
3
4
  export {DynamoDbTable} from "./DynamoDbTable";
4
5
  export {FunctionIntegration} from "./FunctionIntegration";