Skip to content

create_account_pool async

create_account_pool(
    domain_identifier: DomainId,
    name: AccountPoolName,
    resolution_strategy: ResolutionStrategy,
    account_source: AccountSource,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional[Description] = None,
) -> CreateAccountPoolOutput

Creates an account pool.

Parameters:

  • domain_identifier (DomainId) –

    The ID of the domain where the account pool is created.

  • name (AccountPoolName) –

    The name of the account pool.

  • description (Optional[Description], default: None ) –

    The description of the account pool.

  • resolution_strategy (ResolutionStrategy) –

    The mechanism used to resolve the account selection from the account pool.

  • account_source (AccountSource) –

    The source of accounts for the account pool. In the current release, it's either a static list of accounts provided by the customer or a custom Amazon Web Services Lambda handler.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def create_account_pool(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    name: "capo_datazone.types.account_pool_name.AccountPoolName",
    resolution_strategy: "capo_datazone.types.resolution_strategy.ResolutionStrategy",
    account_source: "capo_datazone.types.account_source.AccountSource",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
) -> "capo_datazone.types.create_account_pool_output.CreateAccountPoolOutput":
    """<p>Creates an account pool. </p>

    Args:
        domain_identifier: <p>The ID of the domain where the account pool is created.</p>
        name: <p>The name of the account pool.</p>
        description: <p>The description of the account pool.</p>
        resolution_strategy: <p>The mechanism used to resolve the account selection from the account pool.</p>
        account_source: <p>The source of accounts for the account pool. In the current release, it's either a static list of accounts provided by the customer or a custom Amazon Web Services Lambda handler. </p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.create_account_pool_input.CreateAccountPoolInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.create_account_pool_output.CreateAccountPoolOutput"
    ]:
        import capo_datazone._operations.data_zone.create_account_pool

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.create_account_pool.async_create_account_pool(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.create_account_pool_input.CreateAccountPoolInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_account_pool_input

        return capo_datazone.types.create_account_pool_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_datazone.types.create_account_pool_output.CreateAccountPoolOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_account_pool_output

        return capo_datazone.types.create_account_pool_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAccountPool",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_account_pool_input.CreateAccountPoolInput = {
        "domain_identifier": domain_identifier,
        "name": name,
        "resolution_strategy": resolution_strategy,
        "account_source": account_source,
    }
    if description is not None:
        input_["description"] = description

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