@aws-sdk/client-lambda 3.52.0 → 3.54.1
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/CHANGELOG.md +28 -0
- package/dist-cjs/index.js +3 -0
- package/dist-cjs/models/LambdaServiceException.js +11 -0
- package/dist-cjs/models/models_0.js +508 -3
- package/dist-cjs/protocols/Aws_restJson1.js +778 -2631
- package/dist-cjs/waiters/index.js +2 -0
- package/dist-cjs/waiters/waitForFunctionActiveV2.js +54 -0
- package/dist-cjs/waiters/waitForFunctionUpdatedV2.js +54 -0
- package/dist-es/index.js +1 -0
- package/dist-es/models/LambdaServiceException.js +12 -0
- package/dist-es/models/models_0.js +471 -1
- package/dist-es/protocols/Aws_restJson1.js +1467 -2898
- package/dist-es/waiters/index.js +2 -0
- package/dist-es/waiters/waitForFunctionActiveV2.js +69 -0
- package/dist-es/waiters/waitForFunctionUpdatedV2.js +69 -0
- package/dist-types/Lambda.d.ts +14 -1
- package/dist-types/LambdaClient.d.ts +2 -2
- package/dist-types/commands/UpdateFunctionCodeCommand.d.ts +14 -1
- package/dist-types/index.d.ts +1 -0
- package/dist-types/models/LambdaServiceException.d.ts +10 -0
- package/dist-types/models/models_0.d.ts +238 -124
- package/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/LambdaClient.d.ts +2 -2
- package/dist-types/ts3.4/index.d.ts +1 -0
- package/dist-types/ts3.4/models/LambdaServiceException.d.ts +6 -0
- package/dist-types/ts3.4/models/models_0.d.ts +168 -114
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/waiters/index.d.ts +2 -0
- package/dist-types/ts3.4/waiters/waitForFunctionActiveV2.d.ts +7 -0
- package/dist-types/ts3.4/waiters/waitForFunctionUpdatedV2.d.ts +7 -0
- package/dist-types/waiters/index.d.ts +2 -0
- package/dist-types/waiters/waitForFunctionActive.d.ts +2 -2
- package/dist-types/waiters/waitForFunctionActiveV2.d.ts +14 -0
- package/dist-types/waiters/waitForFunctionUpdated.d.ts +2 -2
- package/dist-types/waiters/waitForFunctionUpdatedV2.d.ts +14 -0
- package/package.json +28 -28
package/dist-es/waiters/index.js
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
|
+
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
|
+
import { GetFunctionCommand } from "../commands/GetFunctionCommand";
|
|
4
|
+
var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5
|
+
var reason, result_1, returnComparator, returnComparator, returnComparator, exception_1;
|
|
6
|
+
return __generator(this, function (_a) {
|
|
7
|
+
switch (_a.label) {
|
|
8
|
+
case 0:
|
|
9
|
+
_a.trys.push([0, 2, , 3]);
|
|
10
|
+
return [4, client.send(new GetFunctionCommand(input))];
|
|
11
|
+
case 1:
|
|
12
|
+
result_1 = _a.sent();
|
|
13
|
+
reason = result_1;
|
|
14
|
+
try {
|
|
15
|
+
returnComparator = function () {
|
|
16
|
+
return result_1.Configuration.State;
|
|
17
|
+
};
|
|
18
|
+
if (returnComparator() === "Active") {
|
|
19
|
+
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (e) { }
|
|
23
|
+
try {
|
|
24
|
+
returnComparator = function () {
|
|
25
|
+
return result_1.Configuration.State;
|
|
26
|
+
};
|
|
27
|
+
if (returnComparator() === "Failed") {
|
|
28
|
+
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (e) { }
|
|
32
|
+
try {
|
|
33
|
+
returnComparator = function () {
|
|
34
|
+
return result_1.Configuration.State;
|
|
35
|
+
};
|
|
36
|
+
if (returnComparator() === "Pending") {
|
|
37
|
+
return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) { }
|
|
41
|
+
return [3, 3];
|
|
42
|
+
case 2:
|
|
43
|
+
exception_1 = _a.sent();
|
|
44
|
+
reason = exception_1;
|
|
45
|
+
return [3, 3];
|
|
46
|
+
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}); };
|
|
50
|
+
export var waitForFunctionActiveV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
var serviceDefaults;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
serviceDefaults = { minDelay: 1, maxDelay: 120 };
|
|
54
|
+
return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
55
|
+
});
|
|
56
|
+
}); };
|
|
57
|
+
export var waitUntilFunctionActiveV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var serviceDefaults, result;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
serviceDefaults = { minDelay: 1, maxDelay: 120 };
|
|
63
|
+
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
64
|
+
case 1:
|
|
65
|
+
result = _a.sent();
|
|
66
|
+
return [2, checkExceptions(result)];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
|
+
import { checkExceptions, createWaiter, WaiterState } from "@aws-sdk/util-waiter";
|
|
3
|
+
import { GetFunctionCommand } from "../commands/GetFunctionCommand";
|
|
4
|
+
var checkState = function (client, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5
|
+
var reason, result_1, returnComparator, returnComparator, returnComparator, exception_1;
|
|
6
|
+
return __generator(this, function (_a) {
|
|
7
|
+
switch (_a.label) {
|
|
8
|
+
case 0:
|
|
9
|
+
_a.trys.push([0, 2, , 3]);
|
|
10
|
+
return [4, client.send(new GetFunctionCommand(input))];
|
|
11
|
+
case 1:
|
|
12
|
+
result_1 = _a.sent();
|
|
13
|
+
reason = result_1;
|
|
14
|
+
try {
|
|
15
|
+
returnComparator = function () {
|
|
16
|
+
return result_1.Configuration.LastUpdateStatus;
|
|
17
|
+
};
|
|
18
|
+
if (returnComparator() === "Successful") {
|
|
19
|
+
return [2, { state: WaiterState.SUCCESS, reason: reason }];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (e) { }
|
|
23
|
+
try {
|
|
24
|
+
returnComparator = function () {
|
|
25
|
+
return result_1.Configuration.LastUpdateStatus;
|
|
26
|
+
};
|
|
27
|
+
if (returnComparator() === "Failed") {
|
|
28
|
+
return [2, { state: WaiterState.FAILURE, reason: reason }];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch (e) { }
|
|
32
|
+
try {
|
|
33
|
+
returnComparator = function () {
|
|
34
|
+
return result_1.Configuration.LastUpdateStatus;
|
|
35
|
+
};
|
|
36
|
+
if (returnComparator() === "InProgress") {
|
|
37
|
+
return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (e) { }
|
|
41
|
+
return [3, 3];
|
|
42
|
+
case 2:
|
|
43
|
+
exception_1 = _a.sent();
|
|
44
|
+
reason = exception_1;
|
|
45
|
+
return [3, 3];
|
|
46
|
+
case 3: return [2, { state: WaiterState.RETRY, reason: reason }];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}); };
|
|
50
|
+
export var waitForFunctionUpdatedV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
+
var serviceDefaults;
|
|
52
|
+
return __generator(this, function (_a) {
|
|
53
|
+
serviceDefaults = { minDelay: 1, maxDelay: 120 };
|
|
54
|
+
return [2, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
55
|
+
});
|
|
56
|
+
}); };
|
|
57
|
+
export var waitUntilFunctionUpdatedV2 = function (params, input) { return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var serviceDefaults, result;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
serviceDefaults = { minDelay: 1, maxDelay: 120 };
|
|
63
|
+
return [4, createWaiter(__assign(__assign({}, serviceDefaults), params), input, checkState)];
|
|
64
|
+
case 1:
|
|
65
|
+
result = _a.sent();
|
|
66
|
+
return [2, checkExceptions(result)];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
package/dist-types/Lambda.d.ts
CHANGED
|
@@ -850,11 +850,24 @@ export declare class Lambda extends LambdaClient {
|
|
|
850
850
|
* <p>Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed
|
|
851
851
|
* by a trusted publisher. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html">Configuring code signing</a>.</p>
|
|
852
852
|
*
|
|
853
|
+
* <p>If the function's package type is <code>Image</code>, you must specify the code package in <code>ImageUri</code> as
|
|
854
|
+
* the URI of a
|
|
855
|
+
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html">container image</a>
|
|
856
|
+
* in the Amazon ECR registry.
|
|
857
|
+
* </p>
|
|
858
|
+
*
|
|
859
|
+
* <p>If the function's package type is <code>Zip</code>, you must specify the deployment
|
|
860
|
+
* package as a <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip">.zip file
|
|
861
|
+
* archive</a>. Enter the Amazon S3 bucket and key of the code .zip file location.
|
|
862
|
+
* You can also provide the function code inline using the <code>ZipFile</code> field. </p>
|
|
863
|
+
* <p>The code in the deployment package must be compatible with the target instruction set
|
|
864
|
+
* architecture of the function (<code>x86-64</code> or <code>arm64</code>). </p>
|
|
865
|
+
*
|
|
853
866
|
* <p>The function's code is locked when you publish a version. You can't modify the code of a published version,
|
|
854
867
|
* only the unpublished version.</p>
|
|
855
868
|
* <note>
|
|
856
869
|
* <p>For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if
|
|
857
|
-
*
|
|
870
|
+
* you update the image tag to a new image, Lambda does not automatically update the function.</p>
|
|
858
871
|
* </note>
|
|
859
872
|
*/
|
|
860
873
|
updateFunctionCode(args: UpdateFunctionCodeCommandInput, options?: __HttpHandlerOptions): Promise<UpdateFunctionCodeCommandOutput>;
|
|
@@ -5,7 +5,7 @@ import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-s
|
|
|
5
5
|
import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
|
|
6
6
|
import { HttpHandler as __HttpHandler } from "@aws-sdk/protocol-http";
|
|
7
7
|
import { Client as __Client, DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@aws-sdk/smithy-client";
|
|
8
|
-
import { Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
|
|
8
|
+
import { BodyLengthCalculator as __BodyLengthCalculator, Credentials as __Credentials, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, RegionInfoProvider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@aws-sdk/types";
|
|
9
9
|
import { AddLayerVersionPermissionCommandInput, AddLayerVersionPermissionCommandOutput } from "./commands/AddLayerVersionPermissionCommand";
|
|
10
10
|
import { AddPermissionCommandInput, AddPermissionCommandOutput } from "./commands/AddPermissionCommand";
|
|
11
11
|
import { CreateAliasCommandInput, CreateAliasCommandOutput } from "./commands/CreateAliasCommand";
|
|
@@ -86,7 +86,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
|
|
|
86
86
|
* A function that can calculate the length of a request body.
|
|
87
87
|
* @internal
|
|
88
88
|
*/
|
|
89
|
-
bodyLengthChecker?:
|
|
89
|
+
bodyLengthChecker?: __BodyLengthCalculator;
|
|
90
90
|
/**
|
|
91
91
|
* A function that converts a stream into an array of bytes.
|
|
92
92
|
* @internal
|
|
@@ -10,11 +10,24 @@ export interface UpdateFunctionCodeCommandOutput extends FunctionConfiguration,
|
|
|
10
10
|
* <p>Updates a Lambda function's code. If code signing is enabled for the function, the code package must be signed
|
|
11
11
|
* by a trusted publisher. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-trustedcode.html">Configuring code signing</a>.</p>
|
|
12
12
|
*
|
|
13
|
+
* <p>If the function's package type is <code>Image</code>, you must specify the code package in <code>ImageUri</code> as
|
|
14
|
+
* the URI of a
|
|
15
|
+
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html">container image</a>
|
|
16
|
+
* in the Amazon ECR registry.
|
|
17
|
+
* </p>
|
|
18
|
+
*
|
|
19
|
+
* <p>If the function's package type is <code>Zip</code>, you must specify the deployment
|
|
20
|
+
* package as a <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip">.zip file
|
|
21
|
+
* archive</a>. Enter the Amazon S3 bucket and key of the code .zip file location.
|
|
22
|
+
* You can also provide the function code inline using the <code>ZipFile</code> field. </p>
|
|
23
|
+
* <p>The code in the deployment package must be compatible with the target instruction set
|
|
24
|
+
* architecture of the function (<code>x86-64</code> or <code>arm64</code>). </p>
|
|
25
|
+
*
|
|
13
26
|
* <p>The function's code is locked when you publish a version. You can't modify the code of a published version,
|
|
14
27
|
* only the unpublished version.</p>
|
|
15
28
|
* <note>
|
|
16
29
|
* <p>For a function defined as a container image, Lambda resolves the image tag to an image digest. In Amazon ECR, if
|
|
17
|
-
*
|
|
30
|
+
* you update the image tag to a new image, Lambda does not automatically update the function.</p>
|
|
18
31
|
* </note>
|
|
19
32
|
* @example
|
|
20
33
|
* Use a bare-bones client and the command you need to make an API call.
|
package/dist-types/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client";
|
|
2
|
+
/**
|
|
3
|
+
* Base exception class for all service exceptions from Lambda service.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LambdaServiceException extends __ServiceException {
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
constructor(options: __ServiceExceptionOptions);
|
|
10
|
+
}
|