Skip to main content

authorizers

Creates, updates, deletes, gets or lists an authorizers resource.

Overview

Nameauthorizers
TypeResource
Idaws.iot.authorizers

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
authorizer_arnstringThe authorizer ARN.
authorizer_function_arnstringThe authorizer's Lambda function ARN. (pattern: <code>[\s\S]*</code>)
authorizer_namestringThe authorizer name. (pattern: <code>[\w=,@-]+</code>)
creation_datestring (date-time)The UNIX timestamp of when the authorizer was created.
enable_caching_for_httpbooleanWhen true, the result from the authorizer’s Lambda function is cached for the time specified in refreshAfterInSeconds. The cached result is used while the device reuses the same HTTP connection.
last_modified_datestring (date-time)The UNIX timestamp of when the authorizer was last updated.
signing_disabledbooleanSpecifies whether IoT validates the token signature in an authorization request.
statusstringThe status of the authorizer. (ACTIVE, INACTIVE)
token_key_namestringThe key used to extract the token from the HTTP headers. (pattern: <code>[a-zA-Z0-9_-]+</code>)
token_signing_public_keysobjectThe public keys used to validate the token signature returned by your custom authentication service.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_authorizerselectauthorizer_name, regionDescribes an authorizer. Requires permission to access the DescribeAuthorizer action.
list_authorizersselectregionpageSize, marker, isAscendingOrder, statusLists the authorizers registered in your account. Requires permission to access the ListAuthorizers action.
create_authorizerinsertauthorizer_name, region, authorizerFunctionArnCreates an authorizer. Requires permission to access the CreateAuthorizer action.
update_authorizerupdateauthorizer_name, regionUpdates an authorizer. Requires permission to access the UpdateAuthorizer action.
delete_authorizerdeleteauthorizer_name, regionDeletes an authorizer. Requires permission to access the DeleteAuthorizer action.
test_invoke_authorizerexecauthorizer_name, regionTests a custom authorization behavior by invoking a specified custom authorizer. Use this to test and debug the custom authorization behavior of devices that connect to the IoT device gateway. Requires permission to access the TestInvokeAuthorizer action.

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
authorizer_namestringThe custom authorizer name.
regionstringAWS region (default: us-east-1)
isAscendingOrderbooleanReturn the list of authorizers in ascending alphabetical order.
markerstringA marker used to get the next set of results.
pageSizeintegerThe maximum number of results to return at one time.
statusstringThe status of the list authorizers request.

SELECT examples

Describes an authorizer. Requires permission to access the DescribeAuthorizer action.

SELECT
authorizer_arn,
authorizer_function_arn,
authorizer_name,
creation_date,
enable_caching_for_http,
last_modified_date,
signing_disabled,
status,
token_key_name,
token_signing_public_keys
FROM aws.iot.authorizers
WHERE authorizer_name = '{{ authorizer_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an authorizer. Requires permission to access the CreateAuthorizer action.

INSERT INTO aws.iot.authorizers (
authorizerFunctionArn,
tokenKeyName,
tokenSigningPublicKeys,
status,
tags,
signingDisabled,
enableCachingForHttp,
authorizer_name,
region
)
SELECT
'{{ authorizerFunctionArn }}' /* required */,
'{{ tokenKeyName }}',
'{{ tokenSigningPublicKeys }}',
'{{ status }}',
'{{ tags }}',
{{ signingDisabled }},
{{ enableCachingForHttp }},
'{{ authorizer_name }}',
'{{ region }}'
RETURNING
authorizer_arn,
authorizer_name
;

UPDATE examples

Updates an authorizer. Requires permission to access the UpdateAuthorizer action.

UPDATE aws.iot.authorizers
SET
authorizerFunctionArn = '{{ authorizerFunctionArn }}',
tokenKeyName = '{{ tokenKeyName }}',
tokenSigningPublicKeys = '{{ tokenSigningPublicKeys }}',
status = '{{ status }}',
enableCachingForHttp = {{ enableCachingForHttp }}
WHERE
authorizer_name = '{{ authorizer_name }}' --required
AND region = '{{ region }}' --required
RETURNING
authorizer_arn,
authorizer_name;

DELETE examples

Deletes an authorizer. Requires permission to access the DeleteAuthorizer action.

DELETE FROM aws.iot.authorizers
WHERE authorizer_name = '{{ authorizer_name }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Tests a custom authorization behavior by invoking a specified custom authorizer. Use this to test and debug the custom authorization behavior of devices that connect to the IoT device gateway. Requires permission to access the TestInvokeAuthorizer action.

EXEC aws.iot.authorizers.test_invoke_authorizer
@authorizer_name='{{ authorizer_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"token": "{{ token }}",
"tokenSignature": "{{ tokenSignature }}",
"httpContext": "{{ httpContext }}",
"mqttContext": "{{ mqttContext }}",
"tlsContext": "{{ tlsContext }}"
}'
;