Module: AWSCDK::Cognito::IUserPool
- Includes:
- IResource, Interfaces::AWSCognito::IUserPoolRef
- Included in:
- UserPool
- Defined in:
- cognito/i_user_pool.rb
Overview
Represents a Cognito UserPool.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_client(id, options = nil) ⇒ AWSCDK::Cognito::UserPoolClient
Add a new app client to this user pool.
-
#add_domain(id, options) ⇒ AWSCDK::Cognito::UserPoolDomain
Associate a domain to this user pool.
-
#add_group(id, options) ⇒ AWSCDK::Cognito::UserPoolGroup
Add a new group to this user pool.
-
#add_resource_server(id, options) ⇒ AWSCDK::Cognito::UserPoolResourceServer
Add a new resource server to this user pool.
-
#apply_removal_policy(policy) ⇒ void
Apply the given removal policy to this resource.
-
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
-
#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this user pool to an IAM principal's policy.
-
#identity_providers ⇒ Array<AWSCDK::Cognito::IUserPoolIdentityProvider>
Get all identity providers registered with this user pool.
-
#node ⇒ Constructs::Node
The tree node.
-
#register_identity_provider(provider) ⇒ void
Register an identity provider with this user pool.
-
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
-
#user_pool_arn ⇒ String
The ARN of this user pool resource.
-
#user_pool_id ⇒ String
The physical ID of this user pool resource.
-
#user_pool_provider_name ⇒ String
The provider name of this user pool resource.
-
#user_pool_ref ⇒ AWSCDK::Interfaces::AWSCognito::UserPoolReference
A reference to a UserPool resource.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Class Method Details
.jsii_overridable_methods ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'cognito/i_user_pool.rb', line 178 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :env => { kind: :property, name: "env", is_optional: false }, :stack => { kind: :property, name: "stack", is_optional: false }, :user_pool_ref => { kind: :property, name: "userPoolRef", is_optional: false }, :identity_providers => { kind: :property, name: "identityProviders", is_optional: false }, :user_pool_arn => { kind: :property, name: "userPoolArn", is_optional: false }, :user_pool_id => { kind: :property, name: "userPoolId", is_optional: false }, :user_pool_provider_name => { kind: :property, name: "userPoolProviderName", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :apply_removal_policy => { kind: :method, name: "applyRemovalPolicy", is_optional: false }, :add_client => { kind: :method, name: "addClient", is_optional: false }, :add_domain => { kind: :method, name: "addDomain", is_optional: false }, :add_group => { kind: :method, name: "addGroup", is_optional: false }, :add_resource_server => { kind: :method, name: "addResourceServer", is_optional: false }, :grant => { kind: :method, name: "grant", is_optional: false }, :register_identity_provider => { kind: :method, name: "registerIdentityProvider", is_optional: false }, } end |
Instance Method Details
#add_client(id, options = nil) ⇒ AWSCDK::Cognito::UserPoolClient
Add a new app client to this user pool.
110 111 112 113 114 115 |
# File 'cognito/i_user_pool.rb', line 110 def add_client(id, = nil) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Cognito::UserPoolClientOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5Vc2VyUG9vbENsaWVudE9wdGlvbnMifQ==")), "options") unless .nil? jsii_call_method("addClient", [id, ]) end |
#add_domain(id, options) ⇒ AWSCDK::Cognito::UserPoolDomain
Associate a domain to this user pool.
123 124 125 126 127 128 |
# File 'cognito/i_user_pool.rb', line 123 def add_domain(id, ) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Cognito::UserPoolDomainOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5Vc2VyUG9vbERvbWFpbk9wdGlvbnMifQ==")), "options") jsii_call_method("addDomain", [id, ]) end |
#add_group(id, options) ⇒ AWSCDK::Cognito::UserPoolGroup
Add a new group to this user pool.
136 137 138 139 140 141 |
# File 'cognito/i_user_pool.rb', line 136 def add_group(id, ) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Cognito::UserPoolGroupOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5Vc2VyUG9vbEdyb3VwT3B0aW9ucyJ9")), "options") jsii_call_method("addGroup", [id, ]) end |
#add_resource_server(id, options) ⇒ AWSCDK::Cognito::UserPoolResourceServer
Add a new resource server to this user pool.
149 150 151 152 153 154 |
# File 'cognito/i_user_pool.rb', line 149 def add_resource_server(id, ) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") = .is_a?(Hash) ? ::AWSCDK::Cognito::UserPoolResourceServerOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0by5Vc2VyUG9vbFJlc291cmNlU2VydmVyT3B0aW9ucyJ9")), "options") jsii_call_method("addResourceServer", [id, ]) end |
#apply_removal_policy(policy) ⇒ void
This method returns an undefined value.
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
99 100 101 102 |
# File 'cognito/i_user_pool.rb', line 99 def apply_removal_policy(policy) Jsii::Type.check_type(policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5SZW1vdmFsUG9saWN5In0=")), "policy") jsii_call_method("applyRemovalPolicy", [policy]) end |
#env ⇒ AWSCDK::Interfaces::ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
27 28 29 |
# File 'cognito/i_user_pool.rb', line 27 def env() jsii_get_property("env") end |
#grant(grantee, *actions) ⇒ AWSCDK::IAM::Grant
Adds an IAM policy statement associated with this user pool to an IAM principal's policy.
161 162 163 164 165 166 167 |
# File 'cognito/i_user_pool.rb', line 161 def grant(grantee, *actions) Jsii::Type.check_type(grantee, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklHcmFudGFibGUifQ==")), "grantee") actions.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "actions[#{index}]") end jsii_call_method("grant", [grantee, *actions]) end |
#identity_providers ⇒ Array<AWSCDK::Cognito::IUserPoolIdentityProvider>
Get all identity providers registered with this user pool.
48 49 50 |
# File 'cognito/i_user_pool.rb', line 48 def identity_providers() jsii_get_property("identityProviders") end |
#node ⇒ Constructs::Node
The tree node.
12 13 14 |
# File 'cognito/i_user_pool.rb', line 12 def node() jsii_get_property("node") end |
#register_identity_provider(provider) ⇒ void
This method returns an undefined value.
Register an identity provider with this user pool.
173 174 175 176 |
# File 'cognito/i_user_pool.rb', line 173 def register_identity_provider(provider) Jsii::Type.check_type(provider, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19jb2duaXRvLklVc2VyUG9vbElkZW50aXR5UHJvdmlkZXJSZWYifQ==")), "provider") jsii_call_method("registerIdentityProvider", [provider]) end |
#stack ⇒ AWSCDK::Stack
The stack in which this resource is defined.
34 35 36 |
# File 'cognito/i_user_pool.rb', line 34 def stack() jsii_get_property("stack") end |
#user_pool_arn ⇒ String
The ARN of this user pool resource.
55 56 57 |
# File 'cognito/i_user_pool.rb', line 55 def user_pool_arn() jsii_get_property("userPoolArn") end |
#user_pool_id ⇒ String
The physical ID of this user pool resource.
62 63 64 |
# File 'cognito/i_user_pool.rb', line 62 def user_pool_id() jsii_get_property("userPoolId") end |
#user_pool_provider_name ⇒ String
The provider name of this user pool resource.
69 70 71 |
# File 'cognito/i_user_pool.rb', line 69 def user_pool_provider_name() jsii_get_property("userPoolProviderName") end |
#user_pool_ref ⇒ AWSCDK::Interfaces::AWSCognito::UserPoolReference
A reference to a UserPool resource.
41 42 43 |
# File 'cognito/i_user_pool.rb', line 41 def user_pool_ref() jsii_get_property("userPoolRef") end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.
80 81 82 83 84 85 |
# File 'cognito/i_user_pool.rb', line 80 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |