Skip to content

Commit cf1e3be

Browse files
author
awstools
committed
feat(client-lambda): Add InvokedViaFunctionUrl context key to limit invocations to only FURL invokes.
1 parent 23a4236 commit cf1e3be

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met
4949
* RevisionId: "STRING_VALUE",
5050
* PrincipalOrgID: "STRING_VALUE",
5151
* FunctionUrlAuthType: "NONE" || "AWS_IAM",
52+
* InvokedViaFunctionUrl: true || false,
5253
* };
5354
* const command = new AddPermissionCommand(input);
5455
* const response = await client.send(command);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export interface GetProvisionedConcurrencyConfigCommandOutput
8484
* <p>Base exception class for all service exceptions from Lambda service.</p>
8585
*
8686
*
87-
* @example To get a provisioned concurrency configuration
87+
* @example To view a provisioned concurrency configuration
8888
* ```javascript
89-
* // The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.
89+
* // The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.
9090
* const input = {
9191
* FunctionName: "my-function",
9292
* Qualifier: "BLUE"
@@ -104,9 +104,9 @@ export interface GetProvisionedConcurrencyConfigCommandOutput
104104
* *\/
105105
* ```
106106
*
107-
* @example To view a provisioned concurrency configuration
107+
* @example To get a provisioned concurrency configuration
108108
* ```javascript
109-
* // The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.
109+
* // The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.
110110
* const input = {
111111
* FunctionName: "my-function",
112112
* Qualifier: "BLUE"

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ export interface AddPermissionRequest {
406406
* @public
407407
*/
408408
FunctionUrlAuthType?: FunctionUrlAuthType | undefined;
409+
410+
/**
411+
* <p>Restricts the <code>lambda:InvokeFunction</code> action to calls coming from a function URL. When set to <code>true</code>, this prevents the principal from invoking the function by any means other than the function URL. 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>
412+
* @public
413+
*/
414+
InvokedViaFunctionUrl?: boolean | undefined;
409415
}
410416

411417
/**
@@ -661,7 +667,7 @@ export type CodeSigningPolicy = (typeof CodeSigningPolicy)[keyof typeof CodeSign
661667
*/
662668
export interface CodeSigningPolicies {
663669
/**
664-
* <p>Code signing configuration policy for deployment validation failure. If you set the policy to <code>Enforce</code>, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to <code>Warn</code>, Lambda allows the deployment and creates a CloudWatch log. </p> <p>Default value: <code>Warn</code> </p>
670+
* <p>Code signing configuration policy for deployment validation failure. If you set the policy to <code>Enforce</code>, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to <code>Warn</code>, Lambda allows the deployment and issues a new Amazon CloudWatch metric (<code>SignatureValidationErrors</code>) and also stores the warning in the CloudTrail log.</p> <p>Default value: <code>Warn</code> </p>
665671
* @public
666672
*/
667673
UntrustedArtifactOnDeployment?: CodeSigningPolicy | undefined;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export const se_AddPermissionCommand = async (
366366
Action: [],
367367
EventSourceToken: [],
368368
FunctionUrlAuthType: [],
369+
InvokedViaFunctionUrl: [],
369370
Principal: [],
370371
PrincipalOrgID: [],
371372
RevisionId: [],

codegen/sdk-codegen/aws-models/lambda.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,12 @@
17611761
"traits": {
17621762
"smithy.api#documentation": "<p>The type of authentication that your function URL uses. Set to <code>AWS_IAM</code> if you want to restrict access to authenticated 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>"
17631763
}
1764+
},
1765+
"InvokedViaFunctionUrl": {
1766+
"target": "com.amazonaws.lambda#InvokedViaFunctionUrl",
1767+
"traits": {
1768+
"smithy.api#documentation": "<p>Restricts the <code>lambda:InvokeFunction</code> action to calls coming from a function URL. When set to <code>true</code>, this prevents the principal from invoking the function by any means other than the function URL. 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>"
1769+
}
17641770
}
17651771
},
17661772
"traits": {
@@ -2177,7 +2183,7 @@
21772183
"UntrustedArtifactOnDeployment": {
21782184
"target": "com.amazonaws.lambda#CodeSigningPolicy",
21792185
"traits": {
2180-
"smithy.api#documentation": "<p>Code signing configuration policy for deployment validation failure. If you set the policy to <code>Enforce</code>, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to <code>Warn</code>, Lambda allows the deployment and creates a CloudWatch log. </p> <p>Default value: <code>Warn</code> </p>"
2186+
"smithy.api#documentation": "<p>Code signing configuration policy for deployment validation failure. If you set the policy to <code>Enforce</code>, Lambda blocks the deployment request if signature validation checks fail. If you set the policy to <code>Warn</code>, Lambda allows the deployment and issues a new Amazon CloudWatch metric (<code>SignatureValidationErrors</code>) and also stores the warning in the CloudTrail log.</p> <p>Default value: <code>Warn</code> </p>"
21812187
}
21822188
}
21832189
},
@@ -7072,8 +7078,8 @@
70727078
"smithy.api#documentation": "<p>Retrieves the provisioned concurrency configuration for a function's alias or version.</p>",
70737079
"smithy.api#examples": [
70747080
{
7075-
"title": "To get a provisioned concurrency configuration",
7076-
"documentation": "The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.",
7081+
"title": "To view a provisioned concurrency configuration",
7082+
"documentation": "The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.",
70777083
"input": {
70787084
"FunctionName": "my-function",
70797085
"Qualifier": "BLUE"
@@ -7087,8 +7093,8 @@
70877093
}
70887094
},
70897095
{
7090-
"title": "To view a provisioned concurrency configuration",
7091-
"documentation": "The following example displays details for the provisioned concurrency configuration for the BLUE alias of the specified function.",
7096+
"title": "To get a provisioned concurrency configuration",
7097+
"documentation": "The following example returns details for the provisioned concurrency configuration for the BLUE alias of the specified function.",
70927098
"input": {
70937099
"FunctionName": "my-function",
70947100
"Qualifier": "BLUE"
@@ -8172,6 +8178,9 @@
81728178
"smithy.api#streaming": {}
81738179
}
81748180
},
8181+
"com.amazonaws.lambda#InvokedViaFunctionUrl": {
8182+
"type": "boolean"
8183+
},
81758184
"com.amazonaws.lambda#KMSAccessDeniedException": {
81768185
"type": "structure",
81778186
"members": {

0 commit comments

Comments
 (0)