ApiGatewayV2Authorizer
Reference doc for the `sst.aws.ApiGatewayV2Authorizer` component.
The ApiGatewayV2Authorizer
component is internally used by the ApiGatewayV2
component
to add authorizers to Amazon API Gateway HTTP API.
You’ll find this component returned by the addAuthorizer
method of the ApiGatewayV2
component.
Constructor
Parameters
-
name
string
-
args
AuthorizerArgs
-
opts?
ComponentResourceOptions
Properties
id
Type Output
<
string
>
The ID of the authorizer.
nodes
Type Object
The underlying resources this component creates.
nodes.authorizer
Type Authorizer
The API Gateway V2 authorizer.
AuthorizerArgs
api
Type Input
<
Object
>
The API Gateway to use for the route.
api.executionArn
Type Input
<
string
>
The execution ARN of the API Gateway.
api.id
Type Input
<
string
>
The ID of the API Gateway.
api.name
Type Input
<
string
>
The name of the API Gateway.
jwt?
Type Input
<
Object
>
Create a JWT or JSON Web Token authorizer that can be used by the routes.
Configure JWT auth.
You can also use Cognito as the identity provider.
Where userPool
and userPoolClient
are:
jwt.audiences
Type Input
<
Input
<
string
>
[]
>
List of the intended recipients of the JWT. A valid JWT must provide an aud
that matches at least one entry in this list.
jwt.identitySource?
Type Input
<
string
>
Default “$request.header.Authorization”
Specifies where to extract the JWT from the request.
jwt.issuer
Type Input
<
string
>
Base domain of the identity provider that issues JSON Web Tokens.
lambda?
Type Input
<
Object
>
Create a Lambda authorizer that can be used by the routes.
Configure Lambda auth.
lambda.function
Type Input
<
string
|
FunctionArgs
>
The Lambda authorizer function. Takes the handler path or the function args.
Add a simple authorizer.
Customize the authorizer handler.
lambda.identitySources?
Type Input
<
Input
<
string
>
[]
>
Default [“$request.header.Authorization”]
Specifies where to extract the identity from.
lambda.payload?
Type Input
<
“
1.0
”
|
“
2.0
”
>
Default “2.0”
The JWT payload version.
lambda.response?
Type Input
<
“
simple
”
|
“
iam
”
>
Default “simple”
The response type.
lambda.ttl?
Type Input
<
“
${number} minute
”
|
“
${number} minutes
”
|
“
${number} hour
”
|
“
${number} hours
”
|
“
${number} second
”
|
“
${number} seconds
”
>
Default Not cached
The time to live (TTL) for the authorizer.
name
Type string
The name of the authorizer.
transform?
Type Object
Transform how this component creates its underlying resources.
transform.authorizer?
Type AuthorizerArgs
|
(
args
:
AuthorizerArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the API Gateway authorizer resource.
type
Type “
websocket
”
|
“
http
”
The type of the API Gateway.