Skip to content

Commit 0c470f6

Browse files
author
awstools
committed
feat(client-lambda): This release adds support for using AWS KMS customer managed keys to encrypt AWS Lambda .zip deployment packages.
1 parent 84db913 commit 0c470f6

File tree

6 files changed

+100
-19
lines changed

6 files changed

+100
-19
lines changed

clients/client-lambda/src/commands/CreateFunctionCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export interface CreateFunctionCommandOutput extends FunctionConfiguration, __Me
8888
* S3Key: "STRING_VALUE",
8989
* S3ObjectVersion: "STRING_VALUE",
9090
* ImageUri: "STRING_VALUE",
91+
* SourceKMSKeyArn: "STRING_VALUE",
9192
* },
9293
* Description: "STRING_VALUE",
9394
* Timeout: Number("int"),

clients/client-lambda/src/commands/GetFunctionCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export interface GetFunctionCommandOutput extends GetFunctionResponse, __Metadat
152152
* // Location: "STRING_VALUE",
153153
* // ImageUri: "STRING_VALUE",
154154
* // ResolvedImageUri: "STRING_VALUE",
155+
* // SourceKMSKeyArn: "STRING_VALUE",
155156
* // },
156157
* // Tags: { // Tags
157158
* // "<keys>": "STRING_VALUE",

clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export interface UpdateFunctionCodeCommandOutput extends FunctionConfiguration,
6868
* Architectures: [ // ArchitecturesList
6969
* "x86_64" || "arm64",
7070
* ],
71+
* SourceKMSKeyArn: "STRING_VALUE",
7172
* };
7273
* const command = new UpdateFunctionCodeCommand(input);
7374
* const response = await client.send(command);

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

+73-15
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,13 @@ export interface FunctionCode {
16291629
* @public
16301630
*/
16311631
ImageUri?: string;
1632+
1633+
/**
1634+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's
1635+
* .zip deployment package. If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a>.</p>
1636+
* @public
1637+
*/
1638+
SourceKMSKeyArn?: string;
16321639
}
16331640

16341641
/**
@@ -2040,12 +2047,23 @@ export interface CreateFunctionRequest {
20402047
Environment?: Environment;
20412048

20422049
/**
2043-
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's
2044-
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>. When
2045-
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> is activated, Lambda also uses
2046-
* this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to
2047-
* encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR).
2048-
* If you don't provide a customer managed key, Lambda uses a default service key.</p>
2050+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:</p>
2051+
* <ul>
2052+
* <li>
2053+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>.</p>
2054+
* </li>
2055+
* <li>
2056+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> snapshots.</p>
2057+
* </li>
2058+
* <li>
2059+
* <p>When used with <code>SourceKMSKeyArn</code>, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption">
2060+
* Specifying a customer managed key for Lambda</a>.</p>
2061+
* </li>
2062+
* <li>
2063+
* <p>The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle">Function lifecycle</a>.</p>
2064+
* </li>
2065+
* </ul>
2066+
* <p>If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a> or an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
20492067
* @public
20502068
*/
20512069
KMSKeyArn?: string;
@@ -2536,8 +2554,23 @@ export interface FunctionConfiguration {
25362554
Environment?: EnvironmentResponse;
25372555

25382556
/**
2539-
* <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
2540-
* returned only if you've configured a customer managed key.</p>
2557+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:</p>
2558+
* <ul>
2559+
* <li>
2560+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>.</p>
2561+
* </li>
2562+
* <li>
2563+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> snapshots.</p>
2564+
* </li>
2565+
* <li>
2566+
* <p>When used with <code>SourceKMSKeyArn</code>, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption">
2567+
* Specifying a customer managed key for Lambda</a>.</p>
2568+
* </li>
2569+
* <li>
2570+
* <p>The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle">Function lifecycle</a>.</p>
2571+
* </li>
2572+
* </ul>
2573+
* <p>If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a> or an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
25412574
* @public
25422575
*/
25432576
KMSKeyArn?: string;
@@ -3349,6 +3382,13 @@ export interface FunctionCodeLocation {
33493382
* @public
33503383
*/
33513384
ResolvedImageUri?: string;
3385+
3386+
/**
3387+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's
3388+
* .zip deployment package. If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a>.</p>
3389+
* @public
3390+
*/
3391+
SourceKMSKeyArn?: string;
33523392
}
33533393

33543394
/**
@@ -3399,7 +3439,7 @@ export interface GetFunctionResponse {
33993439

34003440
/**
34013441
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda
3402-
* returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/https:/docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
3442+
* returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
34033443
* @public
34043444
*/
34053445
Tags?: Record<string, string>;
@@ -7206,6 +7246,13 @@ export interface UpdateFunctionCodeRequest {
72067246
* @public
72077247
*/
72087248
Architectures?: Architecture[];
7249+
7250+
/**
7251+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's
7252+
* .zip deployment package. If you don't provide a customer managed key, Lambda uses an Amazon Web Services managed key.</p>
7253+
* @public
7254+
*/
7255+
SourceKMSKeyArn?: string;
72097256
}
72107257

72117258
/**
@@ -7307,12 +7354,23 @@ export interface UpdateFunctionConfigurationRequest {
73077354
DeadLetterConfig?: DeadLetterConfig;
73087355

73097356
/**
7310-
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt your function's
7311-
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>. When
7312-
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> is activated, Lambda also uses
7313-
* this key is to encrypt your function's snapshot. If you deploy your function using a container image, Lambda also uses this key to
7314-
* encrypt your function when it's deployed. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR).
7315-
* If you don't provide a customer managed key, Lambda uses a default service key.</p>
7357+
* <p>The ARN of the Key Management Service (KMS) customer managed key that's used to encrypt the following resources:</p>
7358+
* <ul>
7359+
* <li>
7360+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption">environment variables</a>.</p>
7361+
* </li>
7362+
* <li>
7363+
* <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html">Lambda SnapStart</a> snapshots.</p>
7364+
* </li>
7365+
* <li>
7366+
* <p>When used with <code>SourceKMSKeyArn</code>, the unzipped version of the .zip deployment package that's used for function invocations. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption">
7367+
* Specifying a customer managed key for Lambda</a>.</p>
7368+
* </li>
7369+
* <li>
7370+
* <p>The optimized version of the container image that's used for function invocations. Note that this is not the same key that's used to protect your container image in the Amazon Elastic Container Registry (Amazon ECR). For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle">Function lifecycle</a>.</p>
7371+
* </li>
7372+
* </ul>
7373+
* <p>If you don't provide a customer managed key, Lambda uses an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk">Amazon Web Services owned key</a> or an <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk">Amazon Web Services managed key</a>.</p>
73167374
* @public
73177375
*/
73187376
KMSKeyArn?: string;

clients/client-lambda/src/protocols/Aws_restJson1.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,7 @@ export const se_UpdateFunctionCodeCommand = async (
17281728
S3Bucket: [],
17291729
S3Key: [],
17301730
S3ObjectVersion: [],
1731+
SourceKMSKeyArn: [],
17311732
ZipFile: (_) => context.base64Encoder(_),
17321733
})
17331734
);
@@ -4646,6 +4647,7 @@ const se_FunctionCode = (input: FunctionCode, context: __SerdeContext): any => {
46464647
S3Bucket: [],
46474648
S3Key: [],
46484649
S3ObjectVersion: [],
4650+
SourceKMSKeyArn: [],
46494651
ZipFile: context.base64Encoder,
46504652
});
46514653
};

0 commit comments

Comments
 (0)