Show / Hide Table of Contents

Class UserPool

Define a Cognito User Pool.

Inheritance
object
Resource
UserPool
Implements
IUserPool
IResource
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class UserPool : Resource, IUserPool, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class UserPool Inherits Resource Implements IUserPool, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks

ExampleMetadata: infused

Examples
var pool = new UserPool(this, "Pool");
            pool.AddClient("app-client", new UserPoolClientOptions {
                OAuth = new OAuthSettings {
                    Flows = new OAuthFlows {
                        AuthorizationCodeGrant = true
                    },
                    Scopes = new [] { OAuthScope.OPENID },
                    CallbackUrls = new [] { "https://my-app-domain.com/welcome" },
                    LogoutUrls = new [] { "https://my-app-domain.com/signin" }
                }
            });

Synopsis

Constructors

UserPool(Construct, string, IUserPoolProps?)

Define a Cognito User Pool.

Properties

IdentityProviders

Get all identity providers registered with this user pool.

PROPERTY_INJECTION_ID

Uniquely identifies this class.

UserPoolArn

The ARN of the user pool.

UserPoolId

The physical ID of this user pool resource.

UserPoolProviderName

User pool provider name.

UserPoolProviderUrl

User pool provider URL.

Methods

AddClient(string, IUserPoolClientOptions?)

Add a new app client to this user pool.

AddDomain(string, IUserPoolDomainOptions)

Associate a domain to this user pool.

AddGroup(string, IUserPoolGroupOptions)

Add a new group to this user pool.

AddResourceServer(string, IUserPoolResourceServerOptions)

Add a new resource server to this user pool.

AddTrigger(UserPoolOperation, IFunction, LambdaVersion?)

Add a lambda trigger to a user pool operation.

FromUserPoolArn(Construct, string, string)

Import an existing user pool based on its ARN.

FromUserPoolId(Construct, string, string)

Import an existing user pool based on its id.

Grant(IGrantable, params string[])

Adds an IAM policy statement associated with this user pool to an IAM principal's policy.

RegisterIdentityProvider(IUserPoolIdentityProvider)

Register an identity provider with this user pool.

Constructors

UserPool(Construct, string, IUserPoolProps?)

Define a Cognito User Pool.

public UserPool(Construct scope, string id, IUserPoolProps? props = null)
Parameters
scope Construct
id string
props IUserPoolProps
Remarks

ExampleMetadata: infused

Examples
var pool = new UserPool(this, "Pool");
            pool.AddClient("app-client", new UserPoolClientOptions {
                OAuth = new OAuthSettings {
                    Flows = new OAuthFlows {
                        AuthorizationCodeGrant = true
                    },
                    Scopes = new [] { OAuthScope.OPENID },
                    CallbackUrls = new [] { "https://my-app-domain.com/welcome" },
                    LogoutUrls = new [] { "https://my-app-domain.com/signin" }
                }
            });

Properties

IdentityProviders

Get all identity providers registered with this user pool.

public virtual IUserPoolIdentityProvider[] IdentityProviders { get; }
Property Value

IUserPoolIdentityProvider[]

Remarks

ExampleMetadata: infused

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

ExampleMetadata: infused

UserPoolArn

The ARN of the user pool.

public virtual string UserPoolArn { get; }
Property Value

string

Remarks

ExampleMetadata: infused

UserPoolId

The physical ID of this user pool resource.

public virtual string UserPoolId { get; }
Property Value

string

Remarks

ExampleMetadata: infused

UserPoolProviderName

User pool provider name.

public virtual string UserPoolProviderName { get; }
Property Value

string

Remarks

Attribute: true

UserPoolProviderUrl

User pool provider URL.

public virtual string UserPoolProviderUrl { get; }
Property Value

string

Remarks

Attribute: true

Methods

AddClient(string, IUserPoolClientOptions?)

Add a new app client to this user pool.

public virtual UserPoolClient AddClient(string id, IUserPoolClientOptions? options = null)
Parameters
id string
options IUserPoolClientOptions
Returns

UserPoolClient

Remarks

ExampleMetadata: infused

AddDomain(string, IUserPoolDomainOptions)

Associate a domain to this user pool.

public virtual UserPoolDomain AddDomain(string id, IUserPoolDomainOptions options)
Parameters
id string
options IUserPoolDomainOptions
Returns

UserPoolDomain

Remarks

ExampleMetadata: infused

AddGroup(string, IUserPoolGroupOptions)

Add a new group to this user pool.

public virtual UserPoolGroup AddGroup(string id, IUserPoolGroupOptions options)
Parameters
id string
options IUserPoolGroupOptions
Returns

UserPoolGroup

Remarks

ExampleMetadata: infused

AddResourceServer(string, IUserPoolResourceServerOptions)

Add a new resource server to this user pool.

public virtual UserPoolResourceServer AddResourceServer(string id, IUserPoolResourceServerOptions options)
Parameters
id string
options IUserPoolResourceServerOptions
Returns

UserPoolResourceServer

Remarks

ExampleMetadata: infused

AddTrigger(UserPoolOperation, IFunction, LambdaVersion?)

Add a lambda trigger to a user pool operation.

public virtual void AddTrigger(UserPoolOperation operation, IFunction fn, LambdaVersion? lambdaVersion = null)
Parameters
operation UserPoolOperation
fn IFunction
lambdaVersion LambdaVersion?
Remarks

See: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html

FromUserPoolArn(Construct, string, string)

Import an existing user pool based on its ARN.

public static IUserPool FromUserPoolArn(Construct scope, string id, string userPoolArn)
Parameters
scope Construct
id string
userPoolArn string
Returns

IUserPool

Remarks

ExampleMetadata: infused

FromUserPoolId(Construct, string, string)

Import an existing user pool based on its id.

public static IUserPool FromUserPoolId(Construct scope, string id, string userPoolId)
Parameters
scope Construct
id string
userPoolId string
Returns

IUserPool

Remarks

ExampleMetadata: infused

Grant(IGrantable, params string[])

Adds an IAM policy statement associated with this user pool to an IAM principal's policy.

public virtual Grant Grant(IGrantable grantee, params string[] actions)
Parameters
grantee IGrantable
actions string[]
Returns

Grant

Remarks

ExampleMetadata: infused

RegisterIdentityProvider(IUserPoolIdentityProvider)

Register an identity provider with this user pool.

public virtual void RegisterIdentityProvider(IUserPoolIdentityProvider provider)
Parameters
provider IUserPoolIdentityProvider
Remarks

ExampleMetadata: infused

Implements

IUserPool
IResource
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX