Skip to content

Commit aeba101

Browse files
author
awstools
committed
feat(client-lambda): This release adds new APIs for creating and managing Lambda Function URLs and adds a new FunctionUrlAuthType parameter to the AddPermission API. Customers can use Function URLs to create built-in HTTPS endpoints on their functions.
1 parent a8b16e4 commit aeba101

13 files changed

+2652
-40
lines changed

clients/client-lambda/src/Lambda.ts

+187
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ import {
2626
CreateFunctionCommandInput,
2727
CreateFunctionCommandOutput,
2828
} from "./commands/CreateFunctionCommand";
29+
import {
30+
CreateFunctionUrlConfigCommand,
31+
CreateFunctionUrlConfigCommandInput,
32+
CreateFunctionUrlConfigCommandOutput,
33+
} from "./commands/CreateFunctionUrlConfigCommand";
2934
import { DeleteAliasCommand, DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand";
3035
import {
3136
DeleteCodeSigningConfigCommand,
@@ -57,6 +62,11 @@ import {
5762
DeleteFunctionEventInvokeConfigCommandInput,
5863
DeleteFunctionEventInvokeConfigCommandOutput,
5964
} from "./commands/DeleteFunctionEventInvokeConfigCommand";
65+
import {
66+
DeleteFunctionUrlConfigCommand,
67+
DeleteFunctionUrlConfigCommandInput,
68+
DeleteFunctionUrlConfigCommandOutput,
69+
} from "./commands/DeleteFunctionUrlConfigCommand";
6070
import {
6171
DeleteLayerVersionCommand,
6272
DeleteLayerVersionCommandInput,
@@ -104,6 +114,11 @@ import {
104114
GetFunctionEventInvokeConfigCommandInput,
105115
GetFunctionEventInvokeConfigCommandOutput,
106116
} from "./commands/GetFunctionEventInvokeConfigCommand";
117+
import {
118+
GetFunctionUrlConfigCommand,
119+
GetFunctionUrlConfigCommandInput,
120+
GetFunctionUrlConfigCommandOutput,
121+
} from "./commands/GetFunctionUrlConfigCommand";
107122
import {
108123
GetLayerVersionByArnCommand,
109124
GetLayerVersionByArnCommandInput,
@@ -153,6 +168,11 @@ import {
153168
ListFunctionsCommandInput,
154169
ListFunctionsCommandOutput,
155170
} from "./commands/ListFunctionsCommand";
171+
import {
172+
ListFunctionUrlConfigsCommand,
173+
ListFunctionUrlConfigsCommandInput,
174+
ListFunctionUrlConfigsCommandOutput,
175+
} from "./commands/ListFunctionUrlConfigsCommand";
156176
import { ListLayersCommand, ListLayersCommandInput, ListLayersCommandOutput } from "./commands/ListLayersCommand";
157177
import {
158178
ListLayerVersionsCommand,
@@ -242,6 +262,11 @@ import {
242262
UpdateFunctionEventInvokeConfigCommandInput,
243263
UpdateFunctionEventInvokeConfigCommandOutput,
244264
} from "./commands/UpdateFunctionEventInvokeConfigCommand";
265+
import {
266+
UpdateFunctionUrlConfigCommand,
267+
UpdateFunctionUrlConfigCommandInput,
268+
UpdateFunctionUrlConfigCommandOutput,
269+
} from "./commands/UpdateFunctionUrlConfigCommand";
245270
import { LambdaClient } from "./LambdaClient";
246271

247272
/**
@@ -674,6 +699,39 @@ export class Lambda extends LambdaClient {
674699
}
675700
}
676701

702+
/**
703+
* <p>Creates a Lambda function URL with the specified configuration parameters. A function URL is
704+
* a dedicated HTTP(S) endpoint that you can use to invoke your function.</p>
705+
*/
706+
public createFunctionUrlConfig(
707+
args: CreateFunctionUrlConfigCommandInput,
708+
options?: __HttpHandlerOptions
709+
): Promise<CreateFunctionUrlConfigCommandOutput>;
710+
public createFunctionUrlConfig(
711+
args: CreateFunctionUrlConfigCommandInput,
712+
cb: (err: any, data?: CreateFunctionUrlConfigCommandOutput) => void
713+
): void;
714+
public createFunctionUrlConfig(
715+
args: CreateFunctionUrlConfigCommandInput,
716+
options: __HttpHandlerOptions,
717+
cb: (err: any, data?: CreateFunctionUrlConfigCommandOutput) => void
718+
): void;
719+
public createFunctionUrlConfig(
720+
args: CreateFunctionUrlConfigCommandInput,
721+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateFunctionUrlConfigCommandOutput) => void),
722+
cb?: (err: any, data?: CreateFunctionUrlConfigCommandOutput) => void
723+
): Promise<CreateFunctionUrlConfigCommandOutput> | void {
724+
const command = new CreateFunctionUrlConfigCommand(args);
725+
if (typeof optionsOrCb === "function") {
726+
this.send(command, optionsOrCb);
727+
} else if (typeof cb === "function") {
728+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
729+
this.send(command, optionsOrCb || {}, cb);
730+
} else {
731+
return this.send(command, optionsOrCb);
732+
}
733+
}
734+
677735
/**
678736
* <p>Deletes a Lambda function <a href="https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html">alias</a>.</p>
679737
*/
@@ -902,6 +960,39 @@ export class Lambda extends LambdaClient {
902960
}
903961
}
904962

963+
/**
964+
* <p>Deletes a Lambda function URL. When you delete a function URL, you
965+
* can't recover it. Creating a new function URL results in a different URL address.</p>
966+
*/
967+
public deleteFunctionUrlConfig(
968+
args: DeleteFunctionUrlConfigCommandInput,
969+
options?: __HttpHandlerOptions
970+
): Promise<DeleteFunctionUrlConfigCommandOutput>;
971+
public deleteFunctionUrlConfig(
972+
args: DeleteFunctionUrlConfigCommandInput,
973+
cb: (err: any, data?: DeleteFunctionUrlConfigCommandOutput) => void
974+
): void;
975+
public deleteFunctionUrlConfig(
976+
args: DeleteFunctionUrlConfigCommandInput,
977+
options: __HttpHandlerOptions,
978+
cb: (err: any, data?: DeleteFunctionUrlConfigCommandOutput) => void
979+
): void;
980+
public deleteFunctionUrlConfig(
981+
args: DeleteFunctionUrlConfigCommandInput,
982+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteFunctionUrlConfigCommandOutput) => void),
983+
cb?: (err: any, data?: DeleteFunctionUrlConfigCommandOutput) => void
984+
): Promise<DeleteFunctionUrlConfigCommandOutput> | void {
985+
const command = new DeleteFunctionUrlConfigCommand(args);
986+
if (typeof optionsOrCb === "function") {
987+
this.send(command, optionsOrCb);
988+
} else if (typeof cb === "function") {
989+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
990+
this.send(command, optionsOrCb || {}, cb);
991+
} else {
992+
return this.send(command, optionsOrCb);
993+
}
994+
}
995+
905996
/**
906997
* <p>Deletes a version of an <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">Lambda
907998
* layer</a>. Deleted versions can no longer be viewed or added to functions. To avoid
@@ -1251,6 +1342,38 @@ export class Lambda extends LambdaClient {
12511342
}
12521343
}
12531344

1345+
/**
1346+
* <p>Returns details about a Lambda function URL.</p>
1347+
*/
1348+
public getFunctionUrlConfig(
1349+
args: GetFunctionUrlConfigCommandInput,
1350+
options?: __HttpHandlerOptions
1351+
): Promise<GetFunctionUrlConfigCommandOutput>;
1352+
public getFunctionUrlConfig(
1353+
args: GetFunctionUrlConfigCommandInput,
1354+
cb: (err: any, data?: GetFunctionUrlConfigCommandOutput) => void
1355+
): void;
1356+
public getFunctionUrlConfig(
1357+
args: GetFunctionUrlConfigCommandInput,
1358+
options: __HttpHandlerOptions,
1359+
cb: (err: any, data?: GetFunctionUrlConfigCommandOutput) => void
1360+
): void;
1361+
public getFunctionUrlConfig(
1362+
args: GetFunctionUrlConfigCommandInput,
1363+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetFunctionUrlConfigCommandOutput) => void),
1364+
cb?: (err: any, data?: GetFunctionUrlConfigCommandOutput) => void
1365+
): Promise<GetFunctionUrlConfigCommandOutput> | void {
1366+
const command = new GetFunctionUrlConfigCommand(args);
1367+
if (typeof optionsOrCb === "function") {
1368+
this.send(command, optionsOrCb);
1369+
} else if (typeof cb === "function") {
1370+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1371+
this.send(command, optionsOrCb || {}, cb);
1372+
} else {
1373+
return this.send(command, optionsOrCb);
1374+
}
1375+
}
1376+
12541377
/**
12551378
* <p>Returns information about a version of an <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">Lambda
12561379
* layer</a>, with a link to download the layer archive
@@ -1693,6 +1816,38 @@ export class Lambda extends LambdaClient {
16931816
}
16941817
}
16951818

1819+
/**
1820+
* <p>Returns a list of Lambda function URLs for the specified function.</p>
1821+
*/
1822+
public listFunctionUrlConfigs(
1823+
args: ListFunctionUrlConfigsCommandInput,
1824+
options?: __HttpHandlerOptions
1825+
): Promise<ListFunctionUrlConfigsCommandOutput>;
1826+
public listFunctionUrlConfigs(
1827+
args: ListFunctionUrlConfigsCommandInput,
1828+
cb: (err: any, data?: ListFunctionUrlConfigsCommandOutput) => void
1829+
): void;
1830+
public listFunctionUrlConfigs(
1831+
args: ListFunctionUrlConfigsCommandInput,
1832+
options: __HttpHandlerOptions,
1833+
cb: (err: any, data?: ListFunctionUrlConfigsCommandOutput) => void
1834+
): void;
1835+
public listFunctionUrlConfigs(
1836+
args: ListFunctionUrlConfigsCommandInput,
1837+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListFunctionUrlConfigsCommandOutput) => void),
1838+
cb?: (err: any, data?: ListFunctionUrlConfigsCommandOutput) => void
1839+
): Promise<ListFunctionUrlConfigsCommandOutput> | void {
1840+
const command = new ListFunctionUrlConfigsCommand(args);
1841+
if (typeof optionsOrCb === "function") {
1842+
this.send(command, optionsOrCb);
1843+
} else if (typeof cb === "function") {
1844+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1845+
this.send(command, optionsOrCb || {}, cb);
1846+
} else {
1847+
return this.send(command, optionsOrCb);
1848+
}
1849+
}
1850+
16961851
/**
16971852
* <p>Lists <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html">Lambda
16981853
* layers</a> and shows information about the latest version of each. Specify a
@@ -2523,4 +2678,36 @@ export class Lambda extends LambdaClient {
25232678
return this.send(command, optionsOrCb);
25242679
}
25252680
}
2681+
2682+
/**
2683+
* <p>Updates the configuration for a Lambda function URL.</p>
2684+
*/
2685+
public updateFunctionUrlConfig(
2686+
args: UpdateFunctionUrlConfigCommandInput,
2687+
options?: __HttpHandlerOptions
2688+
): Promise<UpdateFunctionUrlConfigCommandOutput>;
2689+
public updateFunctionUrlConfig(
2690+
args: UpdateFunctionUrlConfigCommandInput,
2691+
cb: (err: any, data?: UpdateFunctionUrlConfigCommandOutput) => void
2692+
): void;
2693+
public updateFunctionUrlConfig(
2694+
args: UpdateFunctionUrlConfigCommandInput,
2695+
options: __HttpHandlerOptions,
2696+
cb: (err: any, data?: UpdateFunctionUrlConfigCommandOutput) => void
2697+
): void;
2698+
public updateFunctionUrlConfig(
2699+
args: UpdateFunctionUrlConfigCommandInput,
2700+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateFunctionUrlConfigCommandOutput) => void),
2701+
cb?: (err: any, data?: UpdateFunctionUrlConfigCommandOutput) => void
2702+
): Promise<UpdateFunctionUrlConfigCommandOutput> | void {
2703+
const command = new UpdateFunctionUrlConfigCommand(args);
2704+
if (typeof optionsOrCb === "function") {
2705+
this.send(command, optionsOrCb);
2706+
} else if (typeof cb === "function") {
2707+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
2708+
this.send(command, optionsOrCb || {}, cb);
2709+
} else {
2710+
return this.send(command, optionsOrCb);
2711+
}
2712+
}
25262713
}

clients/client-lambda/src/LambdaClient.ts

+32-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ import {
6666
CreateEventSourceMappingCommandOutput,
6767
} from "./commands/CreateEventSourceMappingCommand";
6868
import { CreateFunctionCommandInput, CreateFunctionCommandOutput } from "./commands/CreateFunctionCommand";
69+
import {
70+
CreateFunctionUrlConfigCommandInput,
71+
CreateFunctionUrlConfigCommandOutput,
72+
} from "./commands/CreateFunctionUrlConfigCommand";
6973
import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand";
7074
import {
7175
DeleteCodeSigningConfigCommandInput,
@@ -88,6 +92,10 @@ import {
8892
DeleteFunctionEventInvokeConfigCommandInput,
8993
DeleteFunctionEventInvokeConfigCommandOutput,
9094
} from "./commands/DeleteFunctionEventInvokeConfigCommand";
95+
import {
96+
DeleteFunctionUrlConfigCommandInput,
97+
DeleteFunctionUrlConfigCommandOutput,
98+
} from "./commands/DeleteFunctionUrlConfigCommand";
9199
import { DeleteLayerVersionCommandInput, DeleteLayerVersionCommandOutput } from "./commands/DeleteLayerVersionCommand";
92100
import {
93101
DeleteProvisionedConcurrencyConfigCommandInput,
@@ -120,6 +128,10 @@ import {
120128
GetFunctionEventInvokeConfigCommandInput,
121129
GetFunctionEventInvokeConfigCommandOutput,
122130
} from "./commands/GetFunctionEventInvokeConfigCommand";
131+
import {
132+
GetFunctionUrlConfigCommandInput,
133+
GetFunctionUrlConfigCommandOutput,
134+
} from "./commands/GetFunctionUrlConfigCommand";
123135
import {
124136
GetLayerVersionByArnCommandInput,
125137
GetLayerVersionByArnCommandOutput,
@@ -154,6 +166,10 @@ import {
154166
ListFunctionsByCodeSigningConfigCommandOutput,
155167
} from "./commands/ListFunctionsByCodeSigningConfigCommand";
156168
import { ListFunctionsCommandInput, ListFunctionsCommandOutput } from "./commands/ListFunctionsCommand";
169+
import {
170+
ListFunctionUrlConfigsCommandInput,
171+
ListFunctionUrlConfigsCommandOutput,
172+
} from "./commands/ListFunctionUrlConfigsCommand";
157173
import { ListLayersCommandInput, ListLayersCommandOutput } from "./commands/ListLayersCommand";
158174
import { ListLayerVersionsCommandInput, ListLayerVersionsCommandOutput } from "./commands/ListLayerVersionsCommand";
159175
import {
@@ -211,6 +227,10 @@ import {
211227
UpdateFunctionEventInvokeConfigCommandInput,
212228
UpdateFunctionEventInvokeConfigCommandOutput,
213229
} from "./commands/UpdateFunctionEventInvokeConfigCommand";
230+
import {
231+
UpdateFunctionUrlConfigCommandInput,
232+
UpdateFunctionUrlConfigCommandOutput,
233+
} from "./commands/UpdateFunctionUrlConfigCommand";
214234
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
215235

216236
export type ServiceInputTypes =
@@ -220,13 +240,15 @@ export type ServiceInputTypes =
220240
| CreateCodeSigningConfigCommandInput
221241
| CreateEventSourceMappingCommandInput
222242
| CreateFunctionCommandInput
243+
| CreateFunctionUrlConfigCommandInput
223244
| DeleteAliasCommandInput
224245
| DeleteCodeSigningConfigCommandInput
225246
| DeleteEventSourceMappingCommandInput
226247
| DeleteFunctionCodeSigningConfigCommandInput
227248
| DeleteFunctionCommandInput
228249
| DeleteFunctionConcurrencyCommandInput
229250
| DeleteFunctionEventInvokeConfigCommandInput
251+
| DeleteFunctionUrlConfigCommandInput
230252
| DeleteLayerVersionCommandInput
231253
| DeleteProvisionedConcurrencyConfigCommandInput
232254
| GetAccountSettingsCommandInput
@@ -238,6 +260,7 @@ export type ServiceInputTypes =
238260
| GetFunctionConcurrencyCommandInput
239261
| GetFunctionConfigurationCommandInput
240262
| GetFunctionEventInvokeConfigCommandInput
263+
| GetFunctionUrlConfigCommandInput
241264
| GetLayerVersionByArnCommandInput
242265
| GetLayerVersionCommandInput
243266
| GetLayerVersionPolicyCommandInput
@@ -249,6 +272,7 @@ export type ServiceInputTypes =
249272
| ListCodeSigningConfigsCommandInput
250273
| ListEventSourceMappingsCommandInput
251274
| ListFunctionEventInvokeConfigsCommandInput
275+
| ListFunctionUrlConfigsCommandInput
252276
| ListFunctionsByCodeSigningConfigCommandInput
253277
| ListFunctionsCommandInput
254278
| ListLayerVersionsCommandInput
@@ -271,7 +295,8 @@ export type ServiceInputTypes =
271295
| UpdateEventSourceMappingCommandInput
272296
| UpdateFunctionCodeCommandInput
273297
| UpdateFunctionConfigurationCommandInput
274-
| UpdateFunctionEventInvokeConfigCommandInput;
298+
| UpdateFunctionEventInvokeConfigCommandInput
299+
| UpdateFunctionUrlConfigCommandInput;
275300

276301
export type ServiceOutputTypes =
277302
| AddLayerVersionPermissionCommandOutput
@@ -280,13 +305,15 @@ export type ServiceOutputTypes =
280305
| CreateCodeSigningConfigCommandOutput
281306
| CreateEventSourceMappingCommandOutput
282307
| CreateFunctionCommandOutput
308+
| CreateFunctionUrlConfigCommandOutput
283309
| DeleteAliasCommandOutput
284310
| DeleteCodeSigningConfigCommandOutput
285311
| DeleteEventSourceMappingCommandOutput
286312
| DeleteFunctionCodeSigningConfigCommandOutput
287313
| DeleteFunctionCommandOutput
288314
| DeleteFunctionConcurrencyCommandOutput
289315
| DeleteFunctionEventInvokeConfigCommandOutput
316+
| DeleteFunctionUrlConfigCommandOutput
290317
| DeleteLayerVersionCommandOutput
291318
| DeleteProvisionedConcurrencyConfigCommandOutput
292319
| GetAccountSettingsCommandOutput
@@ -298,6 +325,7 @@ export type ServiceOutputTypes =
298325
| GetFunctionConcurrencyCommandOutput
299326
| GetFunctionConfigurationCommandOutput
300327
| GetFunctionEventInvokeConfigCommandOutput
328+
| GetFunctionUrlConfigCommandOutput
301329
| GetLayerVersionByArnCommandOutput
302330
| GetLayerVersionCommandOutput
303331
| GetLayerVersionPolicyCommandOutput
@@ -309,6 +337,7 @@ export type ServiceOutputTypes =
309337
| ListCodeSigningConfigsCommandOutput
310338
| ListEventSourceMappingsCommandOutput
311339
| ListFunctionEventInvokeConfigsCommandOutput
340+
| ListFunctionUrlConfigsCommandOutput
312341
| ListFunctionsByCodeSigningConfigCommandOutput
313342
| ListFunctionsCommandOutput
314343
| ListLayerVersionsCommandOutput
@@ -331,7 +360,8 @@ export type ServiceOutputTypes =
331360
| UpdateEventSourceMappingCommandOutput
332361
| UpdateFunctionCodeCommandOutput
333362
| UpdateFunctionConfigurationCommandOutput
334-
| UpdateFunctionEventInvokeConfigCommandOutput;
363+
| UpdateFunctionEventInvokeConfigCommandOutput
364+
| UpdateFunctionUrlConfigCommandOutput;
335365

336366
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
337367
/**

0 commit comments

Comments
 (0)