Show / Hide Table of Contents

Class RequestAuthorizer

Request-based lambda authorizer that recognizes the caller's identity via request parameters, such as headers, paths, query strings, stage variables, or context variables.

Inheritance
System.Object
Resource
Authorizer
RequestAuthorizer
Implements
IResource
Constructs.IConstruct
Constructs.IDependable
IAuthorizer
Inherited Members
Authorizer.IsAuthorizer(Object)
Authorizer.AuthorizationType
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class RequestAuthorizer : Authorizer, IResource, IAuthorizer
Syntax (vb)
Public Class RequestAuthorizer
    Inherits Authorizer
    Implements IResource, IAuthorizer
Remarks

Based on the request, authorization is performed by a lambda function.

Resource: AWS::ApiGateway::Authorizer

ExampleMetadata: infused

Examples
Function authFn;
Resource books;


var auth = new RequestAuthorizer(this, "booksAuthorizer", new RequestAuthorizerProps {
    Handler = authFn,
    IdentitySources = new [] { IdentitySource.Header("Authorization") }
});

books.AddMethod("GET", new HttpIntegration("http://amazon.com"), new MethodOptions {
    Authorizer = auth
});

Synopsis

Constructors

RequestAuthorizer(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

RequestAuthorizer(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

RequestAuthorizer(Construct, String, IRequestAuthorizerProps)

Properties

AuthorizerArn

The ARN of the authorizer to be used in permission policies, such as IAM and resource-based grants.

AuthorizerId

The id of the authorizer.

AuthorizerProps
Handler

The Lambda function handler that this authorizer uses.

RestApiId
Role

The IAM role that the API Gateway service assumes while invoking the Lambda function.

Methods

LazyRestApiId()

Returns a token that resolves to the Rest Api Id at the time of synthesis.

SetupPermissions()

Sets up the permissions necessary for the API Gateway service to invoke the Lambda function.

Constructors

RequestAuthorizer(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected RequestAuthorizer(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

RequestAuthorizer(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected RequestAuthorizer(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

RequestAuthorizer(Construct, String, IRequestAuthorizerProps)

public RequestAuthorizer(Construct scope, string id, IRequestAuthorizerProps props)
Parameters
scope Constructs.Construct
id System.String
props IRequestAuthorizerProps

Properties

AuthorizerArn

The ARN of the authorizer to be used in permission policies, such as IAM and resource-based grants.

public virtual string AuthorizerArn { get; }
Property Value

System.String

AuthorizerId

The id of the authorizer.

public override string AuthorizerId { get; }
Property Value

System.String

Overrides
Authorizer.AuthorizerId

AuthorizerProps

protected virtual ICfnAuthorizerProps AuthorizerProps { get; }
Property Value

ICfnAuthorizerProps

Handler

The Lambda function handler that this authorizer uses.

protected virtual IFunction Handler { get; }
Property Value

IFunction

RestApiId

protected virtual string RestApiId { get; set; }
Property Value

System.String

Role

The IAM role that the API Gateway service assumes while invoking the Lambda function.

protected virtual IRole Role { get; }
Property Value

IRole

Methods

LazyRestApiId()

Returns a token that resolves to the Rest Api Id at the time of synthesis.

protected virtual string LazyRestApiId()
Returns

System.String

Remarks

Throws an error, during token resolution, if no RestApi is attached to this authorizer.

SetupPermissions()

Sets up the permissions necessary for the API Gateway service to invoke the Lambda function.

protected virtual void SetupPermissions()

Implements

IResource
Constructs.IConstruct
Constructs.IDependable
IAuthorizer
Back to top Generated by DocFX