Skip to main content

functions

Creates, updates, deletes, gets or lists a functions resource.

Overview

Namefunctions
TypeResource
Idaws.mediatailor.functions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the function.
concurrent_executor_configurationobjectThe configuration for a CONCURRENT_EXECUTOR function.
custom_output_configurationobjectThe configuration for a CUSTOM_OUTPUT function.
descriptionstringA description of the function.
function_idstringThe identifier of the function.
function_typestringThe type of the function. (HTTP_REQUEST, CUSTOM_OUTPUT, CONCURRENT_EXECUTOR, SEQUENTIAL_EXECUTOR)
http_request_configurationobjectThe configuration for an HTTP_REQUEST function.
sequential_executor_configurationobjectThe configuration for a SEQUENTIAL_EXECUTOR function.
tagsobjectThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_functionselectfunction_id, regionRetrieves the configuration and metadata for a function. For more information about functions, see Working with functions in the MediaTailor User Guide.
list_functionsselectregionMaxResults, NextTokenRetrieves 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_functionreplacefunction_id, region, FunctionTypeCreates 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_functiondeletefunction_id, regionDeletes 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.

NameDatatypeDescription
function_idstringThe identifier of the function to delete.
regionstringAWS region (default: us-east-1)
MaxResultsintegerThe 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.
NextTokenstringPagination 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

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
;

REPLACE examples

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

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
;