Show / Hide Table of Contents

Class Authorizer

Manages an Amazon API Gateway Version 2 authorizer. More information can be found in the Amazon API Gateway Developer Guide.

Example Usage

Basic WebSocket API

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.ApiGatewayV2.Authorizer("example", new Aws.ApiGatewayV2.AuthorizerArgs
    {
        ApiId = aws_apigatewayv2_api.Example.Id,
        AuthorizerType = "REQUEST",
        AuthorizerUri = aws_lambda_function.Example.Invoke_arn,
        IdentitySources = 
        {
            "route.request.header.Auth",
        },
    });
}

}

Basic HTTP API

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var example = new Aws.ApiGatewayV2.Authorizer("example", new Aws.ApiGatewayV2.AuthorizerArgs
    {
        ApiId = aws_apigatewayv2_api.Example.Id,
        AuthorizerType = "JWT",
        IdentitySources = 
        {
            "$$request.header.Authorization",
        },
        JwtConfiguration = new Aws.ApiGatewayV2.Inputs.AuthorizerJwtConfigurationArgs
        {
            Audience = 
            {
                "example",
            },
            Issuer = $"https://{aws_cognito_user_pool.Example.Endpoint}",
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Authorizer
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.ApiGatewayV2
Assembly: Pulumi.Aws.dll
Syntax
public class Authorizer : CustomResource

Constructors

View Source

Authorizer(String, AuthorizerArgs, CustomResourceOptions)

Create a Authorizer resource with the given unique name, arguments, and options.

Declaration
public Authorizer(string name, AuthorizerArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

AuthorizerArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ApiId

The API identifier.

Declaration
public Output<string> ApiId { get; }
Property Value
Type Description
Output<System.String>
View Source

AuthorizerCredentialsArn

The required credentials as an IAM role for API Gateway to invoke the authorizer. Supported only for REQUEST authorizers.

Declaration
public Output<string> AuthorizerCredentialsArn { get; }
Property Value
Type Description
Output<System.String>
View Source

AuthorizerType

The authorizer type. Valid values: JWT, REQUEST. For WebSocket APIs, specify REQUEST for a Lambda function using incoming request parameters. For HTTP APIs, specify JWT to use JSON Web Tokens.

Declaration
public Output<string> AuthorizerType { get; }
Property Value
Type Description
Output<System.String>
View Source

AuthorizerUri

The authorizer's Uniform Resource Identifier (URI). For REQUEST authorizers this must be a well-formed Lambda function URI, such as the invoke_arn attribute of the aws.lambda.Function resource. Supported only for REQUEST authorizers.

Declaration
public Output<string> AuthorizerUri { get; }
Property Value
Type Description
Output<System.String>
View Source

IdentitySources

The identity sources for which authorization is requested. For REQUEST authorizers the value is a list of one or more mapping expressions of the specified request parameters. For JWT authorizers the single entry specifies where to extract the JSON Web Token (JWT) from inbound requests.

Declaration
public Output<ImmutableArray<string>> IdentitySources { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

JwtConfiguration

The configuration of a JWT authorizer. Required for the JWT authorizer type. Supported only for HTTP APIs.

Declaration
public Output<AuthorizerJwtConfiguration> JwtConfiguration { get; }
Property Value
Type Description
Output<AuthorizerJwtConfiguration>
View Source

Name

The name of the authorizer.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, AuthorizerState, CustomResourceOptions)

Get an existing Authorizer resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Authorizer Get(string name, Input<string> id, AuthorizerState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

AuthorizerState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Authorizer
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.