Skip to main content

authorizers

Creates, updates, deletes or gets an authorizer resource or lists authorizers in a region

Overview

Nameauthorizers
TypeResource
DescriptionThe AWS::ApiGateway::Authorizer resource creates an authorization layer that API Gateway activates for methods that have authorization enabled. API Gateway activates the authorizer when a client calls those methods.
Idawscc.apigateway.authorizers

Fields

NameDatatypeDescription
rest_api_idstring
authorizer_idstring
auth_typestring
authorizer_credentialsstring
authorizer_result_ttl_in_secondsinteger
authorizer_uristring
identity_sourcestring
identity_validation_expressionstring
namestring
provider_arnsarray
typestring
regionstringAWS region.

For more information, see AWS::ApiGateway::Authorizer.

Methods

NameResourceAccessible byRequired Params
create_resourceauthorizersINSERTRestApiId, Type, Name, region
delete_resourceauthorizersDELETEIdentifier, region
update_resourceauthorizersUPDATEIdentifier, PatchDocument, region
list_resourcesauthorizers_list_onlySELECTregion
get_resourceauthorizersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual authorizer.

SELECT
region,
rest_api_id,
authorizer_id,
auth_type,
authorizer_credentials,
authorizer_result_ttl_in_seconds,
authorizer_uri,
identity_source,
identity_validation_expression,
name,
provider_arns,
type
FROM awscc.apigateway.authorizers
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ authorizer_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new authorizer resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.apigateway.authorizers (
RestApiId,
Name,
Type,
region
)
SELECT
'{{ rest_api_id }}',
'{{ name }}',
'{{ type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a authorizer resource, using stack-deploy.

/*+ update */
UPDATE awscc.apigateway.authorizers
SET PatchDocument = string('{{ {
"AuthType": auth_type,
"AuthorizerCredentials": authorizer_credentials,
"AuthorizerResultTtlInSeconds": authorizer_result_ttl_in_seconds,
"AuthorizerUri": authorizer_uri,
"IdentitySource": identity_source,
"IdentityValidationExpression": identity_validation_expression,
"Name": name,
"ProviderARNs": provider_arns,
"Type": type
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rest_api_id }}|{{ authorizer_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.apigateway.authorizers
WHERE
Identifier = '{{ rest_api_id }}|{{ authorizer_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the authorizers resource, the following permissions are required:

apigateway:POST,
iam:PassRole