Skip to content

Commit 97088ae

Browse files
author
awstools
committed
feat(client-lambda): Tagging support for Lambda event source mapping, and code signing configuration resources.
1 parent 31b656f commit 97088ae

19 files changed

+1191
-69
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface AddPermissionCommandInput extends AddPermissionRequest {}
2828
export interface AddPermissionCommandOutput extends AddPermissionResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Grants an Amazon Web Servicesservice, Amazon Web Services account, or Amazon Web Services organization
31+
* <p>Grants a <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#Principal_specifying">principal</a>
3232
* permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict
3333
* access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name
3434
* (ARN) of that version or alias to invoke the function. Note: Lambda does not support adding policies
@@ -93,6 +93,11 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met
9393
* </li>
9494
* </ul>
9595
*
96+
* @throws {@link PublicPolicyException} (client fault)
97+
* <p>Lambda prevented your policy from being created because it would grant public access to your function. If you intended to
98+
* create a public policy, use the <a>PutPublicAccessBlockConfig</a> API action to configure your function's public-access settings
99+
* to allow public policies.</p>
100+
*
96101
* @throws {@link ResourceConflictException} (client fault)
97102
* <p>The resource already exists, or another operation is in progress.</p>
98103
*

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

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export interface CreateCodeSigningConfigCommandOutput extends CreateCodeSigningC
4747
* CodeSigningPolicies: { // CodeSigningPolicies
4848
* UntrustedArtifactOnDeployment: "Warn" || "Enforce",
4949
* },
50+
* Tags: { // Tags
51+
* "<keys>": "STRING_VALUE",
52+
* },
5053
* };
5154
* const command = new CreateCodeSigningConfigCommand(input);
5255
* const response = await client.send(command);

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

+4
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ export interface CreateEventSourceMappingCommandOutput extends EventSourceMappin
175175
* MaximumRecordAgeInSeconds: Number("int"),
176176
* BisectBatchOnFunctionError: true || false,
177177
* MaximumRetryAttempts: Number("int"),
178+
* Tags: { // Tags
179+
* "<keys>": "STRING_VALUE",
180+
* },
178181
* TumblingWindowInSeconds: Number("int"),
179182
* Topics: [ // Topics
180183
* "STRING_VALUE",
@@ -289,6 +292,7 @@ export interface CreateEventSourceMappingCommandOutput extends EventSourceMappin
289292
* // ErrorCode: "STRING_VALUE",
290293
* // Message: "STRING_VALUE",
291294
* // },
295+
* // EventSourceMappingArn: "STRING_VALUE",
292296
* // };
293297
*
294298
* ```

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

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface DeleteEventSourceMappingCommandOutput extends EventSourceMappin
116116
* // ErrorCode: "STRING_VALUE",
117117
* // Message: "STRING_VALUE",
118118
* // },
119+
* // EventSourceMappingArn: "STRING_VALUE",
119120
* // };
120121
*
121122
* ```

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface DeleteResourcePolicyCommandInput extends DeleteResourcePolicyRe
2828
export interface DeleteResourcePolicyCommandOutput extends __MetadataBearer {}
2929

3030
/**
31-
* <p>Deletes a <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a> from a function.</p>
31+
* <note>
32+
* <p>The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be
33+
* available in all Amazon Web Services Regions until September 30, 2024.</p>
34+
* </note>
35+
* <p>Deletes a <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a> from a function.</p>
3236
* @example
3337
* Use a bare-bones client and the command you need to make an API call.
3438
* ```javascript

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

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export interface GetEventSourceMappingCommandOutput extends EventSourceMappingCo
114114
* // ErrorCode: "STRING_VALUE",
115115
* // Message: "STRING_VALUE",
116116
* // },
117+
* // EventSourceMappingArn: "STRING_VALUE",
117118
* // };
118119
*
119120
* ```

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface GetPublicAccessBlockConfigCommandInput extends GetPublicAccessB
2828
export interface GetPublicAccessBlockConfigCommandOutput extends GetPublicAccessBlockConfigResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Retrieve the public-access settings for a function.</p>
31+
* <note>
32+
* <p>The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be
33+
* available in all Amazon Web Services Regions until September 30, 2024.</p>
34+
* </note>
35+
* <p>Retrieve the public-access settings for a function.</p>
3236
* @example
3337
* Use a bare-bones client and the command you need to make an API call.
3438
* ```javascript

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface GetResourcePolicyCommandInput extends GetResourcePolicyRequest
2828
export interface GetResourcePolicyCommandOutput extends GetResourcePolicyResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Retrieves the <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a> attached to a function.</p>
31+
* <note>
32+
* <p>The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be
33+
* available in all Amazon Web Services Regions until September 30, 2024.</p>
34+
* </note>
35+
* <p>Retrieves the <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a> attached to a function.</p>
3236
* @example
3337
* Use a bare-bones client and the command you need to make an API call.
3438
* ```javascript

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

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export interface ListEventSourceMappingsCommandOutput extends ListEventSourceMap
120120
* // ErrorCode: "STRING_VALUE",
121121
* // Message: "STRING_VALUE",
122122
* // },
123+
* // EventSourceMappingArn: "STRING_VALUE",
123124
* // },
124125
* // ],
125126
* // };

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export interface ListTagsCommandInput extends ListTagsRequest {}
2828
export interface ListTagsCommandOutput extends ListTagsResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Returns a function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. You can
32-
* also view tags with <a>GetFunction</a>.</p>
31+
* <p>Returns a function, event source mapping, or code signing configuration's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. You can
32+
* also view funciton tags with <a>GetFunction</a>.</p>
3333
* @example
3434
* Use a bare-bones client and the command you need to make an API call.
3535
* ```javascript

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface PutPublicAccessBlockConfigCommandInput extends PutPublicAccessB
2828
export interface PutPublicAccessBlockConfigCommandOutput extends PutPublicAccessBlockConfigResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Configure your function's public-access settings.</p>
31+
* <note>
32+
* <p>The option to configure public-access settings, and to use the PutPublicAccessBlock and GetPublicAccessBlock APIs, won't be
33+
* available in all Amazon Web Services Regions until September 30, 2024.</p>
34+
* </note>
35+
* <p>Configure your function's public-access settings.</p>
3236
* <p>To control public access to a Lambda function, you can choose whether to allow the creation of
3337
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policies</a> that
3438
* allow public access to that function. You can also block public access to a function, even if it has an existing resource-based

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export interface PutResourcePolicyCommandInput extends PutResourcePolicyRequest
2828
export interface PutResourcePolicyCommandOutput extends PutResourcePolicyResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Adds a <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a>
31+
* <note>
32+
* <p>The option to create and modify full JSON resource-based policies, and to use the PutResourcePolicy, GetResourcePolicy, and DeleteResourcePolicy APIs, won't be
33+
* available in all Amazon Web Services Regions until September 30, 2024.</p>
34+
* </note>
35+
* <p>Adds a <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based policy</a>
3236
* to a function. You can use resource-based policies to grant access to other
3337
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/permissions-function-cross-account.html">Amazon Web Services accounts</a>,
3438
* <a href="https://docs.aws.amazon.com/lambda/latest/dg/permissions-function-organization.html">organizations</a>, or

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

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export interface RemovePermissionCommandOutput extends __MetadataBearer {}
7070
* </li>
7171
* </ul>
7272
*
73+
* @throws {@link PublicPolicyException} (client fault)
74+
* <p>Lambda prevented your policy from being created because it would grant public access to your function. If you intended to
75+
* create a public policy, use the <a>PutPublicAccessBlockConfig</a> API action to configure your function's public-access settings
76+
* to allow public policies.</p>
77+
*
7378
* @throws {@link ResourceNotFoundException} (client fault)
7479
* <p>The resource specified in the request does not exist.</p>
7580
*

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface TagResourceCommandInput extends TagResourceRequest {}
2828
export interface TagResourceCommandOutput extends __MetadataBearer {}
2929

3030
/**
31-
* <p>Adds <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a> to a function.</p>
31+
* <p>Adds <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a> to a function, event source mapping, or code signing configuration.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface UntagResourceCommandInput extends UntagResourceRequest {}
2828
export interface UntagResourceCommandOutput extends __MetadataBearer {}
2929

3030
/**
31-
* <p>Removes <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a> from a function.</p>
31+
* <p>Removes <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a> from a function, event source mapping, or code signing configuration.</p>
3232
* @example
3333
* Use a bare-bones client and the command you need to make an API call.
3434
* ```javascript

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

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ export interface UpdateEventSourceMappingCommandOutput extends EventSourceMappin
269269
* // ErrorCode: "STRING_VALUE",
270270
* // Message: "STRING_VALUE",
271271
* // },
272+
* // EventSourceMappingArn: "STRING_VALUE",
272273
* // };
273274
*
274275
* ```

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

+56-38
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export interface AddPermissionRequest {
397397
Action: string | undefined;
398398

399399
/**
400-
* <p>The Amazon Web Servicesservice or Amazon Web Services account that invokes the function. If you specify a
400+
* <p>The Amazon Web Servicesservice, Amazon Web Services account, IAM user, or IAM role that invokes the function. If you specify a
401401
* service, use <code>SourceArn</code> or <code>SourceAccount</code> to limit who can invoke the function through
402402
* that service.</p>
403403
* @public
@@ -466,6 +466,37 @@ export interface AddPermissionResponse {
466466
Statement?: string;
467467
}
468468

469+
/**
470+
* <p>Lambda prevented your policy from being created because it would grant public access to your function. If you intended to
471+
* create a public policy, use the <a>PutPublicAccessBlockConfig</a> API action to configure your function's public-access settings
472+
* to allow public policies.</p>
473+
* @public
474+
*/
475+
export class PublicPolicyException extends __BaseException {
476+
readonly name: "PublicPolicyException" = "PublicPolicyException";
477+
readonly $fault: "client" = "client";
478+
/**
479+
* <p>The exception type.</p>
480+
* @public
481+
*/
482+
Type?: string;
483+
484+
Message?: string;
485+
/**
486+
* @internal
487+
*/
488+
constructor(opts: __ExceptionOptionType<PublicPolicyException, __BaseException>) {
489+
super({
490+
name: "PublicPolicyException",
491+
$fault: "client",
492+
...opts,
493+
});
494+
Object.setPrototypeOf(this, PublicPolicyException.prototype);
495+
this.Type = opts.Type;
496+
this.Message = opts.Message;
497+
}
498+
}
499+
469500
/**
470501
* <p>The <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html">traffic-shifting</a> configuration of a Lambda function alias.</p>
471502
* @public
@@ -687,6 +718,12 @@ export interface CreateCodeSigningConfigRequest {
687718
* @public
688719
*/
689720
CodeSigningPolicies?: CodeSigningPolicies;
721+
722+
/**
723+
* <p>A list of tags to add to the code signing configuration.</p>
724+
* @public
725+
*/
726+
Tags?: Record<string, string>;
690727
}
691728

692729
/**
@@ -1204,6 +1241,12 @@ export interface CreateEventSourceMappingRequest {
12041241
*/
12051242
MaximumRetryAttempts?: number;
12061243

1244+
/**
1245+
* <p>A list of tags to apply to the event source mapping.</p>
1246+
* @public
1247+
*/
1248+
Tags?: Record<string, string>;
1249+
12071250
/**
12081251
* <p>(Kinesis and DynamoDB Streams only) The duration in seconds of a processing window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds indicates no tumbling window.</p>
12091252
* @public
@@ -1496,6 +1539,12 @@ export interface EventSourceMappingConfiguration {
14961539
* @public
14971540
*/
14981541
FilterCriteriaError?: FilterCriteriaError;
1542+
1543+
/**
1544+
* <p>The Amazon Resource Name (ARN) of the event source mapping.</p>
1545+
* @public
1546+
*/
1547+
EventSourceMappingArn?: string;
14991548
}
15001549

15011550
/**
@@ -6070,8 +6119,8 @@ export interface ListProvisionedConcurrencyConfigsResponse {
60706119
*/
60716120
export interface ListTagsRequest {
60726121
/**
6073-
* <p>The function's Amazon Resource Name (ARN).
6074-
* Note: Lambda does not support adding tags to aliases or versions.</p>
6122+
* <p>The resource's Amazon Resource Name (ARN).
6123+
* Note: Lambda does not support adding tags to function aliases or versions.</p>
60756124
* @public
60766125
*/
60776126
Resource: string | undefined;
@@ -6717,37 +6766,6 @@ export interface PutPublicAccessBlockConfigResponse {
67176766
PublicAccessBlockConfig?: PublicAccessBlockConfig;
67186767
}
67196768

6720-
/**
6721-
* <p>Lambda prevented your policy from being created because it would grant public access to your function. If you intended to
6722-
* create a public policy, use the <a>PutPublicAccessBlockConfig</a> API action to configure your function's public-access settings
6723-
* to allow public policies.</p>
6724-
* @public
6725-
*/
6726-
export class PublicPolicyException extends __BaseException {
6727-
readonly name: "PublicPolicyException" = "PublicPolicyException";
6728-
readonly $fault: "client" = "client";
6729-
/**
6730-
* <p>The exception type.</p>
6731-
* @public
6732-
*/
6733-
Type?: string;
6734-
6735-
Message?: string;
6736-
/**
6737-
* @internal
6738-
*/
6739-
constructor(opts: __ExceptionOptionType<PublicPolicyException, __BaseException>) {
6740-
super({
6741-
name: "PublicPolicyException",
6742-
$fault: "client",
6743-
...opts,
6744-
});
6745-
Object.setPrototypeOf(this, PublicPolicyException.prototype);
6746-
this.Type = opts.Type;
6747-
this.Message = opts.Message;
6748-
}
6749-
}
6750-
67516769
/**
67526770
* @public
67536771
*/
@@ -6972,13 +6990,13 @@ export interface RemovePermissionRequest {
69726990
*/
69736991
export interface TagResourceRequest {
69746992
/**
6975-
* <p>The function's Amazon Resource Name (ARN).</p>
6993+
* <p>The resource's Amazon Resource Name (ARN).</p>
69766994
* @public
69776995
*/
69786996
Resource: string | undefined;
69796997

69806998
/**
6981-
* <p>A list of tags to apply to the function.</p>
6999+
* <p>A list of tags to apply to the resource.</p>
69827000
* @public
69837001
*/
69847002
Tags: Record<string, string> | undefined;
@@ -6989,13 +7007,13 @@ export interface TagResourceRequest {
69897007
*/
69907008
export interface UntagResourceRequest {
69917009
/**
6992-
* <p>The function's Amazon Resource Name (ARN).</p>
7010+
* <p>The resource's Amazon Resource Name (ARN).</p>
69937011
* @public
69947012
*/
69957013
Resource: string | undefined;
69967014

69977015
/**
6998-
* <p>A list of tag keys to remove from the function.</p>
7016+
* <p>A list of tag keys to remove from the resource.</p>
69997017
* @public
70007018
*/
70017019
TagKeys: string[] | undefined;

0 commit comments

Comments
 (0)