Skip to content

create_application

create_application(
    name: ApplicationName,
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    data_sources: Optional[DataSources] = None,
    iam_identity_center_options: Optional[IamIdentityCenterOptionsInput] = None,
    app_configs: Optional[AppConfigs] = None,
    tag_list: Optional[TagList] = None,
    kms_key_arn: Optional[KmsKeyArn] = None,
) -> CreateApplicationResponse

Creates an OpenSearch UI application. For more information, see Using the OpenSearch user interface in Amazon OpenSearch Service.

Parameters:

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

    Unique, case-sensitive identifier to ensure idempotency of the request.

  • name (ApplicationName) –

    The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.

  • data_sources (Optional[DataSources], default: None ) –

    The data sources to link to the OpenSearch application.

  • iam_identity_center_options (Optional[IamIdentityCenterOptionsInput], default: None ) –

    Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.

  • app_configs (Optional[AppConfigs], default: None ) –

    Configuration settings for the OpenSearch application, including administrative options.

  • kms_key_arn (Optional[KmsKeyArn], default: None ) –

    The Amazon Resource Name (ARN) of the KMS key used to encrypt the application's data at rest. If provided, the application uses your customer-managed key for encryption. If omitted, the application uses an AWS-managed key. The KMS key must be in the same region as the application.

Raises:

  • AccessDeniedException –

    An error occurred because you don't have permissions to access the resource.

  • BaseException –

    An error occurred while processing the request.

  • ConflictException –

    An error occurred because the client attempts to remove a resource that is currently in use.

  • DisabledOperationException –

    An error occured because the client wanted to access an unsupported operation.

  • InternalException –

    Request processing failed because of an unknown error, exception, or internal failure.

  • ValidationException –

    An exception for accessing or deleting a resource that doesn't exist.

  • UnknownServiceError –

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

Source code in docs_src/capo_opensearch/_services/open_search.py
def create_application(
    self,
    name: "capo_opensearch.types.application_name.ApplicationName",
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
    client_token: Optional["capo_opensearch.types.client_token.ClientToken"] = None,
    data_sources: Optional["capo_opensearch.types.data_sources.DataSources"] = None,
    iam_identity_center_options: Optional[
        "capo_opensearch.types.iam_identity_center_options_input.IamIdentityCenterOptionsInput"
    ] = None,
    app_configs: Optional["capo_opensearch.types.app_configs.AppConfigs"] = None,
    tag_list: Optional["capo_opensearch.types.tag_list.TagList"] = None,
    kms_key_arn: Optional["capo_opensearch.types.kms_key_arn.KmsKeyArn"] = None,
) -> "capo_opensearch.types.create_application_response.CreateApplicationResponse":
    """<p>Creates an OpenSearch UI application. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/application.html">Using the OpenSearch user interface in Amazon OpenSearch Service</a>.</p>

    Args:
        client_token: <p>Unique, case-sensitive identifier to ensure idempotency of the request.</p>
        name: <p>The unique name of the OpenSearch application. Names must be unique within an Amazon Web Services Region for each account.</p>
        data_sources: <p>The data sources to link to the OpenSearch application.</p>
        iam_identity_center_options: <p>Configuration settings for integrating Amazon Web Services IAM Identity Center with the OpenSearch application.</p>
        app_configs: <p>Configuration settings for the OpenSearch application, including administrative options.</p>
        kms_key_arn: <p>The Amazon Resource Name (ARN) of the KMS key used to encrypt the application's data at rest. If provided, the application uses your customer-managed key for encryption. If omitted, the application uses an AWS-managed key. The KMS key must be in the same region as the application.</p>

    Raises:
        capo_opensearch.errors.access_denied_exception.AccessDeniedException: <p>An error occurred because you don't have permissions to access the resource.</p>
        capo_opensearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_opensearch.errors.conflict_exception.ConflictException: <p>An error occurred because the client attempts to remove a resource that is currently in use.</p>
        capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearch.types.create_application_request.CreateApplicationRequest]",
    ) -> OperationResponse[
        "capo_opensearch.types.create_application_response.CreateApplicationResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.create_application

        output, http_response = (
            capo_opensearch._operations.amazon_open_search_service.create_application.create_application(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplication")
    )
    input_: capo_opensearch.types.create_application_request.CreateApplicationRequest = {
        "name": name
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if data_sources is not None:
        input_["data_sources"] = data_sources
    if iam_identity_center_options is not None:
        input_["iam_identity_center_options"] = iam_identity_center_options
    if app_configs is not None:
        input_["app_configs"] = app_configs
    if tag_list is not None:
        input_["tag_list"] = tag_list
    if kms_key_arn is not None:
        input_["kms_key_arn"] = kms_key_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output