Class: AWSCDK::CognitoIdentitypool::IdentityPoolProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cognito_identitypool/identity_pool_props.rb

Overview

Props for the Identity Pool construct.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(allow_classic_flow: nil, allow_unauthenticated_identities: nil, authenticated_role: nil, authentication_providers: nil, identity_pool_name: nil, role_mappings: nil, unauthenticated_role: nil) ⇒ IdentityPoolProps

Returns a new instance of IdentityPoolProps.

Parameters:

  • allow_classic_flow (Boolean, nil) (defaults to: nil)

    Enables the Basic (Classic) authentication flow.

  • allow_unauthenticated_identities (Boolean, nil) (defaults to: nil)

    Whether the Identity Pool supports unauthenticated logins.

  • authenticated_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The default Role to be assumed by authenticated users.

  • authentication_providers (AWSCDK::CognitoIdentitypool::IdentityPoolAuthenticationProviders, nil) (defaults to: nil)

    Authentication Providers for using in Identity Pool.

  • identity_pool_name (String, nil) (defaults to: nil)

    The name of the Identity Pool.

  • role_mappings (Array<AWSCDK::CognitoIdentitypool::IdentityPoolRoleMapping>, nil) (defaults to: nil)

    Rules for mapping roles to users.

  • unauthenticated_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The default Role to be assumed by unauthenticated users.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'cognito_identitypool/identity_pool_props.rb', line 14

def initialize(allow_classic_flow: nil, allow_unauthenticated_identities: nil, authenticated_role: nil, authentication_providers: nil, identity_pool_name: nil, role_mappings: nil, unauthenticated_role: nil)
  @allow_classic_flow = allow_classic_flow
  Jsii::Type.check_type(@allow_classic_flow, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowClassicFlow") unless @allow_classic_flow.nil?
  @allow_unauthenticated_identities = allow_unauthenticated_identities
  Jsii::Type.check_type(@allow_unauthenticated_identities, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "allowUnauthenticatedIdentities") unless @allow_unauthenticated_identities.nil?
  @authenticated_role = authenticated_role
  Jsii::Type.check_type(@authenticated_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "authenticatedRole") unless @authenticated_role.nil?
  @authentication_providers = authentication_providers.is_a?(Hash) ? ::AWSCDK::CognitoIdentitypool::IdentityPoolAuthenticationProviders.new(**authentication_providers.transform_keys(&:to_sym)) : authentication_providers
  Jsii::Type.check_type(@authentication_providers, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29nbml0b19pZGVudGl0eXBvb2wuSWRlbnRpdHlQb29sQXV0aGVudGljYXRpb25Qcm92aWRlcnMifQ==")), "authenticationProviders") unless @authentication_providers.nil?
  @identity_pool_name = identity_pool_name
  Jsii::Type.check_type(@identity_pool_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "identityPoolName") unless @identity_pool_name.nil?
  @role_mappings = role_mappings.is_a?(Array) ? role_mappings.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CognitoIdentitypool::IdentityPoolRoleMapping.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : role_mappings
  Jsii::Type.check_type(@role_mappings, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb2duaXRvX2lkZW50aXR5cG9vbC5JZGVudGl0eVBvb2xSb2xlTWFwcGluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "roleMappings") unless @role_mappings.nil?
  @unauthenticated_role = unauthenticated_role
  Jsii::Type.check_type(@unauthenticated_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "unauthenticatedRole") unless @unauthenticated_role.nil?
end

Instance Attribute Details

#allow_classic_flowBoolean? (readonly)

Note:

Default: - Classic Flow not allowed

Enables the Basic (Classic) authentication flow.

Returns:

  • (Boolean, nil)


35
36
37
# File 'cognito_identitypool/identity_pool_props.rb', line 35

def allow_classic_flow
  @allow_classic_flow
end

#allow_unauthenticated_identitiesBoolean? (readonly)

Note:

Default: - false

Whether the Identity Pool supports unauthenticated logins.

Returns:

  • (Boolean, nil)


40
41
42
# File 'cognito_identitypool/identity_pool_props.rb', line 40

def allow_unauthenticated_identities
  @allow_unauthenticated_identities
end

#authenticated_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A default authenticated Role will be added

The default Role to be assumed by authenticated users.

Returns:



45
46
47
# File 'cognito_identitypool/identity_pool_props.rb', line 45

def authenticated_role
  @authenticated_role
end

#authentication_providersAWSCDK::CognitoIdentitypool::IdentityPoolAuthenticationProviders? (readonly)

Note:

Default: - No Authentication Providers passed directly to Identity Pool

Authentication Providers for using in Identity Pool.



50
51
52
# File 'cognito_identitypool/identity_pool_props.rb', line 50

def authentication_providers
  @authentication_providers
end

#identity_pool_nameString? (readonly)

Note:

Default: - Automatically generated name by CloudFormation at deploy time

The name of the Identity Pool.

Returns:

  • (String, nil)


55
56
57
# File 'cognito_identitypool/identity_pool_props.rb', line 55

def identity_pool_name
  @identity_pool_name
end

#role_mappingsArray<AWSCDK::CognitoIdentitypool::IdentityPoolRoleMapping>? (readonly)

Note:

Default: - no role mappings

Rules for mapping roles to users.



60
61
62
# File 'cognito_identitypool/identity_pool_props.rb', line 60

def role_mappings
  @role_mappings
end

#unauthenticated_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A default unauthenticated Role will be added

The default Role to be assumed by unauthenticated users.

Returns:



65
66
67
# File 'cognito_identitypool/identity_pool_props.rb', line 65

def unauthenticated_role
  @unauthenticated_role
end

Class Method Details

.jsii_propertiesObject



67
68
69
70
71
72
73
74
75
76
77
# File 'cognito_identitypool/identity_pool_props.rb', line 67

def self.jsii_properties
  {
    :allow_classic_flow => "allowClassicFlow",
    :allow_unauthenticated_identities => "allowUnauthenticatedIdentities",
    :authenticated_role => "authenticatedRole",
    :authentication_providers => "authenticationProviders",
    :identity_pool_name => "identityPoolName",
    :role_mappings => "roleMappings",
    :unauthenticated_role => "unauthenticatedRole",
  }
end

Instance Method Details

#to_jsiiObject



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'cognito_identitypool/identity_pool_props.rb', line 79

def to_jsii
  result = {}
  result.merge!({
    "allowClassicFlow" => @allow_classic_flow,
    "allowUnauthenticatedIdentities" => @allow_unauthenticated_identities,
    "authenticatedRole" => @authenticated_role,
    "authenticationProviders" => @authentication_providers,
    "identityPoolName" => @identity_pool_name,
    "roleMappings" => @role_mappings,
    "unauthenticatedRole" => @unauthenticated_role,
  })
  result.compact
end