Class UserPool
Define a Cognito User Pool.
Inherited Members
Namespace: Amazon.CDK.AWS.Cognito
Assembly: Amazon.CDK.AWS.Cognito.dll
Syntax (csharp)
public class UserPool : Resource, IUserPool, IResource, IConstruct, IDependable
Syntax (vb)
Public Class UserPool
Inherits Resource
Implements IUserPool, IResource, IConstruct, IDependable
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(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
UserPool(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
UserPool(Construct, String, IUserPoolProps) |
Properties
IdentityProviders | Get all identity providers registered with this user pool. |
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. |
AddResourceServer(String, IUserPoolResourceServerOptions) | Add a new resource server to this user pool. |
AddTrigger(UserPoolOperation, IFunction) | 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, 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(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected UserPool(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
UserPool(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected UserPool(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
UserPool(Construct, String, IUserPoolProps)
public UserPool(Construct scope, string id, IUserPoolProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IUserPoolProps
Properties
IdentityProviders
Get all identity providers registered with this user pool.
public virtual IUserPoolIdentityProvider[] IdentityProviders { get; }
Property Value
UserPoolArn
The ARN of the user pool.
public virtual string UserPoolArn { get; }
Property Value
System.String
UserPoolId
The physical ID of this user pool resource.
public virtual string UserPoolId { get; }
Property Value
System.String
UserPoolProviderName
User pool provider name.
public virtual string UserPoolProviderName { get; }
Property Value
System.String
Remarks
Attribute: true
UserPoolProviderUrl
User pool provider URL.
public virtual string UserPoolProviderUrl { get; }
Property Value
System.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 System.String
- options IUserPoolClientOptions
Returns
AddDomain(String, IUserPoolDomainOptions)
Associate a domain to this user pool.
public virtual UserPoolDomain AddDomain(string id, IUserPoolDomainOptions options)
Parameters
- id System.String
- options IUserPoolDomainOptions
Returns
AddResourceServer(String, IUserPoolResourceServerOptions)
Add a new resource server to this user pool.
public virtual UserPoolResourceServer AddResourceServer(string id, IUserPoolResourceServerOptions options)
Parameters
- id System.String
- options IUserPoolResourceServerOptions
Returns
AddTrigger(UserPoolOperation, IFunction)
Add a lambda trigger to a user pool operation.
public virtual void AddTrigger(UserPoolOperation operation, IFunction fn)
Parameters
- operation UserPoolOperation
- fn IFunction
Remarks
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 Constructs.Construct
- id System.String
- userPoolArn System.String
Returns
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 Constructs.Construct
- id System.String
- userPoolId System.String
Returns
Grant(IGrantable, 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 System.String[]
Returns
RegisterIdentityProvider(IUserPoolIdentityProvider)
Register an identity provider with this user pool.
public virtual void RegisterIdentityProvider(IUserPoolIdentityProvider provider)
Parameters
- provider IUserPoolIdentityProvider