functions
Creates, updates, deletes, gets or lists a functions resource.
Overview
| Name | functions |
| Type | Resource |
| Id | aws.mediatailor.functions |
Fields
The following fields are returned by SELECT queries:
- get_function
- list_functions
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the function. |
concurrent_executor_configuration | object | The configuration for a CONCURRENT_EXECUTOR function. |
custom_output_configuration | object | The configuration for a CUSTOM_OUTPUT function. |
description | string | A description of the function. |
function_id | string | The identifier of the function. |
function_type | string | The type of the function. (HTTP_REQUEST, CUSTOM_OUTPUT, CONCURRENT_EXECUTOR, SEQUENTIAL_EXECUTOR) |
http_request_configuration | object | The configuration for an HTTP_REQUEST function. |
sequential_executor_configuration | object | The configuration for a SEQUENTIAL_EXECUTOR function. |
tags | object | The tags assigned to the function. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the function. |
concurrent_executor_configuration | object | The configuration for a CONCURRENT_EXECUTOR function. A CONCURRENT_EXECUTOR runs a set of child functions in parallel, up to a maximum concurrency, and combines their output when all functions complete. For more information about functions, see Working with functions in the MediaTailor User Guide. |
custom_output_configuration | object | The configuration for a CUSTOM_OUTPUT function. MediaTailor evaluates the output expressions against the current session state and commits the results as output bindings. CUSTOM_OUTPUT functions do not make external calls. For more information, see CUSTOM_OUTPUT in the MediaTailor User Guide. |
description | string | A description of the function. |
function_id | string | The identifier of the function. |
function_type | string | -- Define Enums (HTTP_REQUEST, CUSTOM_OUTPUT, CONCURRENT_EXECUTOR, SEQUENTIAL_EXECUTOR) |
http_request_configuration | object | The configuration for an HTTP_REQUEST function. Specifies the HTTP method, URL, headers, body, timeout, and output expressions for the request. For more information, see HTTP_REQUEST in the MediaTailor User Guide. |
sequential_executor_configuration | object | The configuration for a SEQUENTIAL_EXECUTOR function. A SEQUENTIAL_EXECUTOR runs a sequence of child functions in order, passing data between steps through temporary data. For more information, see SEQUENTIAL_EXECUTOR in the MediaTailor User Guide. |
tags | object | The tags assigned to the function. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_function | select | function_id, region | Retrieves the configuration and metadata for a function. For more information about functions, see Working with functions in the MediaTailor User Guide. | |
list_functions | select | region | MaxResults, NextToken | Retrieves all functions associated with your AWS account in the current Region. For more information about functions, see Working with functions in the MediaTailor User Guide. |
put_function | replace | function_id, region, FunctionType | Creates or updates a function. A function defines reusable logic that MediaTailor executes at lifecycle hooks during ad insertion. For more information about functions, see Working with functions in the MediaTailor User Guide. | |
delete_function | delete | function_id, region | Deletes a function. MediaTailor prevents deletion of a function that is still referenced by a playback configuration or by another function. Remove all references before deleting. For more information about functions, see Working with functions in the MediaTailor User Guide. |
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_id | string | The identifier of the function to delete. |
region | string | AWS region (default: us-east-1) |
MaxResults | integer | The maximum number of functions that you want MediaTailor to return in response to the current request. If there are more than MaxResults functions, use the value of NextToken in the response to get the next page of results. The default value is 100. MediaTailor uses token-based pagination, which means that a response might contain fewer than MaxResults items, including 0 items, even when more results are available. To retrieve all results, you must continue making requests using the NextToken value from each response until the response no longer includes a NextToken value. |
NextToken | string | Pagination token returned by the list request when results exceed the maximum allowed. Use the token to fetch the next page of results. For the first ListFunctions request, omit this value. For subsequent requests, get the value of NextToken from the previous response and specify that value for NextToken in the request. Continue making requests until the response no longer includes a NextToken value, which indicates that all results have been retrieved. |
SELECT examples
- get_function
- list_functions
Retrieves the configuration and metadata for a function. For more information about functions, see Working with functions in the MediaTailor User Guide.
SELECT
arn,
concurrent_executor_configuration,
custom_output_configuration,
description,
function_id,
function_type,
http_request_configuration,
sequential_executor_configuration,
tags
FROM aws.mediatailor.functions
WHERE function_id = '{{ function_id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves all functions associated with your AWS account in the current Region. For more information about functions, see Working with functions in the MediaTailor User Guide.
SELECT
arn,
concurrent_executor_configuration,
custom_output_configuration,
description,
function_id,
function_type,
http_request_configuration,
sequential_executor_configuration,
tags
FROM aws.mediatailor.functions
WHERE region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
REPLACE examples
- put_function
Creates or updates a function. A function defines reusable logic that MediaTailor executes at lifecycle hooks during ad insertion. For more information about functions, see Working with functions in the MediaTailor User Guide.
REPLACE aws.mediatailor.functions
SET
FunctionType = '{{ FunctionType }}',
Description = '{{ Description }}',
HttpRequestConfiguration = '{{ HttpRequestConfiguration }}',
CustomOutputConfiguration = '{{ CustomOutputConfiguration }}',
ConcurrentExecutorConfiguration = '{{ ConcurrentExecutorConfiguration }}',
SequentialExecutorConfiguration = '{{ SequentialExecutorConfiguration }}',
Tags = '{{ Tags }}'
WHERE
function_id = '{{ function_id }}' --required
AND region = '{{ region }}' --required
AND FunctionType = '{{ FunctionType }}' --required
RETURNING
arn,
concurrent_executor_configuration,
custom_output_configuration,
description,
function_id,
function_type,
http_request_configuration,
sequential_executor_configuration,
tags;
DELETE examples
- delete_function
Deletes a function. MediaTailor prevents deletion of a function that is still referenced by a playback configuration or by another function. Remove all references before deleting. For more information about functions, see Working with functions in the MediaTailor User Guide.
DELETE FROM aws.mediatailor.functions
WHERE function_id = '{{ function_id }}' --required
AND region = '{{ region }}' --required
;