Skip to content
v2.278.0

HttpAuthorizerAttributes Struct ​

Reference to an http authorizer.

Example ​

ts
import { HttpAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2';
import { Fn } from 'aws-cdk-lib'

const authorizerId = Fn.importValue('authorizerId');
const authorizerType = Fn.importValue('authorizerType');

const authorizer = HttpAuthorizer.fromHttpAuthorizerAttributes(this, 'HttpAuthorizer', {
    authorizerId,
    authorizerType
});
python
from aws_cdk.aws_apigatewayv2 import HttpAuthorizer
from aws_cdk import Fn


authorizer_id = Fn.import_value("authorizerId")
authorizer_type = Fn.import_value("authorizerType")

authorizer = HttpAuthorizer.from_http_authorizer_attributes(self, "HttpAuthorizer",
    authorizer_id=authorizer_id,
    authorizer_type=authorizer_type
)
java
import software.amazon.awscdk.services.apigatewayv2.HttpAuthorizer;
import software.amazon.awscdk.Fn;


String authorizerId = Fn.importValue("authorizerId");
String authorizerType = Fn.importValue("authorizerType");

IHttpRouteAuthorizer authorizer = HttpAuthorizer.fromHttpAuthorizerAttributes(this, "HttpAuthorizer", HttpAuthorizerAttributes.builder()
        .authorizerId(authorizerId)
        .authorizerType(authorizerType)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.Apigatewayv2;
using Amazon.CDK;


var authorizerId = Fn.ImportValue("authorizerId");
var authorizerType = Fn.ImportValue("authorizerType");

var authorizer = HttpAuthorizer.FromHttpAuthorizerAttributes(this, "HttpAuthorizer", new HttpAuthorizerAttributes {
    AuthorizerId = authorizerId,
    AuthorizerType = authorizerType
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"


authorizerId := awscdk.Fn_ImportValue(jsii.String("authorizerId"))
authorizerType := awscdk.Fn_ImportValue(jsii.String("authorizerType"))

authorizer := awscdk.HttpAuthorizer_FromHttpAuthorizerAttributes(this, jsii.String("HttpAuthorizer"), &HttpAuthorizerAttributes{
	AuthorizerId: jsii.String(AuthorizerId),
	AuthorizerType: jsii.String(AuthorizerType),
})

Properties ​

authorizerIdstringauthorizer_idstrauthorizerIdStringAuthorizerIdstringAuthorizerId*string required #
Id of the Authorizer.
authorizerTypestringauthorizer_typestrauthorizerTypeStringAuthorizerTypestringAuthorizerType*string required #
Type of authorizer.

Possible values are:

  • JWT - JSON Web Token Authorizer
  • CUSTOM - Lambda Authorizer
  • NONE - No Authorization