Skip to content

create_application async

create_application(
    instance_arn: InstanceArn,
    application_provider_arn: ApplicationProviderArn,
    name: ApplicationNameType,
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    description: Optional[Description] = None,
    portal_options: Optional[PortalOptions] = None,
    tags: Optional[TagList] = None,
    status: Optional[ApplicationStatus] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateApplicationResponse

Creates an OAuth 2.0 customer managed application in IAM Identity Center for the given application provider.

This API does not support creating SAML 2.0 customer managed applications or Amazon Web Services managed applications. To learn how to create an Amazon Web Services managed application, see the application user guide. You can create a SAML 2.0 customer managed application in the Amazon Web Services Management Console only. See Setting up customer managed SAML 2.0 applications. For more information on these application types, see Amazon Web Services managed applications.

Parameters:

  • instance_arn (InstanceArn) –

    The ARN of the instance of IAM Identity Center under which the operation will run. For more information about ARNs, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces in the Amazon Web Services General Reference.

  • application_provider_arn (ApplicationProviderArn) –

    The ARN of the application provider under which the operation will run.

  • name (ApplicationNameType) –

    The name of the .

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

    The description of the .

  • portal_options (Optional[PortalOptions], default: None ) –

    A structure that describes the options for the portal associated with an application.

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

    Specifies tags to be attached to the application.

  • status (Optional[ApplicationStatus], default: None ) –

    Specifies whether the application is enabled or disabled.

  • client_token (Optional[ClientToken], default: None ) –

    Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a UUID type of value.

    If you don't provide this value, then Amazon Web Services generates a random one for you.

    If you retry the operation with the same ClientToken, but with different parameters, the retry fails with an IdempotentParameterMismatch error.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    The request processing has failed because of an unknown error, exception, or failure with an internal server.

  • ResourceNotFoundException –

    Indicates that a requested resource is not found.

  • ServiceQuotaExceededException –

    Indicates that the principal has crossed the permitted number of resources that can be created.

  • ThrottlingException –

    Indicates that the principal has crossed the throttling limits of the API operations.

  • ValidationException –

    The request failed because it contains a syntax error.

  • UnknownServiceError –

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

Source code in docs_src/capo_sso_admin/_services/async_sso_admin.py
async def create_application(
    self,
    instance_arn: "capo_sso_admin.types.instance_arn.InstanceArn",
    application_provider_arn: "capo_sso_admin.types.application_provider_arn.ApplicationProviderArn",
    name: "capo_sso_admin.types.application_name_type.ApplicationNameType",
    *,
    config_overrides: Optional[AsyncSSOAdminClientConfig] = None,
    description: Optional["capo_sso_admin.types.description.Description"] = None,
    portal_options: Optional[
        "capo_sso_admin.types.portal_options.PortalOptions"
    ] = None,
    tags: Optional["capo_sso_admin.types.tag_list.TagList"] = None,
    status: Optional[
        "capo_sso_admin.types.application_status.ApplicationStatus"
    ] = None,
    client_token: Optional["capo_sso_admin.types.client_token.ClientToken"] = None,
) -> "capo_sso_admin.types.create_application_response.CreateApplicationResponse":
    """<p>Creates an OAuth 2.0 customer managed application in IAM Identity Center for the given application provider.</p> <note> <p>This API does not support creating SAML 2.0 customer managed applications or Amazon Web Services managed applications. To learn how to create an Amazon Web Services managed application, see the application user guide. You can create a SAML 2.0 customer managed application in the Amazon Web Services Management Console only. See <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/customermanagedapps-saml2-setup.html">Setting up customer managed SAML 2.0 applications</a>. For more information on these application types, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/awsapps.html">Amazon Web Services managed applications</a>.</p> </note>

    Args:
        instance_arn: <p>The ARN of the instance of IAM Identity Center under which the operation will run. For more information about ARNs, see <a href="/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces</a> in the <i>Amazon Web Services General Reference</i>.</p>
        application_provider_arn: <p>The ARN of the application provider under which the operation will run.</p>
        name: <p>The name of the .</p>
        description: <p>The description of the .</p>
        portal_options: <p>A structure that describes the options for the portal associated with an application.</p>
        tags: <p>Specifies tags to be attached to the application.</p>
        status: <p>Specifies whether the application is enabled or disabled.</p>
        client_token: <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p> <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p> <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>

    Raises:
        capo_sso_admin.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_sso_admin.errors.conflict_exception.ConflictException: <p>Occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_sso_admin.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure with an internal server.</p>
        capo_sso_admin.errors.resource_not_found_exception.ResourceNotFoundException: <p>Indicates that a requested resource is not found.</p>
        capo_sso_admin.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Indicates that the principal has crossed the permitted number of resources that can be created.</p>
        capo_sso_admin.errors.throttling_exception.ThrottlingException: <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
        capo_sso_admin.errors.validation_exception.ValidationException: <p>The request failed because it contains a syntax error.</p>
        capo_sso_admin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_sso_admin._operations.swb_external_service.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_sso_admin.types.create_application_request.CreateApplicationRequest = {
        "instance_arn": instance_arn,
        "application_provider_arn": application_provider_arn,
        "name": name,
    }
    if description is not None:
        input_["description"] = description
    if portal_options is not None:
        input_["portal_options"] = portal_options
    if tags is not None:
        input_["tags"] = tags
    if status is not None:
        input_["status"] = status
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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