Skip to content

create_workteam async

create_workteam(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    workteam_name: Optional[WorkteamName] = None,
    workforce_name: Optional[WorkforceName] = None,
    member_definitions: Optional[MemberDefinitions] = None,
    description: Optional[String200] = None,
    notification_configuration: Optional[NotificationConfiguration] = None,
    worker_access_configuration: Optional[WorkerAccessConfiguration] = None,
    tags: Optional[TagList] = None,
) -> CreateWorkteamResponse

Creates a new work team for labeling your data. A work team is defined by one or more Amazon Cognito user pools. You must first create the user pools before you can create a work team.

You cannot create more than 25 work teams in an account and region.

Parameters:

  • workteam_name (Optional[WorkteamName], default: None ) –

    The name of the work team. Use this name to identify the work team.

  • workforce_name (Optional[WorkforceName], default: None ) –

    The name of the workforce.

  • member_definitions (Optional[MemberDefinitions], default: None ) –

    A list of MemberDefinition objects that contains objects that identify the workers that make up the work team.

    Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use CognitoMemberDefinition. For workforces created using your own OIDC identity provider (IdP) use OidcMemberDefinition. Do not provide input for both of these parameters in a single request.

    For workforces created using Amazon Cognito, private work teams correspond to Amazon Cognito user groups within the user pool used to create a workforce. All of the CognitoMemberDefinition objects that make up the member definition must have the same ClientId and UserPool values. To add a Amazon Cognito user group to an existing worker pool, see Adding groups to a User Pool. For more information about user pools, see Amazon Cognito User Pools.

    For workforces created using your own OIDC IdP, specify the user groups that you want to include in your private work team in OidcMemberDefinition by listing those groups in Groups.

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

    A description of the work team.

  • notification_configuration (Optional[NotificationConfiguration], default: None ) –

    Configures notification of workers regarding available or expiring work items.

  • worker_access_configuration (Optional[WorkerAccessConfiguration], default: None ) –

    Use this optional parameter to constrain access to an Amazon S3 resource based on the IP address using supported IAM global condition keys. The Amazon S3 resource is accessed in the worker portal using a Amazon S3 presigned URL.

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

    An array of key-value pairs.

    For more information, see Resource Tag and Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • 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/async_sage_maker.py
async def create_workteam(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    workteam_name: Optional[
        "capo_sagemaker.types.workteam_name.WorkteamName"
    ] = None,
    workforce_name: Optional[
        "capo_sagemaker.types.workforce_name.WorkforceName"
    ] = None,
    member_definitions: Optional[
        "capo_sagemaker.types.member_definitions.MemberDefinitions"
    ] = None,
    description: Optional["capo_sagemaker.types.string200.String200"] = None,
    notification_configuration: Optional[
        "capo_sagemaker.types.notification_configuration.NotificationConfiguration"
    ] = None,
    worker_access_configuration: Optional[
        "capo_sagemaker.types.worker_access_configuration.WorkerAccessConfiguration"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
) -> "capo_sagemaker.types.create_workteam_response.CreateWorkteamResponse":
    """<p>Creates a new work team for labeling your data. A work team is defined by one or more Amazon Cognito user pools. You must first create the user pools before you can create a work team.</p> <p>You cannot create more than 25 work teams in an account and region.</p>

    Args:
        workteam_name: <p>The name of the work team. Use this name to identify the work team.</p>
        workforce_name: <p>The name of the workforce.</p>
        member_definitions: <p>A list of <code>MemberDefinition</code> objects that contains objects that identify the workers that make up the work team. </p> <p>Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use <code>CognitoMemberDefinition</code>. For workforces created using your own OIDC identity provider (IdP) use <code>OidcMemberDefinition</code>. Do not provide input for both of these parameters in a single request.</p> <p>For workforces created using Amazon Cognito, private work teams correspond to Amazon Cognito <i>user groups</i> within the user pool used to create a workforce. All of the <code>CognitoMemberDefinition</code> objects that make up the member definition must have the same <code>ClientId</code> and <code>UserPool</code> values. To add a Amazon Cognito user group to an existing worker pool, see <a href="">Adding groups to a User Pool</a>. For more information about user pools, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html">Amazon Cognito User Pools</a>.</p> <p>For workforces created using your own OIDC IdP, specify the user groups that you want to include in your private work team in <code>OidcMemberDefinition</code> by listing those groups in <code>Groups</code>.</p>
        description: <p>A description of the work team.</p>
        notification_configuration: <p>Configures notification of workers regarding available or expiring work items.</p>
        worker_access_configuration: <p>Use this optional parameter to constrain access to an Amazon S3 resource based on the IP address using supported IAM global condition keys. The Amazon S3 resource is accessed in the worker portal using a Amazon S3 presigned URL.</p>
        tags: <p>An array of key-value pairs.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html">Resource Tag</a> and <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what">Using Cost Allocation Tags</a> in the <i> Amazon Web Services Billing and Cost Management User Guide</i>.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_workteam_request.CreateWorkteamRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_workteam_response.CreateWorkteamResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_workteam

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_workteam.async_create_workteam(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateWorkteam")
    )
    input_: capo_sagemaker.types.create_workteam_request.CreateWorkteamRequest = {}
    if workteam_name is not None:
        input_["workteam_name"] = workteam_name
    if workforce_name is not None:
        input_["workforce_name"] = workforce_name
    if member_definitions is not None:
        input_["member_definitions"] = member_definitions
    if description is not None:
        input_["description"] = description
    if notification_configuration is not None:
        input_["notification_configuration"] = notification_configuration
    if worker_access_configuration is not None:
        input_["worker_access_configuration"] = worker_access_configuration
    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