Skip to content

create_application async

create_application(
    identity_source: IdentitySource,
    *,
    config_overrides: Optional[AsyncAccountAccessClientConfig] = None,
    tags: Optional[TagsMap] = None,
) -> CreateApplicationResponse

Creates an account access manager instance and its Amazon Web Services account access application in the associated IAM Identity Center instance. This operation is idempotent; calling it multiple times with the same parameters returns the existing application.

Parameters:

  • identity_source (IdentitySource) –

    Specifies the identity source for the application. The identity source defines the IAM Identity Center instance that provides principals for entitlements.

  • tags (Optional[TagsMap], default: None ) –

    Specifies the tags to assign to the application.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this operation.

  • AlreadyCreatedException –

    The resource you are trying to create already exists. To retrieve the existing resource, use the corresponding Get operation.

  • ConflictException –

    The request conflicts with the current state of the resource.

  • InternalServerException –

    An internal service error occurred. Try your request again later.

  • ThrottlingException –

    The request was denied due to request throttling. Try your request again later.

  • ValidationException –

    The input does not satisfy the constraints specified by the service. Check your request parameters and retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_account_access/_services/async_account_access.py
async def create_application(
    self,
    identity_source: "capo_account_access.types.identity_source.IdentitySource",
    *,
    config_overrides: Optional[AsyncAccountAccessClientConfig] = None,
    tags: Optional["capo_account_access.types.tags_map.TagsMap"] = None,
) -> "capo_account_access.types.create_application_response.CreateApplicationResponse":
    """<p>Creates an account access manager instance and its Amazon Web Services account access application in the associated IAM Identity Center instance. This operation is idempotent; calling it multiple times with the same parameters returns the existing application.</p>

    Args:
        identity_source: <p>Specifies the identity source for the application. The identity source defines the IAM Identity Center instance that provides principals for entitlements.</p>
        tags: <p>Specifies the tags to assign to the application.</p>

    Raises:
        capo_account_access.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this operation.</p>
        capo_account_access.errors.already_created_exception.AlreadyCreatedException: <p>The resource you are trying to create already exists. To retrieve the existing resource, use the corresponding Get operation.</p>
        capo_account_access.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_account_access.errors.internal_server_exception.InternalServerException: <p>An internal service error occurred. Try your request again later.</p>
        capo_account_access.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling. Try your request again later.</p>
        capo_account_access.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by the service. Check your request parameters and retry the request.</p>
        capo_account_access.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_account_access.types.create_application_request.CreateApplicationRequest]",
    ) -> AsyncOperationResponse[
        "capo_account_access.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_account_access._operations.aws_account_access.create_application

        (
            output,
            http_response,
        ) = await capo_account_access._operations.aws_account_access.create_application.async_create_application(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplication")
    )
    input_: capo_account_access.types.create_application_request.CreateApplicationRequest = {
        "identity_source": identity_source
    }
    if tags is not None:
        input_["tags"] = tags

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