Skip to content
v2.277.0

UserPoolConfig Struct ​

Configuration for Cognito user-pools in AppSync.

Example ​

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

declare const userPool: cognito.UserPool;
const userPoolConfig: appsync.UserPoolConfig = {
  userPool: userPool,

  // the properties below are optional
  appIdClientRegex: 'appIdClientRegex',
  defaultAction: appsync.UserPoolDefaultAction.ALLOW,
};
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_appsync as appsync
from aws_cdk import aws_cognito as cognito

# user_pool: cognito.UserPool

user_pool_config = appsync.UserPoolConfig(
    user_pool=user_pool,

    # the properties below are optional
    app_id_client_regex="appIdClientRegex",
    default_action=appsync.UserPoolDefaultAction.ALLOW
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appsync.*;
import software.amazon.awscdk.services.cognito.*;

UserPool userPool;

UserPoolConfig userPoolConfig = UserPoolConfig.builder()
        .userPool(userPool)

        // the properties below are optional
        .appIdClientRegex("appIdClientRegex")
        .defaultAction(UserPoolDefaultAction.ALLOW)
        .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.AWS.AppSync;
using Amazon.CDK.AWS.Cognito;

UserPool userPool;

var userPoolConfig = new UserPoolConfig {
    UserPool = userPool,

    // the properties below are optional
    AppIdClientRegex = "appIdClientRegex",
    DefaultAction = UserPoolDefaultAction.ALLOW
};
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 userPool UserPool

userPoolConfig := &UserPoolConfig{
	UserPool: userPool,

	// the properties below are optional
	AppIdClientRegex: jsii.String("appIdClientRegex"),
	DefaultAction: awscdk.Aws_appsync.UserPoolDefaultAction_ALLOW,
}

Properties ​

appIdClientRegexoptionalstringapp_id_client_regexoptionalstrappIdClientRegexoptionalStringAppIdClientRegexoptionalstringAppIdClientRegexoptional*string = None #
the optional app id regex.
defaultActionoptionalUserPoolDefaultActiondefault_actionoptionalUserPoolDefaultActiondefaultActionoptionalUserPoolDefaultActionDefaultActionoptionalUserPoolDefaultActionDefaultActionoptionalUserPoolDefaultAction = ALLOW #
Default auth action.
userPoolIUserPooluser_poolIUserPooluserPoolIUserPoolUserPoolIUserPoolUserPoolIUserPool required #
The Cognito user pool to use as identity source.