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}",
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.ApiGatewayV2
Assembly: Pulumi.Aws.dll
Syntax
public class Authorizer : CustomResource
Constructors
View SourceAuthorizer(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 SourceApiId
The API identifier.
Declaration
public Output<string> ApiId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
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> |
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>> |
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> |
Name
The name of the authorizer.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |