@aws-cdk/aws-lambda-python-alpha 2.2.0-alpha.0 → 2.6.0-alpha.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/.warnings.jsii.js CHANGED
@@ -2,20 +2,12 @@ function _aws_cdk_aws_lambda_python_alpha_PythonFunction(p) {
2
2
  }
3
3
  function _aws_cdk_aws_lambda_python_alpha_PythonLayerVersion(p) {
4
4
  }
5
- function _aws_cdk_aws_lambda_python_alpha_PythonLayerVersionProps(p) {
6
- if (p == null)
7
- return;
8
- visitedObjects.add(p);
9
- if (!visitedObjects.has(p.compatibleArchitectures))
10
- require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_lambda_Architecture(p.compatibleArchitectures);
11
- if (!visitedObjects.has(p.compatibleRuntimes))
12
- require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_lambda_Runtime(p.compatibleRuntimes);
13
- visitedObjects.delete(p);
14
- }
15
5
  function _aws_cdk_aws_lambda_python_alpha_PythonFunctionProps(p) {
16
6
  if (p == null)
17
7
  return;
18
8
  visitedObjects.add(p);
9
+ if (!visitedObjects.has(p.bundling))
10
+ _aws_cdk_aws_lambda_python_alpha_BundlingOptions(p.bundling);
19
11
  if (!visitedObjects.has(p.events))
20
12
  require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_lambda_IEventSource(p.events);
21
13
  if (!visitedObjects.has(p.initialPolicy))
@@ -26,6 +18,20 @@ function _aws_cdk_aws_lambda_python_alpha_PythonFunctionProps(p) {
26
18
  require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_ec2_ISecurityGroup(p.securityGroups);
27
19
  visitedObjects.delete(p);
28
20
  }
21
+ function _aws_cdk_aws_lambda_python_alpha_PythonLayerVersionProps(p) {
22
+ if (p == null)
23
+ return;
24
+ visitedObjects.add(p);
25
+ if (!visitedObjects.has(p.bundling))
26
+ _aws_cdk_aws_lambda_python_alpha_BundlingOptions(p.bundling);
27
+ if (!visitedObjects.has(p.compatibleArchitectures))
28
+ require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_lambda_Architecture(p.compatibleArchitectures);
29
+ if (!visitedObjects.has(p.compatibleRuntimes))
30
+ require("aws-cdk-lib/.warnings.jsii.js").aws_cdk_lib_aws_lambda_Runtime(p.compatibleRuntimes);
31
+ visitedObjects.delete(p);
32
+ }
33
+ function _aws_cdk_aws_lambda_python_alpha_BundlingOptions(p) {
34
+ }
29
35
  function print(name, deprecationMessage) {
30
36
  const deprecated = process.env.JSII_DEPRECATED;
31
37
  const deprecationMode = ["warn", "fail", "quiet"].includes(deprecated) ? deprecated : "warn";
@@ -41,5 +47,5 @@ function print(name, deprecationMessage) {
41
47
  const visitedObjects = new Set();
42
48
  class DeprecationError extends Error {
43
49
  }
44
- module.exports = { print, _aws_cdk_aws_lambda_python_alpha_PythonFunction, _aws_cdk_aws_lambda_python_alpha_PythonLayerVersion, _aws_cdk_aws_lambda_python_alpha_PythonLayerVersionProps, _aws_cdk_aws_lambda_python_alpha_PythonFunctionProps };
50
+ module.exports = { print, _aws_cdk_aws_lambda_python_alpha_PythonFunction, _aws_cdk_aws_lambda_python_alpha_PythonLayerVersion, _aws_cdk_aws_lambda_python_alpha_PythonFunctionProps, _aws_cdk_aws_lambda_python_alpha_PythonLayerVersionProps, _aws_cdk_aws_lambda_python_alpha_BundlingOptions };
45
51
  module.exports.DeprecationError = DeprecationError;
package/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
189
+ Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/NOTICE CHANGED
@@ -1,2 +1,2 @@
1
1
  AWS Cloud Development Kit (AWS CDK)
2
- Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
package/README.md CHANGED
@@ -27,29 +27,61 @@ Define a `PythonFunction`:
27
27
  ```ts
28
28
  new lambda.PythonFunction(this, 'MyFunction', {
29
29
  entry: '/path/to/my/function', // required
30
+ runtime: Runtime.PYTHON_3_8, // required
30
31
  index: 'my_index.py', // optional, defaults to 'index.py'
31
32
  handler: 'my_exported_func', // optional, defaults to 'handler'
32
- runtime: Runtime.PYTHON_3_6, // optional, defaults to lambda.Runtime.PYTHON_3_7
33
33
  });
34
34
  ```
35
35
 
36
36
  All other properties of `lambda.Function` are supported, see also the [AWS Lambda construct library](https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-lambda).
37
37
 
38
- ## Module Dependencies
38
+ ## Python Layer
39
39
 
40
- If `requirements.txt` or `Pipfile` exists at the entry path, the construct will handle installing
41
- all required modules in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-python3.7)
42
- according to the `runtime` and with the Docker platform based on the target architecture of the Lambda function.
40
+ You may create a python-based lambda layer with `PythonLayerVersion`. If `PythonLayerVersion` detects a `requirements.txt`
41
+ or `Pipfile` or `poetry.lock` with the associated `pyproject.toml` at the entry path, then `PythonLayerVersion` will include the dependencies inline with your code in the
42
+ layer.
43
+
44
+ Define a `PythonLayerVersion`:
45
+
46
+ ```ts
47
+ new lambda.PythonLayerVersion(this, 'MyLayer', {
48
+ entry: '/path/to/my/layer', // point this to your library's directory
49
+ })
50
+ ```
51
+
52
+ A layer can also be used as a part of a `PythonFunction`:
53
+
54
+ ```ts
55
+ new lambda.PythonFunction(this, 'MyFunction', {
56
+ entry: '/path/to/my/function',
57
+ runtime: Runtime.PYTHON_3_8,
58
+ layers: [
59
+ new lambda.PythonLayerVersion(this, 'MyLayer', {
60
+ entry: '/path/to/my/layer', // point this to your library's directory
61
+ }),
62
+ ],
63
+ });
64
+ ```
65
+
66
+ ## Packaging
67
+
68
+ If `requirements.txt`, `Pipfile` or `poetry.lock` exists at the entry path, the construct will handle installing all required modules in a [Lambda compatible Docker container](https://gallery.ecr.aws/sam/build-python3.7) according to the `runtime` and with the Docker platform based on the target architecture of the Lambda function.
43
69
 
44
70
  Python bundles are only recreated and published when a file in a source directory has changed.
45
71
  Therefore (and as a general best-practice), it is highly recommended to commit a lockfile with a
46
- list of all transitive dependencies and their exact versions.
47
- This will ensure that when any dependency version is updated, the bundle asset is recreated and uploaded.
72
+ list of all transitive dependencies and their exact versions. This will ensure that when any dependency version is updated, the bundle asset is recreated and uploaded.
73
+
74
+ To that end, we recommend using [`pipenv`] or [`poetry`] which have lockfile support.
75
+
76
+ - [`pipenv`](https://pipenv-fork.readthedocs.io/en/latest/basics.html#example-pipfile-lock)
77
+ - [`poetry`](https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control)
48
78
 
49
- To that end, we recommend using [`pipenv`] or [`poetry`] which has lockfile support.
79
+ Packaging is executed using the `Packaging` class, which:
50
80
 
51
- [`pipenv`]: https://pipenv-fork.readthedocs.io/en/latest/basics.html#example-pipfile-lock
52
- [`poetry`]: https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
81
+ 1. Infers the packaging type based on the files present.
82
+ 2. If it sees a `Pipfile` or a `poetry.lock` file, it exports it to a compatible `requirements.txt` file with credentials (if they're available in the source files or in the bundling container).
83
+ 3. Installs dependencies using `pip`.
84
+ 4. Copies the dependencies into an asset that is bundled for the Lambda package.
53
85
 
54
86
  **Lambda with a requirements.txt**
55
87
 
@@ -73,23 +105,71 @@ To that end, we recommend using [`pipenv`] or [`poetry`] which has lockfile supp
73
105
  ```plaintext
74
106
  .
75
107
  ├── lambda_function.py # exports a function named 'handler'
76
- ├── pyproject.toml # has to be present at the entry path
77
- ├── poetry.lock # your poetry lock file
108
+ ├── pyproject.toml # your poetry project definition
109
+ ├── poetry.lock # your poetry lock file has to be present at the entry path
78
110
  ```
79
111
 
80
- **Lambda Layer Support**
112
+ ## Custom Bundling
81
113
 
82
- You may create a python-based lambda layer with `PythonLayerVersion`. If `PythonLayerVersion` detects a `requirements.txt`
83
- or `Pipfile` or `poetry.lock` with the associated `pyproject.toml` at the entry path, then `PythonLayerVersion` will include the dependencies inline with your code in the
84
- layer.
114
+ Custom bundling can be performed by passing in additional build arguments that point to index URLs to private repos, or by using an entirely custom Docker images for bundling dependencies. The build args currently supported are:
115
+
116
+ - `PIP_INDEX_URL`
117
+ - `PIP_EXTRA_INDEX_URL`
118
+ - `HTTPS_PROXY`
119
+
120
+ Additional build args for bundling that refer to PyPI indexes can be specified as:
85
121
 
86
122
  ```ts
87
- new lambda.PythonFunction(this, 'MyFunction', {
88
- entry: '/path/to/my/function',
89
- layers: [
90
- new lambda.PythonLayerVersion(this, 'MyLayer', {
91
- entry: '/path/to/my/layer', // point this to your library's directory
92
- }),
93
- ],
123
+ const entry = '/path/to/function';
124
+ const image = DockerImage.fromBuild(entry);
125
+
126
+ new lambda.PythonFunction(this, 'function', {
127
+ entry,
128
+ runtime: Runtime.PYTHON_3_8,
129
+ bundling: {
130
+ buildArgs: { PIP_INDEX_URL: "https://your.index.url/simple/", PIP_EXTRA_INDEX_URL: "https://your.extra-index.url/simple/" },
131
+ },
94
132
  });
95
133
  ```
134
+
135
+ If using a custom Docker image for bundling, the dependencies are installed with `pip`, `pipenv` or `poetry` by using the `Packaging` class. A different bundling Docker image that is in the same directory as the function can be specified as:
136
+
137
+ ```ts
138
+ const entry = '/path/to/function';
139
+ const image = DockerImage.fromBuild(entry);
140
+
141
+ new lambda.PythonFunction(this, 'function', {
142
+ entry,
143
+ runtime: Runtime.PYTHON_3_8,
144
+ bundling: { image },
145
+ });
146
+ ```
147
+
148
+ ## Custom Bundling with Code Artifact
149
+
150
+ To use a Code Artifact PyPI repo, the `PIP_INDEX_URL` for bundling the function can be customized (requires AWS CLI in the build environment):
151
+
152
+ ```ts
153
+ import { execSync } from 'child_process';
154
+
155
+ const entry = '/path/to/function';
156
+ const image = DockerImage.fromBuild(entry);
157
+
158
+ const domain = 'my-domain';
159
+ const domainOwner = '111122223333';
160
+ const repoName = 'my_repo';
161
+ const region = 'us-east-1';
162
+ const codeArtifactAuthToken = execSync(`aws codeartifact get-authorization-token --domain ${domain} --domain-owner ${domainOwner} --query authorizationToken --output text`).toString().trim();
163
+
164
+ const indexUrl = `https://aws:${codeArtifactAuthToken}@${domain}-${domainOwner}.d.codeartifact.${region}.amazonaws.com/pypi/${repoName}/simple/`;
165
+
166
+ new lambda.PythonFunction(this, 'function', {
167
+ entry,
168
+ runtime: Runtime.PYTHON_3_8,
169
+ bundling: {
170
+ buildArgs: { PIP_INDEX_URL: indexUrl },
171
+ },
172
+ });
173
+ ```
174
+
175
+ This type of an example should work for `pip` and `poetry` based dependencies, but will not work for `pipenv`.
package/lib/Dockerfile CHANGED
@@ -3,7 +3,12 @@
3
3
  ARG IMAGE=public.ecr.aws/sam/build-python3.7
4
4
  FROM $IMAGE
5
5
 
6
- # Ensure rsync is installed
7
- RUN yum -q list installed rsync &>/dev/null || yum install -y rsync
6
+ ARG PIP_INDEX_URL
7
+ ARG PIP_EXTRA_INDEX_URL
8
+ ARG HTTPS_PROXY
9
+
10
+ # Upgrade pip (required by cryptography v3.4 and above, which is a dependency of poetry)
11
+ RUN pip install --upgrade pip
12
+ RUN pip install pipenv poetry
8
13
 
9
14
  CMD [ "python" ]
package/lib/bundling.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import * as cdk from 'aws-cdk-lib';
1
+ import { Architecture, AssetCode, Runtime } from 'aws-cdk-lib/aws-lambda';
2
+ import { BundlingOptions as CdkBundlingOptions, DockerImage } from 'aws-cdk-lib';
3
+ import { BundlingOptions } from './types';
3
4
  /**
4
5
  * Dependency files to exclude from the asset hash.
5
6
  */
@@ -11,68 +12,29 @@ export declare const BUNDLER_DEPENDENCIES_CACHE = "/var/dependencies";
11
12
  /**
12
13
  * Options for bundling
13
14
  */
14
- export interface BundlingOptions {
15
+ export interface BundlingProps extends BundlingOptions {
15
16
  /**
16
17
  * Entry path
17
18
  */
18
19
  readonly entry: string;
19
20
  /**
20
- * The runtime of the lambda function
21
+ * The runtime environment.
21
22
  */
22
- readonly runtime: lambda.Runtime;
23
+ readonly runtime: Runtime;
23
24
  /**
24
25
  * The system architecture of the lambda function
25
- */
26
- readonly architecture: lambda.Architecture;
27
- /**
28
- * Output path suffix ('python' for a layer, '.' otherwise)
29
- */
30
- readonly outputPathSuffix: string;
31
- /**
32
- * Determines how asset hash is calculated. Assets will get rebuild and
33
- * uploaded only if their hash has changed.
34
26
  *
35
- * If asset hash is set to `SOURCE` (default), then only changes to the source
36
- * directory will cause the asset to rebuild. This means, for example, that in
37
- * order to pick up a new dependency version, a change must be made to the
38
- * source tree. Ideally, this can be implemented by including a dependency
39
- * lockfile in your source tree or using fixed dependencies.
40
- *
41
- * If the asset hash is set to `OUTPUT`, the hash is calculated after
42
- * bundling. This means that any change in the output will cause the asset to
43
- * be invalidated and uploaded. Bear in mind that `pip` adds timestamps to
44
- * dependencies it installs, which implies that in this mode Python bundles
45
- * will _always_ get rebuild and uploaded. Normally this is an anti-pattern
46
- * since build
47
- *
48
- * @default AssetHashType.SOURCE By default, hash is calculated based on the
49
- * contents of the source directory. If `assetHash` is also specified, the
50
- * default is `CUSTOM`. This means that only updates to the source will cause
51
- * the asset to rebuild.
27
+ * @default Architecture.X86_64
52
28
  */
53
- readonly assetHashType?: cdk.AssetHashType;
54
- /**
55
- * Specify a custom hash for this asset. If `assetHashType` is set it must
56
- * be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will
57
- * be SHA256 hashed and encoded as hex. The resulting hash will be the asset
58
- * hash.
59
- *
60
- * NOTE: the hash is used in order to identify a specific revision of the asset, and
61
- * used for optimizing and caching deployment activities related to this asset such as
62
- * packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will
63
- * need to make sure it is updated every time the asset changes, or otherwise it is
64
- * possible that some deployments will not be invalidated.
65
- *
66
- * @default - based on `assetHashType`
67
- */
68
- readonly assetHash?: string;
29
+ readonly architecture?: Architecture;
69
30
  }
70
31
  /**
71
32
  * Produce bundled Lambda asset code
72
33
  */
73
- export declare function bundle(options: BundlingOptions): lambda.Code;
74
- /**
75
- * Checks to see if the `entry` directory contains a type of dependency that
76
- * we know how to install.
77
- */
78
- export declare function stageDependencies(entry: string, stagedir: string): boolean;
34
+ export declare class Bundling implements CdkBundlingOptions {
35
+ static bundle(options: BundlingProps): AssetCode;
36
+ readonly image: DockerImage;
37
+ readonly command: string[];
38
+ constructor(props: BundlingProps);
39
+ private createBundlingCommand;
40
+ }
package/lib/bundling.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stageDependencies = exports.bundle = exports.BUNDLER_DEPENDENCIES_CACHE = exports.DEPENDENCY_EXCLUDES = void 0;
4
- const fs = require("fs");
3
+ exports.Bundling = exports.BUNDLER_DEPENDENCIES_CACHE = exports.DEPENDENCY_EXCLUDES = void 0;
5
4
  const path = require("path");
6
- const lambda = require("aws-cdk-lib/aws-lambda");
7
- const cdk = require("aws-cdk-lib");
5
+ const aws_lambda_1 = require("aws-cdk-lib/aws-lambda");
6
+ const aws_cdk_lib_1 = require("aws-cdk-lib");
7
+ const packaging_1 = require("./packaging");
8
8
  /**
9
9
  * Dependency files to exclude from the asset hash.
10
10
  */
@@ -16,65 +16,51 @@ exports.BUNDLER_DEPENDENCIES_CACHE = '/var/dependencies';
16
16
  /**
17
17
  * Produce bundled Lambda asset code
18
18
  */
19
- function bundle(options) {
20
- const { entry, runtime, architecture, outputPathSuffix } = options;
21
- const stagedir = cdk.FileSystem.mkdtemp('python-bundling-');
22
- const hasDeps = stageDependencies(entry, stagedir);
23
- const depsCommand = chain([
24
- hasDeps ? `rsync -r ${exports.BUNDLER_DEPENDENCIES_CACHE}/. ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${outputPathSuffix}` : '',
25
- `rsync -r . ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${outputPathSuffix}`,
26
- ]);
27
- // Determine which dockerfile to use. When dependencies are present, we use a
28
- // Dockerfile that can create a cacheable layer. We can't use this Dockerfile
29
- // if there aren't dependencies or the Dockerfile will complain about missing
30
- // sources.
31
- const dockerfile = hasDeps
32
- ? 'Dockerfile.dependencies'
33
- : 'Dockerfile';
34
- // copy Dockerfile to workdir
35
- fs.copyFileSync(path.join(__dirname, dockerfile), path.join(stagedir, dockerfile));
36
- const image = cdk.DockerImage.fromBuild(stagedir, {
37
- buildArgs: {
38
- IMAGE: runtime.bundlingImage.image,
39
- },
40
- platform: architecture.dockerPlatform,
41
- file: dockerfile,
42
- });
43
- return lambda.Code.fromAsset(entry, {
44
- assetHashType: options.assetHashType,
45
- assetHash: options.assetHash,
46
- exclude: exports.DEPENDENCY_EXCLUDES,
47
- bundling: {
48
- image,
49
- command: ['bash', '-c', depsCommand],
50
- },
51
- });
52
- }
53
- exports.bundle = bundle;
54
- /**
55
- * Checks to see if the `entry` directory contains a type of dependency that
56
- * we know how to install.
57
- */
58
- function stageDependencies(entry, stagedir) {
59
- const prefixes = [
60
- 'Pipfile',
61
- 'pyproject',
62
- 'poetry',
63
- 'requirements.txt',
64
- ];
65
- let found = false;
66
- for (const file of fs.readdirSync(entry)) {
67
- for (const prefix of prefixes) {
68
- if (file.startsWith(prefix)) {
69
- fs.copyFileSync(path.join(entry, file), path.join(stagedir, file));
70
- found = true;
71
- }
19
+ class Bundling {
20
+ constructor(props) {
21
+ var _a;
22
+ const { entry, runtime, architecture = aws_lambda_1.Architecture.X86_64, outputPathSuffix = '', image, } = props;
23
+ const outputPath = path.join(aws_cdk_lib_1.AssetStaging.BUNDLING_OUTPUT_DIR, outputPathSuffix);
24
+ const bundlingCommands = this.createBundlingCommand({
25
+ entry,
26
+ inputDir: aws_cdk_lib_1.AssetStaging.BUNDLING_INPUT_DIR,
27
+ outputDir: outputPath,
28
+ });
29
+ const defaultImage = aws_cdk_lib_1.DockerImage.fromBuild(path.join(__dirname, '../lib'), {
30
+ buildArgs: {
31
+ ...(_a = props.buildArgs) !== null && _a !== void 0 ? _a : {},
32
+ IMAGE: runtime.bundlingImage.image,
33
+ },
34
+ platform: architecture.dockerPlatform,
35
+ });
36
+ this.image = image !== null && image !== void 0 ? image : defaultImage;
37
+ this.command = ['bash', '-c', chain(bundlingCommands)];
38
+ }
39
+ static bundle(options) {
40
+ return aws_lambda_1.Code.fromAsset(options.entry, {
41
+ assetHash: options.assetHash,
42
+ assetHashType: options.assetHashType,
43
+ exclude: exports.DEPENDENCY_EXCLUDES,
44
+ bundling: new Bundling(options),
45
+ });
46
+ }
47
+ createBundlingCommand(options) {
48
+ var _a;
49
+ const packaging = packaging_1.Packaging.fromEntry(options.entry);
50
+ let bundlingCommands = [];
51
+ bundlingCommands.push((_a = packaging.exportCommand) !== null && _a !== void 0 ? _a : '');
52
+ if (packaging.dependenciesFile) {
53
+ bundlingCommands.push(`python -m pip install -r ${packaging_1.DependenciesFile.PIP} -t ${options.outputDir}`);
72
54
  }
55
+ bundlingCommands.push(`cp -R ${options.inputDir}/ ${options.outputDir}`);
56
+ return bundlingCommands;
73
57
  }
74
- return found;
75
58
  }
76
- exports.stageDependencies = stageDependencies;
59
+ exports.Bundling = Bundling;
60
+ /**
61
+ * Chain commands
62
+ */
77
63
  function chain(commands) {
78
64
  return commands.filter(c => !!c).join(' && ');
79
65
  }
80
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVuZGxpbmcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJidW5kbGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5QkFBeUI7QUFDekIsNkJBQTZCO0FBQzdCLGlEQUFpRDtBQUNqRCxtQ0FBbUM7QUFFbkM7O0dBRUc7QUFDVSxRQUFBLG1C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1xuICAgIGxldCBidW5kbGluZ0NvbW1hbmRzOiBzdHJpbmdbXSA9IFtdO1xuICAgIGJ1bmRsaW5nQ29tbWFuZHMucHVzaChwYWNrYWdpbmcuZXhwb3J0Q29tbWFuZCA/PyAnJyk7XG4gICAgaWYgKHBhY2thZ2luZy5kZXBlbmRlbmNpZXNGaWxlKSB7XG4gICAgICBidW5kbGluZ0NvbW1hbmRzLnB1c2goYHB5dGhvbiAtbSBwaXAgaW5zdGFsbCAtciAke0RlcGVuZGVuY2llc0ZpbGUuUElQfSAtdCAke29wdGlvbnMub3V0cHV0RGlyfWApO1xuICAgIH1cbiAgICBidW5kbGluZ0NvbW1hbmRzLnB1c2goYGNwIC1SICR7b3B0aW9ucy5pbnB1dERpcn0vICR7b3B0aW9ucy5vdXRwdXREaXJ9YCk7XG4gICAgcmV0dXJuIGJ1bmRsaW5nQ29tbWFuZHM7XG4gIH1cbn1cblxuaW50ZXJmYWNlIEJ1bmRsaW5nQ29tbWFuZE9wdGlvbnMge1xuICByZWFkb25seSBlbnRyeTogc3RyaW5nO1xuICByZWFkb25seSBpbnB1dERpcjogc3RyaW5nO1xuICByZWFkb25seSBvdXRwdXREaXI6IHN0cmluZztcbn1cblxuLyoqXG4gKiBDaGFpbiBjb21tYW5kc1xuICovXG5mdW5jdGlvbiBjaGFpbihjb21tYW5kczogc3RyaW5nW10pOiBzdHJpbmcge1xuICByZXR1cm4gY29tbWFuZHMuZmlsdGVyKGMgPT4gISFjKS5qb2luKCcgJiYgJyk7XG59XG4iXX0=
package/lib/function.d.ts CHANGED
@@ -1,18 +1,28 @@
1
- import * as lambda from 'aws-cdk-lib/aws-lambda';
2
- import { AssetHashType } from 'aws-cdk-lib';
3
1
  import { Construct } from 'constructs';
2
+ import { Function, FunctionOptions, Runtime } from 'aws-cdk-lib/aws-lambda';
3
+ import { BundlingOptions } from './types';
4
4
  /**
5
5
  * (experimental) Properties for a PythonFunction.
6
6
  *
7
7
  * @experimental
8
8
  */
9
- export interface PythonFunctionProps extends lambda.FunctionOptions {
9
+ export interface PythonFunctionProps extends FunctionOptions {
10
10
  /**
11
- * (experimental) The path to the root directory of the function.
11
+ * (experimental) Path to the source of the function or the location for dependencies.
12
12
  *
13
13
  * @experimental
14
14
  */
15
15
  readonly entry: string;
16
+ /**
17
+ * (experimental) The runtime environment.
18
+ *
19
+ * Only runtimes of the Python family are
20
+ * supported.
21
+ *
22
+ * @default Runtime.PYTHON_3_7
23
+ * @experimental
24
+ */
25
+ readonly runtime: Runtime;
16
26
  /**
17
27
  * (experimental) The path (relative to entry) to the index file containing the exported handler.
18
28
  *
@@ -28,62 +38,22 @@ export interface PythonFunctionProps extends lambda.FunctionOptions {
28
38
  */
29
39
  readonly handler?: string;
30
40
  /**
31
- * (experimental) The runtime environment.
32
- *
33
- * Only runtimes of the Python family are
34
- * supported.
35
- *
36
- * @default lambda.Runtime.PYTHON_3_7
37
- * @experimental
38
- */
39
- readonly runtime?: lambda.Runtime;
40
- /**
41
- * (experimental) Determines how asset hash is calculated. Assets will get rebuild and uploaded only if their hash has changed.
42
- *
43
- * If asset hash is set to `SOURCE` (default), then only changes to the source
44
- * directory will cause the asset to rebuild. This means, for example, that in
45
- * order to pick up a new dependency version, a change must be made to the
46
- * source tree. Ideally, this can be implemented by including a dependency
47
- * lockfile in your source tree or using fixed dependencies.
48
- *
49
- * If the asset hash is set to `OUTPUT`, the hash is calculated after
50
- * bundling. This means that any change in the output will cause the asset to
51
- * be invalidated and uploaded. Bear in mind that `pip` adds timestamps to
52
- * dependencies it installs, which implies that in this mode Python bundles
53
- * will _always_ get rebuild and uploaded. Normally this is an anti-pattern
54
- * since build
55
- *
56
- * @default AssetHashType.SOURCE By default, hash is calculated based on the
57
- * contents of the source directory. This means that only updates to the
58
- * source will cause the asset to rebuild.
59
- * @experimental
60
- */
61
- readonly assetHashType?: AssetHashType;
62
- /**
63
- * (experimental) Specify a custom hash for this asset.
64
- *
65
- * If `assetHashType` is set it must
66
- * be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will
67
- * be SHA256 hashed and encoded as hex. The resulting hash will be the asset
68
- * hash.
41
+ * (experimental) Bundling options to use for this function.
69
42
  *
70
- * NOTE: the hash is used in order to identify a specific revision of the asset, and
71
- * used for optimizing and caching deployment activities related to this asset such as
72
- * packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will
73
- * need to make sure it is updated every time the asset changes, or otherwise it is
74
- * possible that some deployments will not be invalidated.
43
+ * Use this to specify custom bundling options like
44
+ * the bundling Docker image, asset hash type, custom hash, architecture, etc.
75
45
  *
76
- * @default - based on `assetHashType`
46
+ * @default - Use the default bundling Docker image, with x86_64 architecture.
77
47
  * @experimental
78
48
  */
79
- readonly assetHash?: string;
49
+ readonly bundling?: BundlingOptions;
80
50
  }
81
51
  /**
82
52
  * (experimental) A Python Lambda function.
83
53
  *
84
54
  * @experimental
85
55
  */
86
- export declare class PythonFunction extends lambda.Function {
56
+ export declare class PythonFunction extends Function {
87
57
  /**
88
58
  * @experimental
89
59
  */