Skip to content

Commit

Permalink
feat(client-lambda): This release adds the ability to create ESMs wit…
Browse files Browse the repository at this point in the history
…h Document DB change streams as event source. For more information see https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html.
  • Loading branch information
awstools committed Feb 27, 2023
1 parent 79aa596 commit 84d9c25
Show file tree
Hide file tree
Showing 5 changed files with 1,039 additions and 1,374 deletions.
2 changes: 1 addition & 1 deletion clients/client-lambda/src/endpoint/EndpointParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resolveClientEndpointParameters = <T>(
};

export interface EndpointParameters extends __EndpointParameters {
Region: string;
Region?: string;
UseDualStack?: boolean;
UseFIPS?: boolean;
Endpoint?: string;
Expand Down
39 changes: 20 additions & 19 deletions clients/client-lambda/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/lambda.json */

const q="fn",
r="argv",
s="ref";
const a=true,
b=false,
c="String",
d="PartitionResult",
e="tree",
f="error",
g="endpoint",
h={"required":true,"default":false,"type":"Boolean"},
i={[s]:"Endpoint"},
j={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
k={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
l={},
m={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsFIPS"]}]},
n={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:d},"supportsDualStack"]}]},
const q="required",
r="fn",
s="argv",
t="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e="PartitionResult",
f={[q]:false,"type":"String"},
g={[q]:true,"default":false,"type":"Boolean"},
h={[t]:"Endpoint"},
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
k={},
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
n=[i],
o=[j],
p=[k];
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}]}]};
p=[{[t]:"Region"}];
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}]}]};
export const ruleSet: RuleSetObject = _data;
92 changes: 75 additions & 17 deletions clients/client-lambda/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ export interface AddPermissionRequest {

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

export enum FullDocument {
Default = "Default",
UpdateLookup = "UpdateLookup",
}

/**
* <p>
* Specific configuration settings for a DocumentDB event source.
* </p>
*/
export interface DocumentDBEventSourceConfig {
/**
* <p>
* The name of the database to consume within the DocumentDB cluster.
* </p>
*/
DatabaseName?: string;

/**
* <p>
* The name of the collection to consume within the database. If you do not specify a collection, Lambda consumes all collections.
* </p>
*/
CollectionName?: string;

/**
* <p>
* 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.
* </p>
*/
FullDocument?: FullDocument | string;
}

/**
* <p>
* A structure within a <code>FilterCriteria</code> object that defines an event filtering pattern.
Expand Down Expand Up @@ -956,6 +989,11 @@ export interface CreateEventSourceMappingRequest {
* <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>
*/
ScalingConfig?: ScalingConfig;

/**
* <p>Specific configuration settings for a DocumentDB event source.</p>
*/
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
}

/**
Expand Down Expand Up @@ -1105,6 +1143,11 @@ export interface EventSourceMappingConfiguration {
* <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>
*/
ScalingConfig?: ScalingConfig;

/**
* <p>Specific configuration settings for a DocumentDB event source.</p>
*/
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
}

/**
Expand Down Expand Up @@ -1398,8 +1441,8 @@ export interface CreateFunctionRequest {
FunctionName: string | undefined;

/**
* <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>
* <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>
* <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>
*/
Runtime?: Runtime | string;

Expand Down Expand Up @@ -1467,8 +1510,7 @@ export interface CreateFunctionRequest {
Environment?: Environment;

/**
* <p>The ARN of the Key Management Service (KMS) key that's used to encrypt your function's environment
* variables. If it's not provided, Lambda uses a default service key.</p>
* <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>
*/
KMSKeyArn?: string;

Expand Down Expand Up @@ -1836,7 +1878,7 @@ export interface FunctionConfiguration {
Environment?: EnvironmentResponse;

/**
* <p>The KMS key that's used to encrypt the function's environment variables. This key is
* <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
* returned only if you've configured a customer managed key.</p>
*/
KMSKeyArn?: string;
Expand Down Expand Up @@ -2044,7 +2086,7 @@ export interface CreateFunctionUrlConfigRequest {

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

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

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

/**
* <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>
* is returned.</p>
* is returned.</p>
*/
RuntimeVersionArn?: string;

/**
* <p>The Amazon Resource Name (ARN) of your function.</p>
*/
FunctionArn?: string;
}

/**
Expand Down Expand Up @@ -4142,7 +4189,7 @@ export interface FunctionUrlConfig {

/**
* <p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated
* IAM users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
* users only. Set to <code>NONE</code> if you want to bypass IAM authentication to create a public endpoint. For more information,
* see <a href="https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html">Security and auth model for Lambda function URLs</a>.</p>
*/
AuthType: FunctionUrlAuthType | string | undefined;
Expand Down Expand Up @@ -5230,6 +5277,11 @@ export interface UpdateEventSourceMappingRequest {
* <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>
*/
ScalingConfig?: ScalingConfig;

/**
* <p>Specific configuration settings for a DocumentDB event source.</p>
*/
DocumentDBEventSourceConfig?: DocumentDBEventSourceConfig;
}

export interface UpdateFunctionCodeRequest {
Expand Down Expand Up @@ -5378,8 +5430,8 @@ export interface UpdateFunctionConfigurationRequest {
Environment?: Environment;

/**
* <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>
* <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>
* <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>
*/
Runtime?: Runtime | string;

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

/**
* <p>The ARN of the Key Management Service (KMS) key that's used to encrypt your function's environment
* variables. If it's not provided, Lambda uses a default service key.</p>
* <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>
*/
KMSKeyArn?: string;

Expand Down Expand Up @@ -5536,7 +5587,7 @@ export interface UpdateFunctionUrlConfigRequest {

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

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

/**
* @internal
*/
export const DocumentDBEventSourceConfigFilterSensitiveLog = (obj: DocumentDBEventSourceConfig): any => ({
...obj,
});

/**
* @internal
*/
Expand Down
Loading

0 comments on commit 84d9c25

Please sign in to comment.