Skip to content

ApiGatewayV1Authorizer

Reference doc for the `sst.aws.ApiGatewayV1Authorizer` component.

The ApiGatewayV1Authorizer component is internally used by the ApiGatewayV1 component to add authorizers to Amazon API Gateway REST API.

You’ll find this component returned by the addAuthorizer method of the ApiGatewayV1 component.


Constructor

new ApiGatewayV1Authorizer(name, args, opts?)

Parameters

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 Authorizer.

nodes.function

Type Output<Function>

The Lambda function used by the 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.

identitySource?

Type Input<string>

Default “method.request.header.Authorization”

Specifies where to extract the authorization token from the request.

{
identitySource: "method.request.header.AccessToken"
}

name

Type string

The name of the authorizer.

{
name: "myAuthorizer"
}

requestFunction?

Type Input<string | FunctionArgs>

The Lambda request authorizer function. Takes the handler path or the function args.

{
requestFunction: "src/authorizer.index"
}

tokenFunction?

Type Input<string | FunctionArgs>

The Lambda token authorizer function. Takes the handler path or the function args.

{
tokenFunction: "src/authorizer.index"
}

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.

ttl?

Type Input<number>

Default 300

Time to live for cached authorizer results in seconds.

{
ttl: 30
}

userPools?

Type Input<Input<string>[]>

A list of user pools used as the authorizer.

{
name: "myAuthorizer",
userPools: [userPool.arn]
}

Where userPool is:

const userPool = new aws.cognito.UserPool();