Class LabelingJob


  • public class LabelingJob
    extends com.pulumi.resources.CustomResource
    Manage an Amazon SageMaker labeling job. ## Example Usage Basic usage:
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sagemaker.LabelingJob;
     import com.pulumi.aws.sagemaker.LabelingJobArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobHumanTaskConfigArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobHumanTaskConfigUiConfigArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobHumanTaskConfigAnnotationConsolidationConfigArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobInputConfigArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobInputConfigDataSourceArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobInputConfigDataSourceSnsDataSourceArgs;
     import com.pulumi.aws.sagemaker.inputs.LabelingJobOutputConfigArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             // https://docs.aws.amazon.com/sagemaker/latest/dg/sms-named-entity-recg.html#sms-creating-ner-api.
             var test = new LabelingJob("test", LabelingJobArgs.builder()
                 .humanTaskConfig(LabelingJobHumanTaskConfigArgs.builder()
                     .uiConfig(LabelingJobHumanTaskConfigUiConfigArgs.builder()
                         .humanTaskUiArn("arn:aws:sagemaker:us-west-2:394669845002:human-task-ui/NamedEntityRecognition")
                         .build())
                     .annotationConsolidationConfig(LabelingJobHumanTaskConfigAnnotationConsolidationConfigArgs.builder()
                         .annotationConsolidationLambdaArn("arn:aws:lambda:us-west-2:081040173940:function:ACS-NamedEntityRecognition")
                         .build())
                     .numberOfHumanWorkersPerDataObject(1)
                     .taskDescription("Apply the labels provided to specific words or phrases within the larger text block.")
                     .taskTitle("Named entity Recognition task")
                     .taskTimeLimitInSeconds(28800)
                     .workteamArn(example.arn())
                     .preHumanTaskLambdaArn("arn:aws:lambda:us-west-2:081040173940:function:PRE-NamedEntityRecognition")
                     .build())
                 .inputConfig(LabelingJobInputConfigArgs.builder()
                     .dataSource(LabelingJobInputConfigDataSourceArgs.builder()
                         .snsDataSource(LabelingJobInputConfigDataSourceSnsDataSourceArgs.builder()
                             .snsTopicArn(exampleAwsSnsTopic.arn())
                             .build())
                         .build())
                     .build())
                 .outputConfig(LabelingJobOutputConfigArgs.builder()
                     .s3OutputPath(String.format("s3://%s/", exampleAwsS3Bucket.bucket()))
                     .build())
                 .labelAttributeName("label1")
                 .labelingJobName("my-labeling-job")
                 .roleArn(exampleAwsIamRole.arn())
                 .labelCategoryConfigS3Uri(String.format("s3://%s/%s", exampleAwsS3Bucket.bucket(),exampleAwsS3Object.key()))
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import labeling jobs using the `labelingJobName`. For example: ```sh $ pulumi import aws:sagemaker/labelingJob:LabelingJob example my-labeling-job ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Detail

      • LabelingJob

        public LabelingJob​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • LabelingJob

        public LabelingJob​(java.lang.String name,
                           LabelingJobArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • LabelingJob

        public LabelingJob​(java.lang.String name,
                           LabelingJobArgs args,
                           @Nullable
                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • failureReason

        public com.pulumi.core.Output<java.lang.String> failureReason()
        Returns:
        If the job failed, the reason that it failed.
      • humanTaskConfig

        public com.pulumi.core.Output<LabelingJobHumanTaskConfig> humanTaskConfig()
        Returns:
        Configuration information required for human workers to complete a labeling task. Fields are documented below.
      • inputConfig

        public com.pulumi.core.Output<LabelingJobInputConfig> inputConfig()
        Returns:
        Input data for the labeling job. Fields are documented below.
      • jobReferenceCode

        public com.pulumi.core.Output<java.lang.String> jobReferenceCode()
        Returns:
        Unique identifier for work done as part of a labeling job.
      • labelAttributeName

        public com.pulumi.core.Output<java.lang.String> labelAttributeName()
        Returns:
        Attribute name to use for the label in the output manifest file.
      • labelCategoryConfigS3Uri

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> labelCategoryConfigS3Uri()
        Returns:
        S3 URI of the file that defines the categories used to label the data objects.
      • labelCounters

        public com.pulumi.core.Output<java.util.List<LabelingJobLabelCounter>> labelCounters()
        Returns:
        A breakdown of the number of objects labeled.
      • labelingJobAlgorithmsConfig

        public com.pulumi.core.Output<java.util.Optional<LabelingJobLabelingJobAlgorithmsConfig>> labelingJobAlgorithmsConfig()
        Returns:
        Information required to perform automated data labeling.. Fields are documented below.
      • labelingJobArn

        public com.pulumi.core.Output<java.lang.String> labelingJobArn()
        Returns:
        ARN of the labeling job.
      • labelingJobName

        public com.pulumi.core.Output<java.lang.String> labelingJobName()
        Returns:
        Name of the labeling job.
      • labelingJobStatus

        public com.pulumi.core.Output<java.lang.String> labelingJobStatus()
        Returns:
        Processing status of the labeling job.
      • outputConfig

        public com.pulumi.core.Output<LabelingJobOutputConfig> outputConfig()
        Returns:
        Location of the output data. Fields are documented below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • roleArn

        public com.pulumi.core.Output<java.lang.String> roleArn()
        Returns:
        ARN of IAM role that Amazon SageMaker assumes to perform tasks during data labeling.
      • stoppingConditions

        public com.pulumi.core.Output<java.util.List<LabelingJobStoppingCondition>> stoppingConditions()
        Returns:
        Conditions for stopping a labeling job. If any of the conditions are met, the job is automatically stopped. Fields are documented below.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A mapping of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • get

        public static LabelingJob get​(java.lang.String name,
                                      com.pulumi.core.Output<java.lang.String> id,
                                      @Nullable
                                      LabelingJobState state,
                                      @Nullable
                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.