Skip to content
v2.278.0

HttpUserPoolAuthorizerProps Struct ​

Properties to initialize HttpUserPoolAuthorizer.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2_authorizers as apigatewayv2_authorizers } from 'aws-cdk-lib';
import { aws_cognito as cognito } from 'aws-cdk-lib';

declare const userPoolClient: cognito.UserPoolClient;
const httpUserPoolAuthorizerProps: apigatewayv2_authorizers.HttpUserPoolAuthorizerProps = {
  authorizerName: 'authorizerName',
  identitySource: ['identitySource'],
  userPoolClients: [userPoolClient],
  userPoolRegion: 'userPoolRegion',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigatewayv2_authorizers as apigatewayv2_authorizers
from aws_cdk import aws_cognito as cognito

# user_pool_client: cognito.UserPoolClient

http_user_pool_authorizer_props = apigatewayv2_authorizers.HttpUserPoolAuthorizerProps(
    authorizer_name="authorizerName",
    identity_source=["identitySource"],
    user_pool_clients=[user_pool_client],
    user_pool_region="userPoolRegion"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.aws_apigatewayv2_authorizers.*;
import software.amazon.awscdk.services.cognito.*;

UserPoolClient userPoolClient;

HttpUserPoolAuthorizerProps httpUserPoolAuthorizerProps = HttpUserPoolAuthorizerProps.builder()
        .authorizerName("authorizerName")
        .identitySource(List.of("identitySource"))
        .userPoolClients(List.of(userPoolClient))
        .userPoolRegion("userPoolRegion")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AwsApigatewayv2Authorizers;
using Amazon.CDK.AWS.Cognito;

UserPoolClient userPoolClient;

var httpUserPoolAuthorizerProps = new HttpUserPoolAuthorizerProps {
    AuthorizerName = "authorizerName",
    IdentitySource = new [] { "identitySource" },
    UserPoolClients = new [] { userPoolClient },
    UserPoolRegion = "userPoolRegion"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var userPoolClient UserPoolClient

httpUserPoolAuthorizerProps := &HttpUserPoolAuthorizerProps{
	AuthorizerName: jsii.String("authorizerName"),
	IdentitySource: []*string{
		jsii.String("identitySource"),
	},
	UserPoolClients: []IUserPoolClient{
		userPoolClient,
	},
	UserPoolRegion: jsii.String("userPoolRegion"),
}

Properties ​

authorizerNameoptionalstringauthorizer_nameoptionalstrauthorizerNameoptionalStringAuthorizerNameoptionalstringAuthorizerNameoptional*string #
Friendly name of the authorizer.

Default: same value as id passed in the constructor

identitySourceoptionalstring[]identity_sourceoptionaltyping.List[str]identitySourceoptionalList<String>IdentitySourceoptionalstring[]IdentitySourceoptional*[]*string #
The identity source for which authorization is requested.

Default: ['$request.header.Authorization']

userPoolClientsoptionalIUserPoolClient[]user_pool_clientsoptionaltyping.List[IUserPoolClient]userPoolClientsoptionalList<IUserPoolClient>UserPoolClientsoptionalIUserPoolClient[]UserPoolClientsoptional*[]IUserPoolClient #
The user pool clients that should be used to authorize requests with the user pool.

Default: a new client will be created for the given user pool

userPoolRegionoptionalstringuser_pool_regionoptionalstruserPoolRegionoptionalStringUserPoolRegionoptionalstringUserPoolRegionoptional*string #
The AWS region in which the user pool is present.

Default: same region as the Route the authorizer is attached to.