Skip to content

Commit 84d9c25

Browse files
author
awstools
committed
feat(client-lambda): This release adds the ability to create ESMs with Document DB change streams as event source. For more information see https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html.
1 parent 79aa596 commit 84d9c25

File tree

5 files changed

+1039
-1374
lines changed

5 files changed

+1039
-1374
lines changed

clients/client-lambda/src/endpoint/EndpointParameters.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
2424
};
2525

2626
export interface EndpointParameters extends __EndpointParameters {
27-
Region: string;
27+
Region?: string;
2828
UseDualStack?: boolean;
2929
UseFIPS?: boolean;
3030
Endpoint?: string;

clients/client-lambda/src/endpoint/ruleset.ts

+20-19
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
66
or see "smithy.rules#endpointRuleSet"
77
in codegen/sdk-codegen/aws-models/lambda.json */
88

9-
const q="fn",
10-
r="argv",
11-
s="ref";
12-
const a=true,
13-
b=false,
14-
c="String",
15-
d="PartitionResult",
16-
e="tree",
17-
f="error",
18-
g="endpoint",
19-
h={"required":true,"default":false,"type":"Boolean"},
20-
i={[s]:"Endpoint"},
21-
j={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
22-
k={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
23-
l={},
24-
m={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsFIPS"]}]},
25-
n={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsDualStack"]}]},
9+
const q="required",
10+
r="fn",
11+
s="argv",
12+
t="ref";
13+
const a="isSet",
14+
b="tree",
15+
c="error",
16+
d="endpoint",
17+
e="PartitionResult",
18+
f={[q]:false,"type":"String"},
19+
g={[q]:true,"default":false,"type":"Boolean"},
20+
h={[t]:"Endpoint"},
21+
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
22+
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
23+
k={},
24+
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
25+
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
26+
n=[i],
2627
o=[j],
27-
p=[k];
28-
const _data={version:"1.0",parameters:{Region:{required:a,type:c},UseDualStack:h,UseFIPS:h,Endpoint:{required:b,type:c}},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:d}],type:e,rules:[{conditions:[{[q]:"isSet",[r]:[i]}],type:e,rules:[{conditions:o,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:f},{type:e,rules:[{conditions:p,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:f},{endpoint:{url:i,properties:l,headers:l},type:g}]}]},{conditions:[j,k],type:e,rules:[{conditions:[m,n],type:e,rules:[{endpoint:{url:"https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:f}]},{conditions:o,type:e,rules:[{conditions:[m],type:e,rules:[{type:e,rules:[{endpoint:{url:"https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:f}]},{conditions:p,type:e,rules:[{conditions:[n],type:e,rules:[{endpoint:{url:"https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:l,headers:l},type:g}]},{error:"DualStack is enabled but this partition does not support DualStack",type:f}]},{endpoint:{url:"https://lambda.{Region}.{PartitionResult#dnsSuffix}",properties:l,headers:l},type:g}]}]};
28+
p=[{[t]:"Region"}];
29+
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://lambda.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
2930
export const ruleSet: RuleSetObject = _data;

clients/client-lambda/src/models/models_0.ts

+75-17
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export interface AddPermissionRequest {
372372

373373
/**
374374
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
375-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
375+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
376376
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
377377
*/
378378
FunctionUrlAuthType?: FunctionUrlAuthType | string;
@@ -620,6 +620,39 @@ export interface DestinationConfig {
620620
OnFailure?: OnFailure;
621621
}
622622

623+
export enum FullDocument {
624+
Default = "Default",
625+
UpdateLookup = "UpdateLookup",
626+
}
627+
628+
/**
629+
* <p>
630+
* Specific configuration settings for a DocumentDB event source.
631+
* </p>
632+
*/
633+
export interface DocumentDBEventSourceConfig {
634+
/**
635+
* <p>
636+
* The name of the database to consume within the DocumentDB cluster.
637+
* </p>
638+
*/
639+
DatabaseName?: string;
640+
641+
/**
642+
* <p>
643+
* The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
644+
* </p>
645+
*/
646+
CollectionName?: string;
647+
648+
/**
649+
* <p>
650+
* Determines what DocumentDB sends to your event stream during document update operations. If set to UpdateLookup, DocumentDB sends a delta describing the changes, along with a copy of the entire document. Otherwise, DocumentDB sends only a partial document that contains the changes.
651+
* </p>
652+
*/
653+
FullDocument?: FullDocument | string;
654+
}
655+
623656
/**
624657
* <p>
625658
* A structure within a <code>FilterCriteria</code> object that defines an event filtering pattern.
@@ -956,6 +989,11 @@ export interface CreateEventSourceMappingRequest {
956989
* <p>(Amazon SQS only) The scaling configuration for the event source. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency">Configuring maximum concurrency for Amazon SQS event sources</a>.</p>
957990
*/
958991
ScalingConfig?: ScalingConfig;
992+
993+
/**
994+
* <p>Specific configuration settings for a DocumentDB event source.</p>
995+
*/
996+
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
959997
}
960998

961999
/**
@@ -1105,6 +1143,11 @@ export interface EventSourceMappingConfiguration {
11051143
* <p>(Amazon SQS only) The scaling configuration for the event source. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency">Configuring maximum concurrency for Amazon SQS event sources</a>.</p>
11061144
*/
11071145
ScalingConfig?: ScalingConfig;
1146+
1147+
/**
1148+
* <p>Specific configuration settings for a DocumentDB event source.</p>
1149+
*/
1150+
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
11081151
}
11091152

11101153
/**
@@ -1398,8 +1441,8 @@ export interface CreateFunctionRequest {
13981441
FunctionName: string | undefined;
13991442

14001443
/**
1401-
* <p>The identifier of the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">runtime</a>. Runtime is required if the deployment package is a .zip file archive.
1402-
* </p>
1444+
* <p>The identifier of the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">runtime</a>. Runtime is required if the deployment package is a .zip file archive.</p>
1445+
* <p>The following list includes deprecated runtimes. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy">Runtime deprecation policy</a>.</p>
14031446
*/
14041447
Runtime?: Runtime | string;
14051448

@@ -1467,8 +1510,7 @@ export interface CreateFunctionRequest {
14671510
Environment?: Environment;
14681511

14691512
/**
1470-
* <p>The ARN of the Key Management Service (KMS) key that's used to encrypt your function's environment
1471-
* variables. If it's not provided, Lambda uses a default service key.</p>
1513+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>. When <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> is activated, this key is also used to encrypt your function's snapshot. If you don't provide a customer managed key, Lambda uses a default service key.</p>
14721514
*/
14731515
KMSKeyArn?: string;
14741516

@@ -1836,7 +1878,7 @@ export interface FunctionConfiguration {
18361878
Environment?: EnvironmentResponse;
18371879

18381880
/**
1839-
* <p>The KMS key that's used to encrypt the function's environment variables. This key is
1881+
* <p>The KMS key that's used to encrypt the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>. When <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> is activated, this key is also used to encrypt the function's snapshot. This key is
18401882
* returned only if you've configured a customer managed key.</p>
18411883
*/
18421884
KMSKeyArn?: string;
@@ -2044,7 +2086,7 @@ export interface CreateFunctionUrlConfigRequest {
20442086

20452087
/**
20462088
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
2047-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
2089+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
20482090
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
20492091
*/
20502092
AuthType: FunctionUrlAuthType | string | undefined;
@@ -2069,7 +2111,7 @@ export interface CreateFunctionUrlConfigResponse {
20692111

20702112
/**
20712113
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
2072-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
2114+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
20732115
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
20742116
*/
20752117
AuthType: FunctionUrlAuthType | string | undefined;
@@ -2742,7 +2784,7 @@ export interface GetFunctionUrlConfigResponse {
27422784

27432785
/**
27442786
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
2745-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
2787+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
27462788
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
27472789
*/
27482790
AuthType: FunctionUrlAuthType | string | undefined;
@@ -3065,9 +3107,14 @@ export interface GetRuntimeManagementConfigResponse {
30653107

30663108
/**
30673109
* <p>The ARN of the runtime the function is configured to use. If the runtime update mode is <b>Manual</b>, the ARN is returned, otherwise <code>null</code>
3068-
* is returned.</p>
3110+
* is returned.</p>
30693111
*/
30703112
RuntimeVersionArn?: string;
3113+
3114+
/**
3115+
* <p>The Amazon Resource Name (ARN) of your function.</p>
3116+
*/
3117+
FunctionArn?: string;
30713118
}
30723119

30733120
/**
@@ -4142,7 +4189,7 @@ export interface FunctionUrlConfig {
41424189

41434190
/**
41444191
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
4145-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
4192+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
41464193
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
41474194
*/
41484195
AuthType: FunctionUrlAuthType | string | undefined;
@@ -5230,6 +5277,11 @@ export interface UpdateEventSourceMappingRequest {
52305277
* <p>(Amazon SQS only) The scaling configuration for the event source. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency">Configuring maximum concurrency for Amazon SQS event sources</a>.</p>
52315278
*/
52325279
ScalingConfig?: ScalingConfig;
5280+
5281+
/**
5282+
* <p>Specific configuration settings for a DocumentDB event source.</p>
5283+
*/
5284+
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
52335285
}
52345286

52355287
export interface UpdateFunctionCodeRequest {
@@ -5378,8 +5430,8 @@ export interface UpdateFunctionConfigurationRequest {
53785430
Environment?: Environment;
53795431

53805432
/**
5381-
* <p>The identifier of the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">runtime</a>. Runtime is required if the deployment package is a .zip file archive.
5382-
* </p>
5433+
* <p>The identifier of the function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html">runtime</a>. Runtime is required if the deployment package is a .zip file archive.</p>
5434+
* <p>The following list includes deprecated runtimes. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy">Runtime deprecation policy</a>.</p>
53835435
*/
53845436
Runtime?: Runtime | string;
53855437

@@ -5390,8 +5442,7 @@ export interface UpdateFunctionConfigurationRequest {
53905442
DeadLetterConfig?: DeadLetterConfig;
53915443

53925444
/**
5393-
* <p>The ARN of the Key Management Service (KMS) key that's used to encrypt your function's environment
5394-
* variables. If it's not provided, Lambda uses a default service key.</p>
5445+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>. When <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> is activated, this key is also used to encrypt your function's snapshot. If you don't provide a customer managed key, Lambda uses a default service key.</p>
53955446
*/
53965447
KMSKeyArn?: string;
53975448

@@ -5536,7 +5587,7 @@ export interface UpdateFunctionUrlConfigRequest {
55365587

55375588
/**
55385589
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
5539-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
5590+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
55405591
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
55415592
*/
55425593
AuthType?: FunctionUrlAuthType | string;
@@ -5561,7 +5612,7 @@ export interface UpdateFunctionUrlConfigResponse {
55615612

55625613
/**
55635614
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
5564-
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
5615+
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
55655616
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
55665617
*/
55675618
AuthType: FunctionUrlAuthType | string | undefined;
@@ -5711,6 +5762,13 @@ export const DestinationConfigFilterSensitiveLog = (obj: DestinationConfig): any
57115762
...obj,
57125763
});
57135764

5765+
/**
5766+
* @internal
5767+
*/
5768+
export const DocumentDBEventSourceConfigFilterSensitiveLog = (obj: DocumentDBEventSourceConfig): any => ({
5769+
...obj,
5770+
});
5771+
57145772
/**
57155773
* @internal
57165774
*/

0 commit comments

Comments
 (0)