Class UserPool
Define a Cognito User Pool.
public class UserPool : Resource, IUserPool, IResource, IConstruct, IConstruct, IDependable
- Inheritance
-
UserPool
- Implements
-
IResourceIConstructIConstructIDependable
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" }
}
});
Remarks
ExampleMetadata: infused
Constructors
UserPool(Construct, string, IUserPoolProps?)
public UserPool(Construct scope, string id, IUserPoolProps? props = null)
Parameters
scope
Constructid
stringprops
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
UserPoolId
The physical ID of this user pool resource.
public virtual string UserPoolId { get; }
Property Value
UserPoolProviderName
User pool provider name.
public virtual string UserPoolProviderName { get; }
Property Value
Remarks
Attribute: true
UserPoolProviderUrl
User pool provider URL.
public virtual string UserPoolProviderUrl { get; }
Property Value
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
stringoptions
IUserPoolClientOptions
Returns
AddDomain(string, IUserPoolDomainOptions)
Associate a domain to this user pool.
public virtual UserPoolDomain AddDomain(string id, IUserPoolDomainOptions options)
Parameters
id
stringoptions
IUserPoolDomainOptions
Returns
AddResourceServer(string, IUserPoolResourceServerOptions)
Add a new resource server to this user pool.
public virtual UserPoolResourceServer AddResourceServer(string id, IUserPoolResourceServerOptions options)
Parameters
id
stringoptions
IUserPoolResourceServerOptions
Returns
AddTrigger(UserPoolOperation, IFunction)
Add a lambda trigger to a user pool operation.
public virtual void AddTrigger(UserPoolOperation operation, IFunction fn)
Parameters
operation
UserPoolOperationfn
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
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
Returns
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
IGrantableactions
string[]
Returns
- Grant
RegisterIdentityProvider(IUserPoolIdentityProvider)
Register an identity provider with this user pool.
public virtual void RegisterIdentityProvider(IUserPoolIdentityProvider provider)
Parameters
provider
IUserPoolIdentityProvider