cdk-aws-lambda-powertools-blueprint 0.1.1 → 1.0.0

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.
package/.jsii CHANGED
@@ -8508,7 +8508,7 @@
8508
8508
  },
8509
8509
  "description": "AWS CDK Blueprint to add AWS Lambda Powertools configuration to Lambda Functions.",
8510
8510
  "docs": {
8511
- "stability": "experimental"
8511
+ "stability": "stable"
8512
8512
  },
8513
8513
  "homepage": "git+https://github.com/Tohaker/cdk-aws-lambda-powertools-blueprint.git",
8514
8514
  "jsiiVersion": "5.9.29",
@@ -8529,7 +8529,7 @@
8529
8529
  },
8530
8530
  "name": "cdk-aws-lambda-powertools-blueprint",
8531
8531
  "readme": {
8532
- "markdown": "# CDK AWS Lambda Powertools Blueprint\n\nThis [Blueprint](https://docs.aws.amazon.com/cdk/v2/guide/blueprints.html) enables Function constructs defined in your Stack to have all the necessary properties configured to take advantage of [Powertools for AWS Lambda](https://docs.aws.amazon.com/powertools/).\n\n## Benefits\n\nIncluding the `PowertoolsFunctionDefaults` in your property injectors will apply the following defaults to all Functions in your Stacks.\n\n- The official [Powertools Lambda Layer](https://docs.aws.amazon.com/powertools/typescript/latest/getting-started/lambda-layers/) (only on NodeJS and Python runtimes).\n- The POWERTOOLS_SERVICE_NAME environment variable automatically set to the provided `functionName`.\n\n## Usage\n\nDifferent Lambda Function runtimes will take advantage of different behaviour, demonstrated in each section.\n\n### NodeJS Functions\n\nBoth `Function` and `NodejsFunction` constructs are supported with the `NODEJS` Runtime Family. If you opt to use the latter, you will also benefit from the `bundling` props being updated to exclude the `@aws-lambda-powertools/*` modules from the final bundle. This will have the benefit of reducing the final bundle size, which can lead to performance improvements.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Runtime } from \"aws-cdk-lib/aws-lambda\";\nimport { NodejsFunction } from \"aws-cdk-lib/aws-lambda-nodejs\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new NodejsFunction(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.NODEJS_22_X,\n});\n```\n\nYou can also select a specific Powertools version if you don't want to use the `latest` version of the Lambda Layer. For example;\n\n```ts\nimport { App } from \"aws-cdk-lib\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [\n new PowertoolsFunctionDefaults({\n powertoolsVersion: \"2.30.0\",\n }),\n ],\n});\n```\n\n### Python Functions\n\nAll `Function` constructs with the `PYTHON` Runtime Family will have the latest [Lambda Layer](https://docs.aws.amazon.com/powertools/python/latest/getting-started/install/#lambda-layer) appropriate to the configured architecture applied. If no `architecture` is applied, the function will fall back to `x86_64` architecture and a warning will be added to your stack annotations.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Function, Runtime } from \"aws-cdk-lib/aws-lambda\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new Function(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.PYTHON_3_13,\n});\n```\n\n### All other runtimes\n\nEvery Function runtime is supported, but at the time of writing no others have a Lambda Layer to apply to the function. As a result, only the POWERTOOLS_SERVICE_NAME environment variable will be added to any function that is configured with a different runtime than NodeJS or Python.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Function, Runtime } from \"aws-cdk-lib/aws-lambda\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new Function(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.JAVA_21,\n});\n```\n\n## Development\n\nIf you wish to contribute to this project, please follow the [Contribution guidelines](./CONTRIBUTING.md).\n\nInstall dependencies\n\n```sh\nnpm install\n```\n\nBuild the package\n\n```sh\nnpm run build\n```\n\nRun unit tests\n\n```sh\nnpm run test\n```\n\nRun linting checks and fix linting issues\n\n```sh\nnpm run lint\nnpm run lint:fix\n```\n"
8532
+ "markdown": "# CDK AWS Lambda Powertools Blueprint\n\nThis [Blueprint](https://docs.aws.amazon.com/cdk/v2/guide/blueprints.html) enables Function constructs defined in your Stack to have all the necessary properties configured to take advantage of [Powertools for AWS Lambda](https://docs.aws.amazon.com/powertools/).\n\n## Benefits\n\nIncluding the `PowertoolsFunctionDefaults` in your property injectors will apply the following defaults to all Functions in your Stacks.\n\n- The official [Powertools Lambda Layer](https://docs.aws.amazon.com/powertools/typescript/latest/getting-started/lambda-layers/) (only on NodeJS and Python runtimes).\n- The POWERTOOLS_SERVICE_NAME environment variable automatically set to the provided `functionName`.\n\n## Usage\n\nDifferent Lambda Function runtimes will take advantage of different behaviour, demonstrated in each section.\n\nIn general, you will just need to add `PowertoolsFunctionDefaults` to your `propertyInjectors`.\nYou can add it to the `App` instance to cover all your stacks;\n\n```ts\nimport { App } from \"aws-cdk-lib\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n```\n\nOr you can add it to individual `Stack` instances for more granular control;\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { MyStack } from \"../lib/myStack.ts\";\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App();\n\nconst stack = new MyStack(app, \"MyStack\", {\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n```\n\n### NodeJS Functions\n\nBoth `Function` and `NodejsFunction` constructs are supported with the `NODEJS` Runtime Family. If you opt to use the latter, you will also benefit from the `bundling` props being updated to exclude the `@aws-lambda-powertools/*` modules from the final bundle. This will have the benefit of reducing the final bundle size, which can lead to performance improvements.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Runtime } from \"aws-cdk-lib/aws-lambda\";\nimport { NodejsFunction } from \"aws-cdk-lib/aws-lambda-nodejs\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new NodejsFunction(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.NODEJS_22_X,\n});\n```\n\nYou can also select a specific Powertools version if you don't want to use the `latest` version of the Lambda Layer. For example;\n\n```ts\nimport { App } from \"aws-cdk-lib\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [\n new PowertoolsFunctionDefaults({\n powertoolsVersion: \"2.30.0\",\n }),\n ],\n});\n```\n\n### Python Functions\n\nAll `Function` constructs with the `PYTHON` Runtime Family will have the latest [Lambda Layer](https://docs.aws.amazon.com/powertools/python/latest/getting-started/install/#lambda-layer) appropriate to the configured architecture applied. If no `architecture` is applied, the function will fall back to `x86_64` architecture and a warning will be added to your stack annotations.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Function, Runtime } from \"aws-cdk-lib/aws-lambda\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new Function(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.PYTHON_3_13,\n});\n```\n\n### All other runtimes\n\nEvery Function runtime is supported, but at the time of writing no others have a Lambda Layer to apply to the function. As a result, only the POWERTOOLS_SERVICE_NAME environment variable will be added to any function that is configured with a different runtime than NodeJS or Python.\n\n```ts\nimport { App } from \"aws-cdk-lib\";\nimport { Function, Runtime } from \"aws-cdk-lib/aws-lambda\";\n\nimport { PowertoolsFunctionDefaults } from \"cdk-aws-lambda-powertools-blueprint\";\n\nconst app = new App({\n propertyInjectors: [new PowertoolsFunctionDefaults()],\n});\n\nconst stack = new Stack(app, \"MyStack\");\n\nconst fn = new Function(stack, \"MyFunction\", {\n functionName: \"service-my-function\",\n runtime: Runtime.JAVA_21,\n});\n```\n\n## Development\n\nIf you wish to contribute to this project, please follow the [Contribution guidelines](./CONTRIBUTING.md).\n\nInstall dependencies\n\n```sh\nnpm install\n```\n\nBuild the package\n\n```sh\nnpm run build\n```\n\nRun unit tests\n\n```sh\nnpm run test\n```\n\nRun linting checks and fix linting issues\n\n```sh\nnpm run lint\nnpm run lint:fix\n```\n"
8533
8533
  },
8534
8534
  "repository": {
8535
8535
  "type": "git",
@@ -8547,13 +8547,13 @@
8547
8547
  "docs": {
8548
8548
  "remarks": "- If not provided, the POWERTOOLS_SERVICE_NAME environment variable is\n set to the `functionName` provided to the function props. If no\n `functionName` is set, `service_undefined` is set instead (as per the [Powertools defaults](https://docs.aws.amazon.com/powertools/typescript/latest/features/logger/#utility-settings))\n\nFor NodeJS and Python Functions, also applies the official Lambda Layer\nfor the appropriate runtime and architecture.\n\nNodeJS Functions will also have the '@aws-lambda-powertools/*' modules\nexcluded from being bundled to minimise the bundle size.",
8549
8549
  "see": "https://docs.aws.amazon.com/powertools/",
8550
- "stability": "experimental",
8550
+ "stability": "stable",
8551
8551
  "summary": "Applies Powertools-specific defaults to Functions in your Stack."
8552
8552
  },
8553
8553
  "fqn": "cdk-aws-lambda-powertools-blueprint.PowertoolsFunctionDefaults",
8554
8554
  "initializer": {
8555
8555
  "docs": {
8556
- "stability": "experimental"
8556
+ "stability": "stable"
8557
8557
  },
8558
8558
  "locationInModule": {
8559
8559
  "filename": "lib/index.ts",
@@ -8580,7 +8580,7 @@
8580
8580
  "methods": [
8581
8581
  {
8582
8582
  "docs": {
8583
- "stability": "experimental",
8583
+ "stability": "stable",
8584
8584
  "summary": "The injector to be applied to the constructor properties of the Construct."
8585
8585
  },
8586
8586
  "locationInModule": {
@@ -8614,7 +8614,7 @@
8614
8614
  "properties": [
8615
8615
  {
8616
8616
  "docs": {
8617
- "stability": "experimental",
8617
+ "stability": "stable",
8618
8618
  "summary": "The unique Id of the Construct class."
8619
8619
  },
8620
8620
  "immutable": true,
@@ -8635,7 +8635,7 @@
8635
8635
  "assembly": "cdk-aws-lambda-powertools-blueprint",
8636
8636
  "datatype": true,
8637
8637
  "docs": {
8638
- "stability": "experimental"
8638
+ "stability": "stable"
8639
8639
  },
8640
8640
  "fqn": "cdk-aws-lambda-powertools-blueprint.PowertoolsFunctionDefaultsProps",
8641
8641
  "kind": "interface",
@@ -8650,7 +8650,7 @@
8650
8650
  "docs": {
8651
8651
  "default": "\"latest\"",
8652
8652
  "remarks": "Setting this field will only have an effect on NodeJS Functions.",
8653
- "stability": "experimental",
8653
+ "stability": "stable",
8654
8654
  "summary": "The Powertools package version to load into the Lambda. Only provide this value if you don't want the latest version."
8655
8655
  },
8656
8656
  "immutable": true,
@@ -8668,6 +8668,6 @@
8668
8668
  "symbolId": "lib/index:PowertoolsFunctionDefaultsProps"
8669
8669
  }
8670
8670
  },
8671
- "version": "0.1.1",
8672
- "fingerprint": "624anGJDYbzMWDIevAk6OnA4ieXsNF4je91klFewGgI="
8671
+ "version": "1.0.0",
8672
+ "fingerprint": "0+Yb7BVqFq0PvQQA5RwzrPsECHs9yT05vRCsCD36nq4="
8673
8673
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # cdk-aws-lambda-powertools-blueprint
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 6d47fd6: Adding documentation for first major release
8
+
3
9
  ## 0.1.1
4
10
 
5
11
  ### Patch Changes
package/CONTRIBUTING.md CHANGED
@@ -68,6 +68,7 @@ Install dependencies
68
68
  - `npm run build`
69
69
  5. Update relevant documentation
70
70
  6. Create the commit with relevant files
71
+ 7. Create a changeset with `npm run changeset` and commit the generated file
71
72
 
72
73
  ### Step 5: Make the pull request
73
74
 
package/README.md CHANGED
@@ -13,6 +13,33 @@ Including the `PowertoolsFunctionDefaults` in your property injectors will apply
13
13
 
14
14
  Different Lambda Function runtimes will take advantage of different behaviour, demonstrated in each section.
15
15
 
16
+ In general, you will just need to add `PowertoolsFunctionDefaults` to your `propertyInjectors`.
17
+ You can add it to the `App` instance to cover all your stacks;
18
+
19
+ ```ts
20
+ import { App } from "aws-cdk-lib";
21
+
22
+ import { PowertoolsFunctionDefaults } from "cdk-aws-lambda-powertools-blueprint";
23
+
24
+ const app = new App({
25
+ propertyInjectors: [new PowertoolsFunctionDefaults()],
26
+ });
27
+ ```
28
+
29
+ Or you can add it to individual `Stack` instances for more granular control;
30
+
31
+ ```ts
32
+ import { App } from "aws-cdk-lib";
33
+ import { MyStack } from "../lib/myStack.ts";
34
+ import { PowertoolsFunctionDefaults } from "cdk-aws-lambda-powertools-blueprint";
35
+
36
+ const app = new App();
37
+
38
+ const stack = new MyStack(app, "MyStack", {
39
+ propertyInjectors: [new PowertoolsFunctionDefaults()],
40
+ });
41
+ ```
42
+
16
43
  ### NodeJS Functions
17
44
 
18
45
  Both `Function` and `NodejsFunction` constructs are supported with the `NODEJS` Runtime Family. If you opt to use the latter, you will also benefit from the `bundling` props being updated to exclude the `@aws-lambda-powertools/*` modules from the final bundle. This will have the benefit of reducing the final bundle size, which can lead to performance improvements.
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ const aws_ssm_1 = require("aws-cdk-lib/aws-ssm");
22
22
  * @see https://docs.aws.amazon.com/powertools/
23
23
  */
24
24
  class PowertoolsFunctionDefaults {
25
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-aws-lambda-powertools-blueprint.PowertoolsFunctionDefaults", version: "0.1.1" };
25
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk-aws-lambda-powertools-blueprint.PowertoolsFunctionDefaults", version: "1.0.0" };
26
26
  constructUniqueId;
27
27
  powertoolsVersion;
28
28
  constructor(props) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdk-aws-lambda-powertools-blueprint",
3
3
  "description": "AWS CDK Blueprint to add AWS Lambda Powertools configuration to Lambda Functions.",
4
- "version": "0.1.1",
4
+ "version": "1.0.0",
5
5
  "author": {
6
6
  "name": "Miles Bardon",
7
7
  "email": "milesbardon@gmail.com"
@@ -10,6 +10,9 @@
10
10
  "url": "git+https://github.com/Tohaker/cdk-aws-lambda-powertools-blueprint.git",
11
11
  "type": "git"
12
12
  },
13
+ "bugs": {
14
+ "url": "https://github.com/Tohaker/cdk-aws-lambda-powertools-blueprint/issues"
15
+ },
13
16
  "license": "MIT",
14
17
  "keywords": [
15
18
  "awscdk",
@@ -47,7 +50,7 @@
47
50
  "aws-cdk-lib": "^2.196.0",
48
51
  "constructs": "^10.0.0"
49
52
  },
50
- "stability": "experimental",
53
+ "stability": "stable",
51
54
  "jsii": {
52
55
  "targets": {},
53
56
  "outdir": "./dist",