Skip to content

create_identity_pool async

create_identity_pool(
    identity_pool_name: IdentityPoolName,
    allow_unauthenticated_identities: IdentityPoolUnauthenticated,
    *,
    config_overrides: Optional[AsyncCognitoIdentityClientConfig] = None,
    allow_classic_flow: Optional[ClassicFlow] = None,
    supported_login_providers: Optional[IdentityProviders] = None,
    developer_provider_name: Optional[DeveloperProviderName] = None,
    open_id_connect_provider_ar_ns: Optional[OIDCProviderList] = None,
    cognito_identity_providers: Optional[CognitoIdentityProviderList] = None,
    saml_provider_ar_ns: Optional[SAMLProviderList] = None,
    identity_pool_tags: Optional[IdentityPoolTagsType] = None,
) -> IdentityPool

Creates a new identity pool. The identity pool is a store of user identity information that is specific to your Amazon Web Services account. The keys for SupportedLoginProviders are as follows:

  • Facebook: graph.facebook.com

  • Google: accounts.google.com

  • Sign in With Apple: appleid.apple.com

  • Amazon: www.amazon.com

  • Twitter: api.twitter.com

  • Digits: www.digits.com

If you don't provide a value for a parameter, Amazon Cognito sets it to its default value.

You must use Amazon Web Services developer credentials to call this operation.

Parameters:

  • identity_pool_name (IdentityPoolName) –

    A string that you provide.

  • allow_unauthenticated_identities (IdentityPoolUnauthenticated) –

    TRUE if the identity pool supports unauthenticated logins.

  • allow_classic_flow (Optional[ClassicFlow], default: None ) –

    Enables or disables the Basic (Classic) authentication flow. For more information, see Identity Pools (Federated Identities) Authentication Flow in the Amazon Cognito Developer Guide.

  • supported_login_providers (Optional[IdentityProviders], default: None ) –

    Optional key:value pairs mapping provider names to provider app IDs.

  • developer_provider_name (Optional[DeveloperProviderName], default: None ) –

    The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the DeveloperProviderName, you can use letters as well as period (.), underscore (_), and dash (-).

    Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.

  • open_id_connect_provider_ar_ns (Optional[OIDCProviderList], default: None ) –

    The Amazon Resource Names (ARN) of the OpenID Connect providers.

  • cognito_identity_providers (Optional[CognitoIdentityProviderList], default: None ) –

    An array of Amazon Cognito user pools and their client IDs.

  • saml_provider_ar_ns (Optional[SAMLProviderList], default: None ) –

    An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.

  • identity_pool_tags (Optional[IdentityPoolTagsType], default: None ) –

    Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

Raises:

Source code in docs_src/capo_cognito_identity/_services/async_cognito_identity.py
async def create_identity_pool(
    self,
    identity_pool_name: "capo_cognito_identity.types.identity_pool_name.IdentityPoolName",
    allow_unauthenticated_identities: "capo_cognito_identity.types.identity_pool_unauthenticated.IdentityPoolUnauthenticated",
    *,
    config_overrides: Optional[AsyncCognitoIdentityClientConfig] = None,
    allow_classic_flow: Optional[
        "capo_cognito_identity.types.classic_flow.ClassicFlow"
    ] = None,
    supported_login_providers: Optional[
        "capo_cognito_identity.types.identity_providers.IdentityProviders"
    ] = None,
    developer_provider_name: Optional[
        "capo_cognito_identity.types.developer_provider_name.DeveloperProviderName"
    ] = None,
    open_id_connect_provider_ar_ns: Optional[
        "capo_cognito_identity.types.oidc_provider_list.OIDCProviderList"
    ] = None,
    cognito_identity_providers: Optional[
        "capo_cognito_identity.types.cognito_identity_provider_list.CognitoIdentityProviderList"
    ] = None,
    saml_provider_ar_ns: Optional[
        "capo_cognito_identity.types.saml_provider_list.SAMLProviderList"
    ] = None,
    identity_pool_tags: Optional[
        "capo_cognito_identity.types.identity_pool_tags_type.IdentityPoolTagsType"
    ] = None,
) -> "capo_cognito_identity.types.identity_pool.IdentityPool":
    """<p>Creates a new identity pool. The identity pool is a store of user identity information that is specific to your Amazon Web Services account. The keys for <code>SupportedLoginProviders</code> are as follows:</p> <ul> <li> <p>Facebook: <code>graph.facebook.com</code> </p> </li> <li> <p>Google: <code>accounts.google.com</code> </p> </li> <li> <p>Sign in With Apple: <code>appleid.apple.com</code> </p> </li> <li> <p>Amazon: <code>www.amazon.com</code> </p> </li> <li> <p>Twitter: <code>api.twitter.com</code> </p> </li> <li> <p>Digits: <code>www.digits.com</code> </p> </li> </ul> <important> <p>If you don't provide a value for a parameter, Amazon Cognito sets it to its default value. </p> </important> <p>You must use Amazon Web Services developer credentials to call this operation.</p>

    Args:
        identity_pool_name: <p>A string that you provide.</p>
        allow_unauthenticated_identities: <p>TRUE if the identity pool supports unauthenticated logins.</p>
        allow_classic_flow: <p>Enables or disables the Basic (Classic) authentication flow. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html">Identity Pools (Federated Identities) Authentication Flow</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
        supported_login_providers: <p>Optional key:value pairs mapping provider names to provider app IDs.</p>
        developer_provider_name: <p>The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the <code>DeveloperProviderName</code>, you can use letters as well as period (<code>.</code>), underscore (<code>_</code>), and dash (<code>-</code>).</p> <p>Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.</p>
        open_id_connect_provider_ar_ns: <p>The Amazon Resource Names (ARN) of the OpenID Connect providers.</p>
        cognito_identity_providers: <p>An array of Amazon Cognito user pools and their client IDs.</p>
        saml_provider_ar_ns: <p>An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.</p>
        identity_pool_tags: <p>Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.</p>

    Raises:
        capo_cognito_identity.errors.internal_error_exception.InternalErrorException: <p>Thrown when the service encounters an error during processing the request.</p>
        capo_cognito_identity.errors.invalid_parameter_exception.InvalidParameterException: <p>Thrown for missing or bad input parameter(s).</p>
        capo_cognito_identity.errors.limit_exceeded_exception.LimitExceededException: <p>Thrown when the total number of user pools has exceeded a preset limit.</p>
        capo_cognito_identity.errors.not_authorized_exception.NotAuthorizedException: <p>Thrown when a user is not authorized to access the requested resource.</p>
        capo_cognito_identity.errors.resource_conflict_exception.ResourceConflictException: <p>Thrown when a user tries to use a login which is already linked to another account.</p>
        capo_cognito_identity.errors.too_many_requests_exception.TooManyRequestsException: <p>Thrown when a request is throttled.</p>
        capo_cognito_identity.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cognito_identity.types.create_identity_pool_input.CreateIdentityPoolInput]",
    ) -> AsyncOperationResponse[
        "capo_cognito_identity.types.identity_pool.IdentityPool"
    ]:
        import capo_cognito_identity._operations.aws_cognito_identity_service.create_identity_pool

        (
            output,
            http_response,
        ) = await capo_cognito_identity._operations.aws_cognito_identity_service.create_identity_pool.async_create_identity_pool(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateIdentityPool")
    )
    input_: capo_cognito_identity.types.create_identity_pool_input.CreateIdentityPoolInput = {
        "identity_pool_name": identity_pool_name,
        "allow_unauthenticated_identities": allow_unauthenticated_identities,
    }
    if allow_classic_flow is not None:
        input_["allow_classic_flow"] = allow_classic_flow
    if supported_login_providers is not None:
        input_["supported_login_providers"] = supported_login_providers
    if developer_provider_name is not None:
        input_["developer_provider_name"] = developer_provider_name
    if open_id_connect_provider_ar_ns is not None:
        input_["open_id_connect_provider_ar_ns"] = open_id_connect_provider_ar_ns
    if cognito_identity_providers is not None:
        input_["cognito_identity_providers"] = cognito_identity_providers
    if saml_provider_ar_ns is not None:
        input_["saml_provider_ar_ns"] = saml_provider_ar_ns
    if identity_pool_tags is not None:
        input_["identity_pool_tags"] = identity_pool_tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output