Skip to content

create_partner_app

create_partner_app(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    name: Optional[PartnerAppName] = None,
    type: Optional[PartnerAppType] = None,
    execution_role_arn: Optional[RoleArn] = None,
    kms_key_id: Optional[KmsKeyId] = None,
    maintenance_config: Optional[PartnerAppMaintenanceConfig] = None,
    tier: Optional[NonEmptyString64] = None,
    application_config: Optional[PartnerAppConfig] = None,
    idc_config: Optional[IdcConfigInput] = None,
    auth_type: Optional[PartnerAppAuthType] = None,
    enable_iam_session_based_identity: Optional[Boolean] = None,
    enable_auto_minor_version_upgrade: Optional[Boolean] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
) -> CreatePartnerAppResponse

Creates an Amazon SageMaker Partner AI App.

Parameters:

  • name (Optional[PartnerAppName], default: None ) –

    The name to give the SageMaker Partner AI App.

  • type (Optional[PartnerAppType], default: None ) –

    The type of SageMaker Partner AI App to create. Must be one of the following: lakera-guard, comet, deepchecks-llm-evaluation, or fiddler.

  • execution_role_arn (Optional[RoleArn], default: None ) –

    The ARN of the IAM role that the partner application uses.

  • kms_key_id (Optional[KmsKeyId], default: None ) –

    SageMaker Partner AI Apps uses Amazon Web Services KMS to encrypt data at rest using an Amazon Web Services managed key by default. For more control, specify a customer managed key.

  • maintenance_config (Optional[PartnerAppMaintenanceConfig], default: None ) –

    Maintenance configuration settings for the SageMaker Partner AI App.

  • tier (Optional[NonEmptyString64], default: None ) –

    Indicates the instance type and size of the cluster attached to the SageMaker Partner AI App.

  • application_config (Optional[PartnerAppConfig], default: None ) –

    Configuration settings for the SageMaker Partner AI App.

  • idc_config (Optional[IdcConfigInput], default: None ) –

    Specifies the Amazon Web Services IAM Identity Center configuration for the SageMaker Partner AI App. Specify this parameter when AuthType is IDC. Apps that use IAM authorization don't use this parameter.

  • auth_type (Optional[PartnerAppAuthType], default: None ) –

    The authorization type that users use to access the SageMaker Partner AI App. Valid values:

    • IAM: Users access the SageMaker Partner AI App with their Amazon Web Services IAM identity.

    • IDC: Users access the SageMaker Partner AI App with their Amazon Web Services IAM Identity Center identity. Specify the Identity Center instance to use in IdcConfig.

  • enable_iam_session_based_identity (Optional[Boolean], default: None ) –

    When set to TRUE, the SageMaker Partner AI App sets the Amazon Web Services IAM session name or the authenticated IAM user as the identity of the SageMaker Partner AI App user.

  • enable_auto_minor_version_upgrade (Optional[Boolean], default: None ) –

    When set to TRUE, the SageMaker Partner AI App is automatically upgraded to the latest minor version during the next scheduled maintenance window, if one is available. Default is FALSE.

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

    A unique token that guarantees that the call to this API is idempotent.

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

    Each tag consists of a key and an optional value. Tag keys must be unique per resource.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_partner_app(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    name: Optional["capo_sagemaker.types.partner_app_name.PartnerAppName"] = None,
    type: Optional["capo_sagemaker.types.partner_app_type.PartnerAppType"] = None,
    execution_role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    kms_key_id: Optional["capo_sagemaker.types.kms_key_id.KmsKeyId"] = None,
    maintenance_config: Optional[
        "capo_sagemaker.types.partner_app_maintenance_config.PartnerAppMaintenanceConfig"
    ] = None,
    tier: Optional[
        "capo_sagemaker.types.non_empty_string64.NonEmptyString64"
    ] = None,
    application_config: Optional[
        "capo_sagemaker.types.partner_app_config.PartnerAppConfig"
    ] = None,
    idc_config: Optional[
        "capo_sagemaker.types.idc_config_input.IdcConfigInput"
    ] = None,
    auth_type: Optional[
        "capo_sagemaker.types.partner_app_auth_type.PartnerAppAuthType"
    ] = None,
    enable_iam_session_based_identity: Optional[
        "capo_sagemaker.types.boolean.Boolean"
    ] = None,
    enable_auto_minor_version_upgrade: Optional[
        "capo_sagemaker.types.boolean.Boolean"
    ] = None,
    client_token: Optional["capo_sagemaker.types.client_token.ClientToken"] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_partner_app_response.CreatePartnerAppResponse":
    """<p>Creates an Amazon SageMaker Partner AI App.</p>

    Args:
        name: <p>The name to give the SageMaker Partner AI App.</p>
        type: <p>The type of SageMaker Partner AI App to create. Must be one of the following: <code>lakera-guard</code>, <code>comet</code>, <code>deepchecks-llm-evaluation</code>, or <code>fiddler</code>.</p>
        execution_role_arn: <p>The ARN of the IAM role that the partner application uses.</p>
        kms_key_id: <p>SageMaker Partner AI Apps uses Amazon Web Services KMS to encrypt data at rest using an Amazon Web Services managed key by default. For more control, specify a customer managed key.</p>
        maintenance_config: <p>Maintenance configuration settings for the SageMaker Partner AI App.</p>
        tier: <p>Indicates the instance type and size of the cluster attached to the SageMaker Partner AI App.</p>
        application_config: <p>Configuration settings for the SageMaker Partner AI App.</p>
        idc_config: <p>Specifies the Amazon Web Services IAM Identity Center configuration for the SageMaker Partner AI App. Specify this parameter when <code>AuthType</code> is <code>IDC</code>. Apps that use <code>IAM</code> authorization don't use this parameter.</p>
        auth_type: <p>The authorization type that users use to access the SageMaker Partner AI App. Valid values:</p> <ul> <li> <p> <code>IAM</code>: Users access the SageMaker Partner AI App with their Amazon Web Services IAM identity.</p> </li> <li> <p> <code>IDC</code>: Users access the SageMaker Partner AI App with their Amazon Web Services IAM Identity Center identity. Specify the Identity Center instance to use in <code>IdcConfig</code>.</p> </li> </ul>
        enable_iam_session_based_identity: <p>When set to <code>TRUE</code>, the SageMaker Partner AI App sets the Amazon Web Services IAM session name or the authenticated IAM user as the identity of the SageMaker Partner AI App user.</p>
        enable_auto_minor_version_upgrade: <p>When set to <code>TRUE</code>, the SageMaker Partner AI App is automatically upgraded to the latest minor version during the next scheduled maintenance window, if one is available. Default is <code>FALSE</code>.</p>
        client_token: <p>A unique token that guarantees that the call to this API is idempotent.</p>
        tags: <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_partner_app_request.CreatePartnerAppRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_partner_app_response.CreatePartnerAppResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_partner_app

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_partner_app.create_partner_app(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePartnerApp")
    )
    input_: capo_sagemaker.types.create_partner_app_request.CreatePartnerAppRequest = {}
    if name is not None:
        input_["name"] = name
    if type is not None:
        input_["type"] = type
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn
    if kms_key_id is not None:
        input_["kms_key_id"] = kms_key_id
    if maintenance_config is not None:
        input_["maintenance_config"] = maintenance_config
    if tier is not None:
        input_["tier"] = tier
    if application_config is not None:
        input_["application_config"] = application_config
    if idc_config is not None:
        input_["idc_config"] = idc_config
    if auth_type is not None:
        input_["auth_type"] = auth_type
    if enable_iam_session_based_identity is not None:
        input_["enable_iam_session_based_identity"] = (
            enable_iam_session_based_identity
        )
    if enable_auto_minor_version_upgrade is not None:
        input_["enable_auto_minor_version_upgrade"] = (
            enable_auto_minor_version_upgrade
        )
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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