Class InvocationJob


  • public class InvocationJob
    extends com.pulumi.resources.CustomResource
    Manages an Amazon Bedrock model invocation job. A model invocation job runs a foundation model, or a model accessed through an inference profile, against multiple prompts read from Amazon S3, and writes the results back to Amazon S3. > **Note:** Amazon Bedrock does not support permanently deleting a model invocation job. Destroying this resource stops the job (if it hasn't already reached a terminal state) using the [StopModelInvocationJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_StopModelInvocationJob.html) API, then removes it from Terraform state. Set `skipDestroy` to leave the job in its current state instead. > **Note:** This resource does not support `tags`. Amazon Bedrock does not allow retrieving tags for a batch inference job that has already finished running, which would cause errors when importing or listing existing jobs. ## Example Usage ### Basic Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.bedrockmodel.InvocationJob;
     import com.pulumi.aws.bedrockmodel.InvocationJobArgs;
     import com.pulumi.aws.bedrockmodel.inputs.InvocationJobInputDataConfigArgs;
     import com.pulumi.aws.bedrockmodel.inputs.InvocationJobInputDataConfigS3InputDataConfigArgs;
     import com.pulumi.aws.bedrockmodel.inputs.InvocationJobOutputDataConfigArgs;
     import com.pulumi.aws.bedrockmodel.inputs.InvocationJobOutputDataConfigS3OutputDataConfigArgs;
     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) {
             var example = new InvocationJob("example", InvocationJobArgs.builder()
                 .inputDataConfig(InvocationJobInputDataConfigArgs.builder()
                     .s3InputDataConfig(InvocationJobInputDataConfigS3InputDataConfigArgs.builder()
                         .s3Uri(String.format("s3://%s/input/", exampleAwsS3Bucket.id()))
                         .build())
                     .build())
                 .outputDataConfig(InvocationJobOutputDataConfigArgs.builder()
                     .s3OutputDataConfig(InvocationJobOutputDataConfigS3OutputDataConfigArgs.builder()
                         .s3Uri(String.format("s3://%s/output/", exampleAwsS3Bucket.id()))
                         .build())
                     .build())
                 .jobName("example-job")
                 .modelId("us.amazon.nova-2-lite-v1:0")
                 .roleArn(exampleAwsIamRole.arn())
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `jobArn` (String) ARN of the batch inference job. Using `pulumi import`, import Bedrock Model Invocation Job using the `jobArn`. For example: ```sh $ pulumi import aws:bedrockmodel/invocationJob:InvocationJob example arn:aws:bedrock:us-west-2:123456789012:model-invocation-job/abcdefgh1234 ```
    • 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

      • InvocationJob

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

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

        public InvocationJob​(java.lang.String name,
                             InvocationJobArgs 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

      • endTime

        public com.pulumi.core.Output<java.lang.String> endTime()
        Returns:
        Time at which the batch inference job ended.
      • errorRecordCount

        public com.pulumi.core.Output<java.lang.Integer> errorRecordCount()
        Returns:
        Number of records that failed to process in the batch inference job.
      • inputDataConfig

        public com.pulumi.core.Output<InvocationJobInputDataConfig> inputDataConfig()
        Returns:
        Location of the input data for the batch inference job. See `inputDataConfig` Block below.
      • jobArn

        public com.pulumi.core.Output<java.lang.String> jobArn()
        Returns:
        ARN of the batch inference job.
      • jobExpirationTime

        public com.pulumi.core.Output<java.lang.String> jobExpirationTime()
        Returns:
        Time at which the batch inference job times or timed out.
      • jobName

        public com.pulumi.core.Output<java.lang.String> jobName()
        Returns:
        Name for the batch inference job.
      • modelId

        public com.pulumi.core.Output<java.lang.String> modelId()
        Returns:
        Identifier of the foundation model, or inference profile, to use for the batch inference job.
      • modelInvocationType

        public com.pulumi.core.Output<java.lang.String> modelInvocationType()
        Returns:
        Invocation endpoint used for the batch inference job.
      • outputDataConfig

        public com.pulumi.core.Output<InvocationJobOutputDataConfig> outputDataConfig()
        Returns:
        Location where the results of the batch inference job are stored. See `outputDataConfig` Block below.
      • processedRecordCount

        public com.pulumi.core.Output<java.lang.Integer> processedRecordCount()
        Returns:
        Number of records that have been processed in the batch inference job.
      • 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 the IAM service role that Amazon Bedrock can assume to carry out and manage the batch inference job. See [Create a service role for batch inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). The following arguments are optional:
      • skipDestroy

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> skipDestroy()
        Returns:
        Whether to leave the batch inference job in its current state when destroying the resource, instead of stopping it.
      • status

        public com.pulumi.core.Output<java.lang.String> status()
        Returns:
        Status of the batch inference job.
      • submitTime

        public com.pulumi.core.Output<java.lang.String> submitTime()
        Returns:
        Time at which the batch inference job was submitted.
      • successRecordCount

        public com.pulumi.core.Output<java.lang.Integer> successRecordCount()
        Returns:
        Number of records that were successfully processed in the batch inference job.
      • timeoutDurationInHours

        public com.pulumi.core.Output<java.lang.Integer> timeoutDurationInHours()
        Returns:
        Number of hours after which to force the batch inference job to time out.
      • totalRecordCount

        public com.pulumi.core.Output<java.lang.Integer> totalRecordCount()
        Returns:
        Total number of records in the batch inference job.
      • vpcConfig

        public com.pulumi.core.Output<java.util.Optional<InvocationJobVpcConfig>> vpcConfig()
        Returns:
        VPC configuration for the data used by the batch inference job. See `vpcConfig` Block below.
      • get

        public static InvocationJob get​(java.lang.String name,
                                        com.pulumi.core.Output<java.lang.String> id,
                                        @Nullable
                                        InvocationJobState 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.