alias
Creates, updates, deletes, gets or lists an alias resource.
Overview
| Name | alias |
| Type | Resource |
| Id | aws.lambda.alias |
Fields
The following fields are returned by SELECT queries:
- get_alias
| Name | Datatype | Description |
|---|---|---|
alias_arn | string | The Amazon Resource Name (ARN) of the alias. (pattern: <code>arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:function:[a-zA-Z0-9-]+(:($LATEST|[a-zA-Z0-9-]+))?</code>) |
description | string | A description of the alias. |
function_version | string | The function version that the alias invokes. (pattern: <code>($LATEST|[0-9]+)</code>) |
name | string | The name of the alias. (pattern: <code>(?!^[0-9]+$)([a-zA-Z0-9-_]+)</code>) |
revision_id | string | A unique identifier that changes when you update the alias. |
routing_config | object | The traffic-shifting configuration of a Lambda function alias. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_alias | select | function_name, name, region | Returns details about a Lambda function alias. | |
create_alias | insert | function_name, region, FunctionVersion | Creates an alias for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version. You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives. | |
update_alias | update | function_name, name, region | Updates the configuration of a Lambda function alias. | |
delete_alias | delete | function_name, name, region | Deletes a Lambda function alias. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
function_name | string | The name or ARN of the Lambda function. Name formats Function name - MyFunction. Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. Partial ARN - 123456789012:function:MyFunction. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. |
name | string | The name of the alias. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_alias
Returns details about a Lambda function alias.
SELECT
alias_arn,
description,
function_version,
name,
revision_id,
routing_config
FROM aws.lambda.alias
WHERE function_name = '{{ function_name }}' -- required
AND name = '{{ name }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_alias
- Manifest
Creates an alias for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version. You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives.
INSERT INTO aws.lambda.alias (
Name,
FunctionVersion,
Description,
RoutingConfig,
function_name,
region
)
SELECT
'{{ Name }}',
'{{ FunctionVersion }}' /* required */,
'{{ Description }}',
'{{ RoutingConfig }}',
'{{ function_name }}',
'{{ region }}'
RETURNING
alias_arn,
description,
function_version,
name,
revision_id,
routing_config
;
# Description fields are for documentation purposes
- name: alias
props:
- name: function_name
value: "{{ function_name }}"
description: Required parameter for the alias resource.
- name: region
value: "{{ region }}"
description: Required parameter for the alias resource.
- name: Name
value: "{{ Name }}"
- name: FunctionVersion
value: "{{ FunctionVersion }}"
- name: Description
value: "{{ Description }}"
- name: RoutingConfig
description: |
The traffic-shifting configuration of a Lambda function alias.
value:
AdditionalVersionWeights: "{{ AdditionalVersionWeights }}"
UPDATE examples
- update_alias
Updates the configuration of a Lambda function alias.
UPDATE aws.lambda.alias
SET
FunctionVersion = '{{ FunctionVersion }}',
Description = '{{ Description }}',
RoutingConfig = '{{ RoutingConfig }}',
RevisionId = '{{ RevisionId }}'
WHERE
function_name = '{{ function_name }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
RETURNING
alias_arn,
description,
function_version,
name,
revision_id,
routing_config;
DELETE examples
- delete_alias
Deletes a Lambda function alias.
DELETE FROM aws.lambda.alias
WHERE function_name = '{{ function_name }}' --required
AND name = '{{ name }}' --required
AND region = '{{ region }}' --required
;