Skip to content

Commit e1ff422

Browse files
author
awstools
committed
feat(client-lambda): Reverting Lambda resource-based policy and block public access APIs.
1 parent 9dfcfe8 commit e1ff422

18 files changed

+21
-1723
lines changed

clients/client-lambda/README.md

-40
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,6 @@ DeleteProvisionedConcurrencyConfig
403403

404404
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/DeleteProvisionedConcurrencyConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/DeleteProvisionedConcurrencyConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/DeleteProvisionedConcurrencyConfigCommandOutput/)
405405

406-
</details>
407-
<details>
408-
<summary>
409-
DeleteResourcePolicy
410-
</summary>
411-
412-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/DeleteResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/DeleteResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/DeleteResourcePolicyCommandOutput/)
413-
414406
</details>
415407
<details>
416408
<summary>
@@ -539,22 +531,6 @@ GetProvisionedConcurrencyConfig
539531

540532
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/GetProvisionedConcurrencyConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetProvisionedConcurrencyConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetProvisionedConcurrencyConfigCommandOutput/)
541533

542-
</details>
543-
<details>
544-
<summary>
545-
GetPublicAccessBlockConfig
546-
</summary>
547-
548-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/GetPublicAccessBlockConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetPublicAccessBlockConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetPublicAccessBlockConfigCommandOutput/)
549-
550-
</details>
551-
<details>
552-
<summary>
553-
GetResourcePolicy
554-
</summary>
555-
556-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/GetResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetResourcePolicyCommandOutput/)
557-
558534
</details>
559535
<details>
560536
<summary>
@@ -739,22 +715,6 @@ PutProvisionedConcurrencyConfig
739715

740716
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/PutProvisionedConcurrencyConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutProvisionedConcurrencyConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutProvisionedConcurrencyConfigCommandOutput/)
741717

742-
</details>
743-
<details>
744-
<summary>
745-
PutPublicAccessBlockConfig
746-
</summary>
747-
748-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/PutPublicAccessBlockConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutPublicAccessBlockConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutPublicAccessBlockConfigCommandOutput/)
749-
750-
</details>
751-
<details>
752-
<summary>
753-
PutResourcePolicy
754-
</summary>
755-
756-
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/PutResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutResourcePolicyCommandOutput/)
757-
758718
</details>
759719
<details>
760720
<summary>

clients/client-lambda/src/Lambda.ts

-115
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ import {
7979
DeleteProvisionedConcurrencyConfigCommandInput,
8080
DeleteProvisionedConcurrencyConfigCommandOutput,
8181
} from "./commands/DeleteProvisionedConcurrencyConfigCommand";
82-
import {
83-
DeleteResourcePolicyCommand,
84-
DeleteResourcePolicyCommandInput,
85-
DeleteResourcePolicyCommandOutput,
86-
} from "./commands/DeleteResourcePolicyCommand";
8782
import {
8883
GetAccountSettingsCommand,
8984
GetAccountSettingsCommandInput,
@@ -152,16 +147,6 @@ import {
152147
GetProvisionedConcurrencyConfigCommandInput,
153148
GetProvisionedConcurrencyConfigCommandOutput,
154149
} from "./commands/GetProvisionedConcurrencyConfigCommand";
155-
import {
156-
GetPublicAccessBlockConfigCommand,
157-
GetPublicAccessBlockConfigCommandInput,
158-
GetPublicAccessBlockConfigCommandOutput,
159-
} from "./commands/GetPublicAccessBlockConfigCommand";
160-
import {
161-
GetResourcePolicyCommand,
162-
GetResourcePolicyCommandInput,
163-
GetResourcePolicyCommandOutput,
164-
} from "./commands/GetResourcePolicyCommand";
165150
import {
166151
GetRuntimeManagementConfigCommand,
167152
GetRuntimeManagementConfigCommandInput,
@@ -257,16 +242,6 @@ import {
257242
PutProvisionedConcurrencyConfigCommandInput,
258243
PutProvisionedConcurrencyConfigCommandOutput,
259244
} from "./commands/PutProvisionedConcurrencyConfigCommand";
260-
import {
261-
PutPublicAccessBlockConfigCommand,
262-
PutPublicAccessBlockConfigCommandInput,
263-
PutPublicAccessBlockConfigCommandOutput,
264-
} from "./commands/PutPublicAccessBlockConfigCommand";
265-
import {
266-
PutResourcePolicyCommand,
267-
PutResourcePolicyCommandInput,
268-
PutResourcePolicyCommandOutput,
269-
} from "./commands/PutResourcePolicyCommand";
270245
import {
271246
PutRuntimeManagementConfigCommand,
272247
PutRuntimeManagementConfigCommandInput,
@@ -339,7 +314,6 @@ const commands = {
339314
DeleteFunctionUrlConfigCommand,
340315
DeleteLayerVersionCommand,
341316
DeleteProvisionedConcurrencyConfigCommand,
342-
DeleteResourcePolicyCommand,
343317
GetAccountSettingsCommand,
344318
GetAliasCommand,
345319
GetCodeSigningConfigCommand,
@@ -356,8 +330,6 @@ const commands = {
356330
GetLayerVersionPolicyCommand,
357331
GetPolicyCommand,
358332
GetProvisionedConcurrencyConfigCommand,
359-
GetPublicAccessBlockConfigCommand,
360-
GetResourcePolicyCommand,
361333
GetRuntimeManagementConfigCommand,
362334
InvokeCommand,
363335
InvokeAsyncCommand,
@@ -381,8 +353,6 @@ const commands = {
381353
PutFunctionEventInvokeConfigCommand,
382354
PutFunctionRecursionConfigCommand,
383355
PutProvisionedConcurrencyConfigCommand,
384-
PutPublicAccessBlockConfigCommand,
385-
PutResourcePolicyCommand,
386356
PutRuntimeManagementConfigCommand,
387357
RemoveLayerVersionPermissionCommand,
388358
RemovePermissionCommand,
@@ -663,23 +633,6 @@ export interface Lambda {
663633
cb: (err: any, data?: DeleteProvisionedConcurrencyConfigCommandOutput) => void
664634
): void;
665635

666-
/**
667-
* @see {@link DeleteResourcePolicyCommand}
668-
*/
669-
deleteResourcePolicy(
670-
args: DeleteResourcePolicyCommandInput,
671-
options?: __HttpHandlerOptions
672-
): Promise<DeleteResourcePolicyCommandOutput>;
673-
deleteResourcePolicy(
674-
args: DeleteResourcePolicyCommandInput,
675-
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
676-
): void;
677-
deleteResourcePolicy(
678-
args: DeleteResourcePolicyCommandInput,
679-
options: __HttpHandlerOptions,
680-
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
681-
): void;
682-
683636
/**
684637
* @see {@link GetAccountSettingsCommand}
685638
*/
@@ -932,40 +885,6 @@ export interface Lambda {
932885
cb: (err: any, data?: GetProvisionedConcurrencyConfigCommandOutput) => void
933886
): void;
934887

935-
/**
936-
* @see {@link GetPublicAccessBlockConfigCommand}
937-
*/
938-
getPublicAccessBlockConfig(
939-
args: GetPublicAccessBlockConfigCommandInput,
940-
options?: __HttpHandlerOptions
941-
): Promise<GetPublicAccessBlockConfigCommandOutput>;
942-
getPublicAccessBlockConfig(
943-
args: GetPublicAccessBlockConfigCommandInput,
944-
cb: (err: any, data?: GetPublicAccessBlockConfigCommandOutput) => void
945-
): void;
946-
getPublicAccessBlockConfig(
947-
args: GetPublicAccessBlockConfigCommandInput,
948-
options: __HttpHandlerOptions,
949-
cb: (err: any, data?: GetPublicAccessBlockConfigCommandOutput) => void
950-
): void;
951-
952-
/**
953-
* @see {@link GetResourcePolicyCommand}
954-
*/
955-
getResourcePolicy(
956-
args: GetResourcePolicyCommandInput,
957-
options?: __HttpHandlerOptions
958-
): Promise<GetResourcePolicyCommandOutput>;
959-
getResourcePolicy(
960-
args: GetResourcePolicyCommandInput,
961-
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
962-
): void;
963-
getResourcePolicy(
964-
args: GetResourcePolicyCommandInput,
965-
options: __HttpHandlerOptions,
966-
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
967-
): void;
968-
969888
/**
970889
* @see {@link GetRuntimeManagementConfigCommand}
971890
*/
@@ -1322,40 +1241,6 @@ export interface Lambda {
13221241
cb: (err: any, data?: PutProvisionedConcurrencyConfigCommandOutput) => void
13231242
): void;
13241243

1325-
/**
1326-
* @see {@link PutPublicAccessBlockConfigCommand}
1327-
*/
1328-
putPublicAccessBlockConfig(
1329-
args: PutPublicAccessBlockConfigCommandInput,
1330-
options?: __HttpHandlerOptions
1331-
): Promise<PutPublicAccessBlockConfigCommandOutput>;
1332-
putPublicAccessBlockConfig(
1333-
args: PutPublicAccessBlockConfigCommandInput,
1334-
cb: (err: any, data?: PutPublicAccessBlockConfigCommandOutput) => void
1335-
): void;
1336-
putPublicAccessBlockConfig(
1337-
args: PutPublicAccessBlockConfigCommandInput,
1338-
options: __HttpHandlerOptions,
1339-
cb: (err: any, data?: PutPublicAccessBlockConfigCommandOutput) => void
1340-
): void;
1341-
1342-
/**
1343-
* @see {@link PutResourcePolicyCommand}
1344-
*/
1345-
putResourcePolicy(
1346-
args: PutResourcePolicyCommandInput,
1347-
options?: __HttpHandlerOptions
1348-
): Promise<PutResourcePolicyCommandOutput>;
1349-
putResourcePolicy(
1350-
args: PutResourcePolicyCommandInput,
1351-
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
1352-
): void;
1353-
putResourcePolicy(
1354-
args: PutResourcePolicyCommandInput,
1355-
options: __HttpHandlerOptions,
1356-
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
1357-
): void;
1358-
13591244
/**
13601245
* @see {@link PutRuntimeManagementConfigCommand}
13611246
*/

clients/client-lambda/src/LambdaClient.ts

-24
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ import {
109109
DeleteProvisionedConcurrencyConfigCommandInput,
110110
DeleteProvisionedConcurrencyConfigCommandOutput,
111111
} from "./commands/DeleteProvisionedConcurrencyConfigCommand";
112-
import {
113-
DeleteResourcePolicyCommandInput,
114-
DeleteResourcePolicyCommandOutput,
115-
} from "./commands/DeleteResourcePolicyCommand";
116112
import { GetAccountSettingsCommandInput, GetAccountSettingsCommandOutput } from "./commands/GetAccountSettingsCommand";
117113
import { GetAliasCommandInput, GetAliasCommandOutput } from "./commands/GetAliasCommand";
118114
import {
@@ -162,11 +158,6 @@ import {
162158
GetProvisionedConcurrencyConfigCommandInput,
163159
GetProvisionedConcurrencyConfigCommandOutput,
164160
} from "./commands/GetProvisionedConcurrencyConfigCommand";
165-
import {
166-
GetPublicAccessBlockConfigCommandInput,
167-
GetPublicAccessBlockConfigCommandOutput,
168-
} from "./commands/GetPublicAccessBlockConfigCommand";
169-
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
170161
import {
171162
GetRuntimeManagementConfigCommandInput,
172163
GetRuntimeManagementConfigCommandOutput,
@@ -235,11 +226,6 @@ import {
235226
PutProvisionedConcurrencyConfigCommandInput,
236227
PutProvisionedConcurrencyConfigCommandOutput,
237228
} from "./commands/PutProvisionedConcurrencyConfigCommand";
238-
import {
239-
PutPublicAccessBlockConfigCommandInput,
240-
PutPublicAccessBlockConfigCommandOutput,
241-
} from "./commands/PutPublicAccessBlockConfigCommand";
242-
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
243229
import {
244230
PutRuntimeManagementConfigCommandInput,
245231
PutRuntimeManagementConfigCommandOutput,
@@ -305,7 +291,6 @@ export type ServiceInputTypes =
305291
| DeleteFunctionUrlConfigCommandInput
306292
| DeleteLayerVersionCommandInput
307293
| DeleteProvisionedConcurrencyConfigCommandInput
308-
| DeleteResourcePolicyCommandInput
309294
| GetAccountSettingsCommandInput
310295
| GetAliasCommandInput
311296
| GetCodeSigningConfigCommandInput
@@ -322,8 +307,6 @@ export type ServiceInputTypes =
322307
| GetLayerVersionPolicyCommandInput
323308
| GetPolicyCommandInput
324309
| GetProvisionedConcurrencyConfigCommandInput
325-
| GetPublicAccessBlockConfigCommandInput
326-
| GetResourcePolicyCommandInput
327310
| GetRuntimeManagementConfigCommandInput
328311
| InvokeAsyncCommandInput
329312
| InvokeCommandInput
@@ -347,8 +330,6 @@ export type ServiceInputTypes =
347330
| PutFunctionEventInvokeConfigCommandInput
348331
| PutFunctionRecursionConfigCommandInput
349332
| PutProvisionedConcurrencyConfigCommandInput
350-
| PutPublicAccessBlockConfigCommandInput
351-
| PutResourcePolicyCommandInput
352333
| PutRuntimeManagementConfigCommandInput
353334
| RemoveLayerVersionPermissionCommandInput
354335
| RemovePermissionCommandInput
@@ -383,7 +364,6 @@ export type ServiceOutputTypes =
383364
| DeleteFunctionUrlConfigCommandOutput
384365
| DeleteLayerVersionCommandOutput
385366
| DeleteProvisionedConcurrencyConfigCommandOutput
386-
| DeleteResourcePolicyCommandOutput
387367
| GetAccountSettingsCommandOutput
388368
| GetAliasCommandOutput
389369
| GetCodeSigningConfigCommandOutput
@@ -400,8 +380,6 @@ export type ServiceOutputTypes =
400380
| GetLayerVersionPolicyCommandOutput
401381
| GetPolicyCommandOutput
402382
| GetProvisionedConcurrencyConfigCommandOutput
403-
| GetPublicAccessBlockConfigCommandOutput
404-
| GetResourcePolicyCommandOutput
405383
| GetRuntimeManagementConfigCommandOutput
406384
| InvokeAsyncCommandOutput
407385
| InvokeCommandOutput
@@ -425,8 +403,6 @@ export type ServiceOutputTypes =
425403
| PutFunctionEventInvokeConfigCommandOutput
426404
| PutFunctionRecursionConfigCommandOutput
427405
| PutProvisionedConcurrencyConfigCommandOutput
428-
| PutPublicAccessBlockConfigCommandOutput
429-
| PutResourcePolicyCommandOutput
430406
| PutRuntimeManagementConfigCommandOutput
431407
| RemoveLayerVersionPermissionCommandOutput
432408
| RemovePermissionCommandOutput

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

+2-7
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met
3535
* to version $LATEST.</p>
3636
* <p>To grant permission to another account, specify the account ID as the <code>Principal</code>. To grant
3737
* permission to an organization defined in Organizations, specify the organization ID as the
38-
* <code>PrincipalOrgID</code>. For Amazon Web Servicesservices, the principal is a domain-style identifier that
39-
* the service defines, such as <code>s3.amazonaws.com</code> or <code>sns.amazonaws.com</code>. For Amazon Web Servicesservices, you can also specify the ARN of the associated resource as the <code>SourceArn</code>. If
38+
* <code>PrincipalOrgID</code>. For Amazon Web Services services, the principal is a domain-style identifier that
39+
* the service defines, such as <code>s3.amazonaws.com</code> or <code>sns.amazonaws.com</code>. For Amazon Web Services services, you can also specify the ARN of the associated resource as the <code>SourceArn</code>. If
4040
* you grant permission to a service principal without specifying the source, other accounts could potentially
4141
* configure resources in their account to invoke your Lambda function.</p>
4242
* <p>This operation adds a statement to a resource-based permissions policy for the function. For more information
@@ -93,11 +93,6 @@ 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-
*
10196
* @throws {@link ResourceConflictException} (client fault)
10297
* <p>The resource already exists, or another operation is in progress.</p>
10398
*

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export interface CreateFunctionCommandOutput extends FunctionConfiguration, __Me
3535
/**
3636
* <p>Creates a Lambda function. To create a function, you need a <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html">deployment package</a> and an <a href="https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role">execution role</a>. The
3737
* deployment package is a .zip file archive or container image that contains your function code. The execution role
38-
* grants the function permission to use Amazon Web Servicesservices, such as Amazon CloudWatch Logs for log
38+
* grants the function permission to use Amazon Web Services services, such as Amazon CloudWatch Logs for log
3939
* streaming and X-Ray for request tracing.</p>
4040
* <p>If the deployment package is a <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html">container
4141
* image</a>, then you set the package type to <code>Image</code>. For a container image, the code property
@@ -66,9 +66,9 @@ export interface CreateFunctionCommandOutput extends FunctionConfiguration, __Me
6666
* <a>UpdateFunctionCode</a>, Lambda checks that the code package has a valid signature from
6767
* a trusted publisher. The code-signing configuration includes set of signing profiles, which define the trusted
6868
* publishers for this function.</p>
69-
* <p>If another Amazon Web Services account or an Amazon Web Servicesservice invokes your function, use <a>AddPermission</a> to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.</p>
69+
* <p>If another Amazon Web Services account or an Amazon Web Services service invokes your function, use <a>AddPermission</a> to grant permission by creating a resource-based Identity and Access Management (IAM) policy. You can grant permissions at the function level, on a version, or on an alias.</p>
7070
* <p>To invoke your function directly, use <a>Invoke</a>. To invoke your function in response to events
71-
* in other Amazon Web Servicesservices, create an event source mapping (<a>CreateEventSourceMapping</a>),
71+
* in other Amazon Web Services services, create an event source mapping (<a>CreateEventSourceMapping</a>),
7272
* or configure a function trigger in the other service. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.html">Invoking Lambda
7373
* functions</a>.</p>
7474
* @example

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface DeleteFunctionCommandOutput extends __MetadataBearer {}
3131
* <p>Deletes a Lambda function. To delete a specific function version, use the <code>Qualifier</code> parameter.
3232
* Otherwise, all versions and aliases are deleted. This doesn't require the user to have explicit
3333
* permissions for <a>DeleteAlias</a>.</p>
34-
* <p>To delete Lambda event source mappings that invoke a function, use <a>DeleteEventSourceMapping</a>. For Amazon Web Servicesservices and resources that invoke your function
34+
* <p>To delete Lambda event source mappings that invoke a function, use <a>DeleteEventSourceMapping</a>. For Amazon Web Services services and resources that invoke your function
3535
* directly, delete the trigger in the service where you originally configured it.</p>
3636
* @example
3737
* Use a bare-bones client and the command you need to make an API call.

0 commit comments

Comments
 (0)