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 Amazon AppSync DataSource.

nodes.function

Type Output<Function>

The Lambda function used by the data source.

AuthorizerArgs

api

Type Input<Object>

The api to use for the route.

api.executionArn

Type Input<string>

The execution ARN of the api.

api.id

Type Input<string>

The ID of the api.

api.name

Type Input<string>

The name of the api.

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",
tokenFunction: "src/authorizer.index",
}

requestFunction?

Type Input<string | FunctionArgs>

The Lambda REQUEST authorizer function.

{
name: "myAuthorizer",
requestFunction: "src/authorizer.index",
}

tokenFunction?

Type Input<string | FunctionArgs>

The Lambda TOKEN authorizer function.

{
name: "myAuthorizer",
tokenFunction: "src/authorizer.index",
}

transform?

Type Object

Transform how this component creates its underlying resources.

transform.authorizer?

Type AuthorizerArgs | (args: AuthorizerArgs => 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 for the authorizer.

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

Where userPool is:

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