From 3f7321538655b17b380fc6f03bd5085b44e6ba32 Mon Sep 17 00:00:00 2001 From: Simon Thulbourn Date: Wed, 24 May 2023 11:04:21 +0000 Subject: [PATCH 1/3] chore: change references to Powertools for AWS Lambda --- .projenrc.js | 2 +- API.md | 6 +++--- README.md | 6 +++--- package.json | 2 +- src/lambda-powertools-layer.ts | 6 +++--- test/lambda-powertools-python-layer.test.ts | 2 +- test/lambda-powertools-typescript-layer.test.ts | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.projenrc.js b/.projenrc.js index 2f9bd94..07cfd91 100644 --- a/.projenrc.js +++ b/.projenrc.js @@ -10,7 +10,7 @@ const project = new awscdk.AwsCdkConstructLibrary({ majorVersion: 3, name: 'cdk-aws-lambda-powertools-layer', repositoryUrl: 'https://github.com/awslabs/cdk-aws-lambda-powertools-layer.git', - description: 'A lambda layer for AWS Powertools for python and typescript', + description: 'Powertools for AWS Lambda layer for python and typescript', devDeps: [ '@types/prettier@2.6.0', // pin until breaking changes is resolved: https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60310 ], diff --git a/API.md b/API.md index 2e26260..634be4f 100644 --- a/API.md +++ b/API.md @@ -4,7 +4,7 @@ ### LambdaPowertoolsLayer -Defines a new Lambda Layer with Powertools for python library. +Defines a new Lambda Layer containing Powertools for AWS Lambda. #### Initializers @@ -81,7 +81,7 @@ LambdaPowertoolsLayer.constructBuildArgs(runtimeFamily: RuntimeFamily, includeEx ### PowertoolsLayerProps -Properties for Powertools layer for python. +Properties for the layer. #### Initializer @@ -159,7 +159,7 @@ public readonly version: string; - *Type:* `string` -The powertools package version from pypi repository. +The package version from pypi repository. --- diff --git a/README.md b/README.md index 2deb046..3e44ecf 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# AWS Lambda powertools layer +# Powertools for AWS Lambda Layer ## Why this project exists -This is a custom construct that will create AWS Lambda Layer with AWS Powertools for Python or NodeJS library. There are different +This is a custom construct that will create AWS Lambda Layer with Powertools for AWS Lambda for Python or NodeJS library. There are different ways how to create a layer and when working with CDK you need to install the library, create a zip file and wire it correctly. With this construct you don't have to care about packaging and dependency management. Create a construct and add it to your function. The construct is an extension of the @@ -49,7 +49,7 @@ pip install cdk-aws-lambda-powertools-layer ### Python -A single line will create a layer with powertools for python. For NodeJS you need to specifically set the `runtimeFamily: Runtime.NODEJS` property. +A single line will create a layer with Powertools for AWS Lambda (Python). For NodeJS you need to specifically set the `runtimeFamily: Runtime.NODEJS` property. ```python from cdk_aws_lambda_powertools_layer import LambdaPowertoolsLayer diff --git a/package.json b/package.json index cb9a330..985c24a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cdk-aws-lambda-powertools-layer", - "description": "A lambda layer for AWS Powertools for python and typescript", + "description": "Creates Powertools for AWS Lambda layers with python and typescript", "repository": { "type": "git", "url": "https://github.com/awslabs/cdk-aws-lambda-powertools-layer.git" diff --git a/src/lambda-powertools-layer.ts b/src/lambda-powertools-layer.ts index 99ef2a2..623af76 100644 --- a/src/lambda-powertools-layer.ts +++ b/src/lambda-powertools-layer.ts @@ -4,11 +4,11 @@ import { Architecture } from 'aws-cdk-lib/aws-lambda'; import { Construct } from 'constructs'; /** - * Properties for Powertools layer for python. + * Properties for Powertools for AWS Lambda (Python) Layer. */ export interface PowertoolsLayerProps { /** - * The powertools package version from pypi repository. + * The Powertools for AWS Lambda package version from pypi repository. */ readonly version?: string; @@ -35,7 +35,7 @@ export interface PowertoolsLayerProps { } /** - * Defines a new Lambda Layer with Powertools for python library. + * Defines a new Lambda Layer with Powertools for AWS Lambda (Python) library. */ export class LambdaPowertoolsLayer extends lambda.LayerVersion { /** diff --git a/test/lambda-powertools-python-layer.test.ts b/test/lambda-powertools-python-layer.test.ts index 731e5fb..51f9b19 100644 --- a/test/lambda-powertools-python-layer.test.ts +++ b/test/lambda-powertools-python-layer.test.ts @@ -100,7 +100,7 @@ describe('with version configuration the construct', () => { }); Template.fromStack(stack).hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for Python [x86_64] with extra dependencies latest version', + Description: 'Powertools for AWS Lambda (Python) [x86_64] with extra dependencies latest version', }); }); }); diff --git a/test/lambda-powertools-typescript-layer.test.ts b/test/lambda-powertools-typescript-layer.test.ts index 30242f6..90f151b 100644 --- a/test/lambda-powertools-typescript-layer.test.ts +++ b/test/lambda-powertools-typescript-layer.test.ts @@ -12,7 +12,7 @@ describe('with minimal configuration the construct', () => { const template = Template.fromStack(stack); test('synthesizes successfully', () => { template.hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for TypeScript [x86_64] latest version', + Description: 'Powertools for AWS Lambda (TypeScript) [x86_64] latest version', }); }); From 4b94783a183d0568457fc1766dea72ac8d12da3b Mon Sep 17 00:00:00 2001 From: Alexander Melnyk Date: Wed, 24 May 2023 14:47:09 +0200 Subject: [PATCH 2/3] fix tests --- src/lambda-powertools-layer.ts | 2 +- test/lambda-powertools-python-layer.test.ts | 8 ++++---- test/lambda-powertools-typescript-layer.test.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lambda-powertools-layer.ts b/src/lambda-powertools-layer.ts index 623af76..1883b3e 100644 --- a/src/lambda-powertools-layer.ts +++ b/src/lambda-powertools-layer.ts @@ -99,7 +99,7 @@ export class LambdaPowertoolsLayer extends lambda.LayerVersion { layerVersionName: props?.layerVersionName ? props?.layerVersionName : undefined, license: 'MIT-0', compatibleRuntimes: getRuntimesFromRuntimeFamily(runtimeFamily), - description: `Lambda Powertools for ${languageName} [${compatibleArchitecturesDescription}]${ + description: `Powertools for AWS Lambda (${languageName}) [${compatibleArchitecturesDescription}]${ props?.includeExtras ? ' with extra dependencies' : '' } ${props?.version ? `version ${props?.version}` : 'latest version'}`.trim(), // Dear reader: I'm happy that you've stumbled upon this line too! You might wonder, why are we doing this and passing `undefined` when the list is empty? diff --git a/test/lambda-powertools-python-layer.test.ts b/test/lambda-powertools-python-layer.test.ts index 51f9b19..b6f95ed 100644 --- a/test/lambda-powertools-python-layer.test.ts +++ b/test/lambda-powertools-python-layer.test.ts @@ -10,7 +10,7 @@ describe('with no configuration the construct', () => { const template = Template.fromStack(stack); test('synthesizes successfully', () => { template.hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for Python [x86_64] latest version', + Description: 'Powertools for AWS Lambda (Python) [x86_64] latest version', }); }); @@ -41,7 +41,7 @@ describe('with arm64 architecture', () => { const template = Template.fromStack(stack); test('synthesizes successfully', () => { template.hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for Python [arm64] latest version', + Description: 'Powertools for AWS Lambda (Python) [arm64] latest version', CompatibleArchitectures: ['arm64'], }); }); @@ -69,7 +69,7 @@ describe('with version configuration the construct', () => { Template.fromStack(stack).hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for Python [x86_64] version 1.21.0', + Description: 'Powertools for AWS Lambda (Python) [x86_64] version 1.21.0', }); }); @@ -88,7 +88,7 @@ describe('with version configuration the construct', () => { }); Template.fromStack(stack).hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: 'Lambda Powertools for Python [x86_64] with extra dependencies version 1.22.0', + Description: 'Powertools for AWS Lambda (Python) [x86_64] with extra dependencies version 1.22.0', }); }); diff --git a/test/lambda-powertools-typescript-layer.test.ts b/test/lambda-powertools-typescript-layer.test.ts index 90f151b..b4b443b 100644 --- a/test/lambda-powertools-typescript-layer.test.ts +++ b/test/lambda-powertools-typescript-layer.test.ts @@ -58,7 +58,7 @@ describe('with version configuration the construct', () => { Template.fromStack(stack).hasResourceProperties('AWS::Lambda::LayerVersion', { - Description: `Lambda Powertools for TypeScript [x86_64] version ${version}`, + Description: `Powertools for AWS Lambda (TypeScript) [x86_64] version ${version}`, }); }); From e8183d00fc7da33750471feea1ab7881d37d38db Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 24 May 2023 12:57:43 +0000 Subject: [PATCH 3/3] chore: self mutation Signed-off-by: github-actions --- API.md | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/API.md b/API.md index 634be4f..d6a8d20 100644 --- a/API.md +++ b/API.md @@ -4,7 +4,7 @@ ### LambdaPowertoolsLayer -Defines a new Lambda Layer containing Powertools for AWS Lambda. +Defines a new Lambda Layer with Powertools for AWS Lambda (Python) library. #### Initializers @@ -81,7 +81,7 @@ LambdaPowertoolsLayer.constructBuildArgs(runtimeFamily: RuntimeFamily, includeEx ### PowertoolsLayerProps -Properties for the layer. +Properties for Powertools for AWS Lambda (Python) Layer. #### Initializer @@ -99,7 +99,7 @@ const powertoolsLayerProps: PowertoolsLayerProps = { ... } | [`includeExtras`](#cdkawslambdapowertoolslayerpowertoolslayerpropspropertyincludeextras) | `boolean` | A flag for the extras dependencies (pydantic, aws-xray-sdk, etc.) This will increase the size of the layer significantly. If you don't use parsing, ignore it. | | [`layerVersionName`](#cdkawslambdapowertoolslayerpowertoolslayerpropspropertylayerversionname) | `string` | the name of the layer, will be randomised if empty. | | [`runtimeFamily`](#cdkawslambdapowertoolslayerpowertoolslayerpropspropertyruntimefamily) | [`aws-cdk-lib.aws_lambda.RuntimeFamily`](#aws-cdk-lib.aws_lambda.RuntimeFamily) | the runtime of the layer. | -| [`version`](#cdkawslambdapowertoolslayerpowertoolslayerpropspropertyversion) | `string` | The powertools package version from pypi repository. | +| [`version`](#cdkawslambdapowertoolslayerpowertoolslayerpropspropertyversion) | `string` | The Powertools for AWS Lambda package version from pypi repository. | --- @@ -159,7 +159,7 @@ public readonly version: string; - *Type:* `string` -The package version from pypi repository. +The Powertools for AWS Lambda package version from pypi repository. --- diff --git a/package.json b/package.json index 985c24a..813f65c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cdk-aws-lambda-powertools-layer", - "description": "Creates Powertools for AWS Lambda layers with python and typescript", + "description": "Powertools for AWS Lambda layer for python and typescript", "repository": { "type": "git", "url": "https://github.com/awslabs/cdk-aws-lambda-powertools-layer.git"