WebFunctionEndpointGrants Facade
Collection of grant methods for a WebFunction endpoint.
| Source | aws-lambda/lib/webfunction-endpoint-grants.ts |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
import { aws_lambda as interfaces_lambda } from 'aws-cdk-lib/interfaces';
declare const webFunctionEndpointRef: interfaces_lambda.IWebFunctionEndpointRef;
const webFunctionEndpointGrants = lambda.WebFunctionEndpointGrants.fromWebFunctionEndpoint(webFunctionEndpointRef);
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda as lambda_
from aws_cdk.interfaces import aws_lambda as interfaces_lambda
# web_function_endpoint_ref: interfaces_lambda.IWebFunctionEndpointRef
web_function_endpoint_grants = lambda_.WebFunctionEndpointGrants.from_web_function_endpoint(web_function_endpoint_ref)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.interfaces.lambda.*;
IWebFunctionEndpointRef webFunctionEndpointRef;
WebFunctionEndpointGrants webFunctionEndpointGrants = WebFunctionEndpointGrants.fromWebFunctionEndpoint(webFunctionEndpointRef);
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda;
using Amazon.CDK.Interfaces.Lambda;
IWebFunctionEndpointRef webFunctionEndpointRef;
var webFunctionEndpointGrants = WebFunctionEndpointGrants.FromWebFunctionEndpoint(webFunctionEndpointRef);
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
var webFunctionEndpointRef IWebFunctionEndpointRef
webFunctionEndpointGrants := awscdk.Aws_lambda.WebFunctionEndpointGrants_FromWebFunctionEndpoint(webFunctionEndpointRef)
Methods
fromWebFunctionEndpoint(endpoint: IWebFunctionEndpointRef): WebFunctionEndpointGrants // chainable@staticmethod def from_web_function_endpoint(endpoint: IWebFunctionEndpointRef) -> WebFunctionEndpointGrantspublic static WebFunctionEndpointGrants fromWebFunctionEndpoint(IWebFunctionEndpointRef endpoint)public static WebFunctionEndpointGrants FromWebFunctionEndpoint(IWebFunctionEndpointRef endpoint)func FromWebFunctionEndpoint(Endpoint IWebFunctionEndpointRef) WebFunctionEndpointGrants static #Creates grants for a WebFunction endpoint.
invoke(grantee: IGrantable): Grantdef invoke(self, grantee: IGrantable) -> Grantpublic Grant invoke(IGrantable grantee)public Grant Invoke(IGrantable grantee)func Invoke(Grantee IGrantable) Grant #Grants permission to invoke the endpoint over HTTP.
notes
Only meaningful for an endpoint with WebFunctionAuthType.IAM_AUTH; requests to it must be signed by the grantee.
A role or user in this account gets the permission in its own policy. Any other grantee, such as a service principal or another account, gets a statement in the resource-based policy of the WebFunction the endpoint serves, which requires that function to be defined in this app.