LambdaWeb / Client / create_web_function_endpoint
create_web_function_endpoint¶
- LambdaWeb.Client.create_web_function_endpoint(**kwargs)¶
Creates an endpoint for a web function. An endpoint exposes the web function over HTTPS and routes traffic to one or more revisions.
To use this operation, you must have the
CreateWebFunctionEndpointpermission on the web function, not on the endpoint being created.See also: AWS API Documentation
Request Syntax
response = client.create_web_function_endpoint( functionName='string', endpointName='string', description='string', endpointType='HomeRegion'|'MultiRegion'|'PerRegion', authType='ApplicationManaged'|'IamAuth', autoDeploymentMode='LatestRevision'|'Disabled', revisionWeights=[ { 'revisionId': 'string', 'weight': 123 }, ], regions=[ 'string', ], scalingConfig={ 'maxEnvironments': 123 }, throttleConfig={ 'rateLimit': 123 } )
- Parameters:
functionName (string) –
[REQUIRED]
The web function to create the endpoint for.
You can specify either of the following:
The function name, for example
my-function.The function ARN.
The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.
endpointName (string) –
[REQUIRED]
The name of the endpoint to create. The name can contain letters, numbers, hyphens (-), and underscores (_), and can’t begin or end with a hyphen or an underscore. The name is limited to 64 characters in length.
description (string) – A description of the endpoint.
endpointType (string) –
[REQUIRED]
The type of endpoint to create. Determines how traffic is served and routed across Regions.
Valid values:
HomeRegion– Serves traffic from the Region where you created the web function.MultiRegion– Replicates across the Regions that you choose and routes each request to the nearest one.PerRegion– Creates a separate endpoint in each Region that you choose.
authType (string) –
[REQUIRED]
The authorization type for the endpoint.
Valid values:
ApplicationManaged– Your application handles authorization.IamAuth– Lambda uses IAM to authorize requests, which must be signed with Signature Version 4 (SigV4).
autoDeploymentMode (string) –
The auto-deployment mode for the endpoint. Controls whether the endpoint automatically serves the newest revision. If you don’t specify a value, the default is
Disabled, and this default is returned in the response.Valid values:
LatestRevision– The endpoint automatically serves the newest revision.Disabled– Revision routing stays fixed until you change it.
revisionWeights (list) –
A list of revision weights that determine how traffic is distributed across revisions. You can specify up to two revisions for canary or blue-green deployments.
(dict) –
Specifies a revision and its traffic weight for an endpoint. You can assign weights to up to two revisions to split traffic for canary or blue-green deployments.
revisionId (string) – [REQUIRED]
The identifier of the revision.
weight (integer) – [REQUIRED]
The percentage of traffic to route to this revision. Minimum value of 1, maximum value of 100.
regions (list) –
The list of Regions for the endpoint. Required when the endpoint type is
MultiRegionorPerRegion: specify at least one Region other than the Region where you create the endpoint (the home Region). The home Region is added automatically if you don’t include it; specifying only the home Region isn’t allowed. When the endpoint type isHomeRegion, omit this field or specify only the home Region.(string) –
scalingConfig (dict) –
The scaling configuration for the endpoint. There is no default value. If you don’t specify a scaling configuration, it is absent from the response.
maxEnvironments (integer) –
The maximum number of concurrent execution environments for the endpoint. Minimum value of 2, maximum value of 10000. There is no default value. If you don’t specify a value, the scaling configuration is absent from the response. On an update, omit
scalingConfigto keep the current value, or specify an empty object to clear a previously set value.
throttleConfig (dict) –
The throttling configuration for the endpoint. There is no default value. If you don’t specify a throttling configuration, it is absent from the response.
rateLimit (integer) –
The maximum request rate per second for the endpoint. The value must be one of the following supported values:
0,100,200,300,400,500,600,700,800,900,1000,2000,3000,4000,5000,6000,7000,8000,9000, or10000. The maximum effective value is also bounded by your account-level maximum total rate limit. There is no default value. If you don’t specify a value, the throttling configuration is absent from the response. On an update, omitthrottleConfigto keep the current value, or specify an empty object to clear a previously set value.
- Return type:
dict
- Returns:
Response Syntax
{ 'functionArn': 'string', 'endpointArn': 'string', 'endpointName': 'string', 'description': 'string', 'endpointType': 'HomeRegion'|'MultiRegion'|'PerRegion', 'domainName': 'string', 'authType': 'ApplicationManaged'|'IamAuth', 'autoDeploymentMode': 'LatestRevision'|'Disabled', 'revisionWeights': [ { 'revisionId': 'string', 'weight': 123 }, ], 'regions': [ 'string', ], 'scalingConfig': { 'maxEnvironments': 123 }, 'throttleConfig': { 'rateLimit': 123 }, 'state': 'Pending'|'Active'|'Failed'|'Deleting', 'stateReason': 'string', 'updateStatus': 'InProgress'|'Successful'|'Failed', 'updateStatusReason': 'string', 'regionalEndpoints': { 'string': { 'domainName': 'string', 'authType': 'ApplicationManaged'|'IamAuth', 'revisionWeights': [ { 'revisionId': 'string', 'weight': 123 }, ], 'scalingConfig': { 'maxEnvironments': 123 }, 'throttleConfig': { 'rateLimit': 123 }, 'state': 'Pending'|'Active'|'Failed'|'Deleting', 'stateReason': 'string', 'updateStatus': 'InProgress'|'Successful'|'Failed', 'updateStatusReason': 'string' } }, 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
Contains details about the created endpoint.
functionArn (string) –
The Amazon Resource Name (ARN) of the web function.
endpointArn (string) –
The Amazon Resource Name (ARN) of the endpoint.
endpointName (string) –
The name of the endpoint.
description (string) –
The description of the endpoint.
endpointType (string) –
The type of a web function endpoint.
Valid values:
HomeRegion– Serves traffic from the Region where you created the web function.MultiRegion– Replicates across the Regions that you choose and routes each request to the nearest one.PerRegion– Creates a separate endpoint in each Region that you choose.
domainName (string) –
The domain name assigned to the endpoint.
authType (string) –
The authorization type for a web function endpoint.
Valid values:
ApplicationManaged– Your application handles authorization.IamAuth– Lambda uses IAM to authorize requests, which must be signed with Signature Version 4 (SigV4).
autoDeploymentMode (string) –
The auto-deployment mode for a web function endpoint.
Valid values:
LatestRevision– The endpoint automatically serves the newest revision.Disabled– Revision routing stays fixed until you change it.
revisionWeights (list) –
The traffic distribution across revisions for the endpoint. Each entry maps a revision to a weight from 1 to 100.
(dict) –
Specifies a revision and its traffic weight for an endpoint. You can assign weights to up to two revisions to split traffic for canary or blue-green deployments.
revisionId (string) –
The identifier of the revision.
weight (integer) –
The percentage of traffic to route to this revision. Minimum value of 1, maximum value of 100.
regions (list) –
The Regions configured for the endpoint.
(string) –
scalingConfig (dict) –
The scaling configuration for a web function endpoint.
maxEnvironments (integer) –
The maximum number of concurrent execution environments for the endpoint. Minimum value of 2, maximum value of 10000. There is no default value. If you don’t specify a value, the scaling configuration is absent from the response. On an update, omit
scalingConfigto keep the current value, or specify an empty object to clear a previously set value.
throttleConfig (dict) –
The throttling configuration for a web function endpoint.
rateLimit (integer) –
The maximum request rate per second for the endpoint. The value must be one of the following supported values:
0,100,200,300,400,500,600,700,800,900,1000,2000,3000,4000,5000,6000,7000,8000,9000, or10000. The maximum effective value is also bounded by your account-level maximum total rate limit. There is no default value. If you don’t specify a value, the throttling configuration is absent from the response. On an update, omitthrottleConfigto keep the current value, or specify an empty object to clear a previously set value.
state (string) –
The current state of the endpoint.
stateReason (string) –
The reason for the current state of the endpoint.
updateStatus (string) –
The status of the most recent update to an endpoint. Possible values:
InProgress– The update is in progress.Successful– The update completed successfully.Failed– The update failed.
updateStatusReason (string) –
The reason for the endpoint’s most recent update status.
regionalEndpoints (dict) –
The list of regional endpoint configurations.
(string) –
(dict) –
Represents the endpoint configuration and state in a specific Region.
domainName (string) –
The domain name of the regional endpoint.
authType (string) –
The authorization type for the regional endpoint.
revisionWeights (list) –
The revision weights for the regional endpoint.
(dict) –
Specifies a revision and its traffic weight for an endpoint. You can assign weights to up to two revisions to split traffic for canary or blue-green deployments.
revisionId (string) –
The identifier of the revision.
weight (integer) –
The percentage of traffic to route to this revision. Minimum value of 1, maximum value of 100.
scalingConfig (dict) –
The scaling configuration for the regional endpoint. This field is absent if the endpoint has no scaling configuration.
maxEnvironments (integer) –
The maximum number of concurrent execution environments for the endpoint. Minimum value of 2, maximum value of 10000. There is no default value. If you don’t specify a value, the scaling configuration is absent from the response. On an update, omit
scalingConfigto keep the current value, or specify an empty object to clear a previously set value.
throttleConfig (dict) –
The throttling configuration for the regional endpoint. This field is absent if the endpoint has no throttling configuration.
rateLimit (integer) –
The maximum request rate per second for the endpoint. The value must be one of the following supported values:
0,100,200,300,400,500,600,700,800,900,1000,2000,3000,4000,5000,6000,7000,8000,9000, or10000. The maximum effective value is also bounded by your account-level maximum total rate limit. There is no default value. If you don’t specify a value, the throttling configuration is absent from the response. On an update, omitthrottleConfigto keep the current value, or specify an empty object to clear a previously set value.
state (string) –
The current state of the regional endpoint.
stateReason (string) –
The reason for the current state of the regional endpoint.
updateStatus (string) –
The status of the most recent update to the regional endpoint.
updateStatusReason (string) –
The reason for the current update status of the regional endpoint.
createdAt (datetime) –
The date and time the endpoint was created.
updatedAt (datetime) –
The date and time the endpoint was last updated.
Exceptions
LambdaWeb.Client.exceptions.AccessDeniedExceptionLambdaWeb.Client.exceptions.ConflictExceptionLambdaWeb.Client.exceptions.InternalServerExceptionLambdaWeb.Client.exceptions.ValidationExceptionLambdaWeb.Client.exceptions.ResourceNotFoundExceptionLambdaWeb.Client.exceptions.ThrottlingExceptionLambdaWeb.Client.exceptions.ServiceQuotaExceededException