1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. polardb
  6. BatchTask
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
alicloud logo
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi

    Provides a PolarDB Batch Task resource. This resource is used to manage batch operations, such as installing or uninstalling skills (e.g., Polar Claw), on multiple PolarDB instances simultaneously.

    NOTE: Available since v1.279.0.

    Example Usage

    Create a PolarDB Batch Task to install skills

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = new alicloud.polardb.BatchTask("default", {
        taskName: "terraform-batch-task-example",
        taskType: "polarclaw_install_skills",
        regionId: "cn-hangzhou",
        instanceIds: [
            "pa-xxx",
            "pa-abc",
        ],
        taskParams: [{
            skillName: "ontology",
            version: "1.0.4",
        }],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.polardb.BatchTask("default",
        task_name="terraform-batch-task-example",
        task_type="polarclaw_install_skills",
        region_id="cn-hangzhou",
        instance_ids=[
            "pa-xxx",
            "pa-abc",
        ],
        task_params=[{
            "skill_name": "ontology",
            "version": "1.0.4",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := polardb.NewBatchTask(ctx, "default", &polardb.BatchTaskArgs{
    			TaskName: pulumi.String("terraform-batch-task-example"),
    			TaskType: pulumi.String("polarclaw_install_skills"),
    			RegionId: pulumi.String("cn-hangzhou"),
    			InstanceIds: pulumi.StringArray{
    				pulumi.String("pa-xxx"),
    				pulumi.String("pa-abc"),
    			},
    			TaskParams: polardb.BatchTaskTaskParamArray{
    				&polardb.BatchTaskTaskParamArgs{
    					SkillName: pulumi.String("ontology"),
    					Version:   pulumi.String("1.0.4"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new AliCloud.PolarDB.BatchTask("default", new()
        {
            TaskName = "terraform-batch-task-example",
            TaskType = "polarclaw_install_skills",
            RegionId = "cn-hangzhou",
            InstanceIds = new[]
            {
                "pa-xxx",
                "pa-abc",
            },
            TaskParams = new[]
            {
                new AliCloud.PolarDB.Inputs.BatchTaskTaskParamArgs
                {
                    SkillName = "ontology",
                    Version = "1.0.4",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.polardb.BatchTask;
    import com.pulumi.alicloud.polardb.BatchTaskArgs;
    import com.pulumi.alicloud.polardb.inputs.BatchTaskTaskParamArgs;
    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 default_ = new BatchTask("default", BatchTaskArgs.builder()
                .taskName("terraform-batch-task-example")
                .taskType("polarclaw_install_skills")
                .regionId("cn-hangzhou")
                .instanceIds(            
                    "pa-xxx",
                    "pa-abc")
                .taskParams(BatchTaskTaskParamArgs.builder()
                    .skillName("ontology")
                    .version("1.0.4")
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: alicloud:polardb:BatchTask
        properties:
          taskName: terraform-batch-task-example
          taskType: polarclaw_install_skills
          regionId: cn-hangzhou
          instanceIds:
            - pa-xxx
            - pa-abc
          taskParams:
            - skillName: ontology
              version: 1.0.4
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    resource "alicloud_polardb_batchtask" "default" {
      task_name    = "terraform-batch-task-example"
      task_type    = "polarclaw_install_skills"
      region_id    = "cn-hangzhou"
      instance_ids = ["pa-xxx", "pa-abc"]
      task_params {
        skill_name = "ontology"
        version    = "1.0.4"
      }
    }
    

    Removing alicloud.polardb.BatchTask from your configuration

    The alicloud.polardb.BatchTask resource allows you to manage batch tasks. Note that this resource represents an asynchronous operation. Removing this resource from your configuration will remove it from your statefile and management, but it will not undo the actions performed by the task (e.g., it will not uninstall the skills if the task was an installation). You can verify the status of the instances via the PolarDB Console.

    📚 Need more examples? VIEW MORE EXAMPLES

    Create BatchTask Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BatchTask(name: string, args: BatchTaskArgs, opts?: CustomResourceOptions);
    @overload
    def BatchTask(resource_name: str,
                  args: BatchTaskArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def BatchTask(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  instance_ids: Optional[Sequence[str]] = None,
                  task_params: Optional[Sequence[BatchTaskTaskParamArgs]] = None,
                  task_type: Optional[str] = None,
                  region_id: Optional[str] = None,
                  task_name: Optional[str] = None)
    func NewBatchTask(ctx *Context, name string, args BatchTaskArgs, opts ...ResourceOption) (*BatchTask, error)
    public BatchTask(string name, BatchTaskArgs args, CustomResourceOptions? opts = null)
    public BatchTask(String name, BatchTaskArgs args)
    public BatchTask(String name, BatchTaskArgs args, CustomResourceOptions options)
    
    type: alicloud:polardb:BatchTask
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_polardb_batchtask" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args BatchTaskArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BatchTaskArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BatchTaskArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BatchTaskArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BatchTaskArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var batchTaskResource = new AliCloud.PolarDB.BatchTask("batchTaskResource", new()
    {
        InstanceIds = new[]
        {
            "string",
        },
        TaskParams = new[]
        {
            new AliCloud.PolarDB.Inputs.BatchTaskTaskParamArgs
            {
                SkillName = "string",
                Version = "string",
            },
        },
        TaskType = "string",
        RegionId = "string",
        TaskName = "string",
    });
    
    example, err := polardb.NewBatchTask(ctx, "batchTaskResource", &polardb.BatchTaskArgs{
    	InstanceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	TaskParams: polardb.BatchTaskTaskParamArray{
    		&polardb.BatchTaskTaskParamArgs{
    			SkillName: pulumi.String("string"),
    			Version:   pulumi.String("string"),
    		},
    	},
    	TaskType: pulumi.String("string"),
    	RegionId: pulumi.String("string"),
    	TaskName: pulumi.String("string"),
    })
    
    resource "alicloud_polardb_batchtask" "batchTaskResource" {
      instance_ids = ["string"]
      task_params {
        skill_name = "string"
        version    = "string"
      }
      task_type = "string"
      region_id = "string"
      task_name = "string"
    }
    
    var batchTaskResource = new BatchTask("batchTaskResource", BatchTaskArgs.builder()
        .instanceIds("string")
        .taskParams(BatchTaskTaskParamArgs.builder()
            .skillName("string")
            .version("string")
            .build())
        .taskType("string")
        .regionId("string")
        .taskName("string")
        .build());
    
    batch_task_resource = alicloud.polardb.BatchTask("batchTaskResource",
        instance_ids=["string"],
        task_params=[{
            "skill_name": "string",
            "version": "string",
        }],
        task_type="string",
        region_id="string",
        task_name="string")
    
    const batchTaskResource = new alicloud.polardb.BatchTask("batchTaskResource", {
        instanceIds: ["string"],
        taskParams: [{
            skillName: "string",
            version: "string",
        }],
        taskType: "string",
        regionId: "string",
        taskName: "string",
    });
    
    type: alicloud:polardb:BatchTask
    properties:
        instanceIds:
            - string
        regionId: string
        taskName: string
        taskParams:
            - skillName: string
              version: string
        taskType: string
    

    BatchTask Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The BatchTask resource accepts the following input properties:

    InstanceIds List<string>
    A list of PolarDB application IDs to which the task will be applied.
    TaskParams List<Pulumi.AliCloud.PolarDB.Inputs.BatchTaskTaskParam>
    The parameters for the task. See taskParams below.
    TaskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    RegionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    TaskName string
    The name of the batch task.
    InstanceIds []string
    A list of PolarDB application IDs to which the task will be applied.
    TaskParams []BatchTaskTaskParamArgs
    The parameters for the task. See taskParams below.
    TaskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    RegionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    TaskName string
    The name of the batch task.
    instance_ids list(string)
    A list of PolarDB application IDs to which the task will be applied.
    task_params list(object)
    The parameters for the task. See taskParams below.
    task_type string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    region_id string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    task_name string
    The name of the batch task.
    instanceIds List<String>
    A list of PolarDB application IDs to which the task will be applied.
    taskParams List<BatchTaskTaskParam>
    The parameters for the task. See taskParams below.
    taskType String
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    regionId String
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName String
    The name of the batch task.
    instanceIds string[]
    A list of PolarDB application IDs to which the task will be applied.
    taskParams BatchTaskTaskParam[]
    The parameters for the task. See taskParams below.
    taskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    regionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName string
    The name of the batch task.
    instance_ids Sequence[str]
    A list of PolarDB application IDs to which the task will be applied.
    task_params Sequence[BatchTaskTaskParamArgs]
    The parameters for the task. See taskParams below.
    task_type str
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    region_id str
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    task_name str
    The name of the batch task.
    instanceIds List<String>
    A list of PolarDB application IDs to which the task will be applied.
    taskParams List<Property Map>
    The parameters for the task. See taskParams below.
    taskType String
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    regionId String
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName String
    The name of the batch task.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BatchTask resource produces the following output properties:

    BatchId string
    The ID of the batch operation returned by the API.
    Id string
    The provider-assigned unique ID for this managed resource.
    TaskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    BatchId string
    The ID of the batch operation returned by the API.
    Id string
    The provider-assigned unique ID for this managed resource.
    TaskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    batch_id string
    The ID of the batch operation returned by the API.
    id string
    The provider-assigned unique ID for this managed resource.
    task_status string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    batchId String
    The ID of the batch operation returned by the API.
    id String
    The provider-assigned unique ID for this managed resource.
    taskStatus String
    The status of the task. Valid values may include Running, Success, Failed, etc.
    batchId string
    The ID of the batch operation returned by the API.
    id string
    The provider-assigned unique ID for this managed resource.
    taskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    batch_id str
    The ID of the batch operation returned by the API.
    id str
    The provider-assigned unique ID for this managed resource.
    task_status str
    The status of the task. Valid values may include Running, Success, Failed, etc.
    batchId String
    The ID of the batch operation returned by the API.
    id String
    The provider-assigned unique ID for this managed resource.
    taskStatus String
    The status of the task. Valid values may include Running, Success, Failed, etc.

    Look up Existing BatchTask Resource

    Get an existing BatchTask resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BatchTaskState, opts?: CustomResourceOptions): BatchTask
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            batch_id: Optional[str] = None,
            instance_ids: Optional[Sequence[str]] = None,
            region_id: Optional[str] = None,
            task_name: Optional[str] = None,
            task_params: Optional[Sequence[BatchTaskTaskParamArgs]] = None,
            task_status: Optional[str] = None,
            task_type: Optional[str] = None) -> BatchTask
    func GetBatchTask(ctx *Context, name string, id IDInput, state *BatchTaskState, opts ...ResourceOption) (*BatchTask, error)
    public static BatchTask Get(string name, Input<string> id, BatchTaskState? state, CustomResourceOptions? opts = null)
    public static BatchTask get(String name, Output<String> id, BatchTaskState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:polardb:BatchTask    get:      id: ${id}
    import {
      to = alicloud_polardb_batchtask.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BatchId string
    The ID of the batch operation returned by the API.
    InstanceIds List<string>
    A list of PolarDB application IDs to which the task will be applied.
    RegionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    TaskName string
    The name of the batch task.
    TaskParams List<Pulumi.AliCloud.PolarDB.Inputs.BatchTaskTaskParam>
    The parameters for the task. See taskParams below.
    TaskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    TaskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    BatchId string
    The ID of the batch operation returned by the API.
    InstanceIds []string
    A list of PolarDB application IDs to which the task will be applied.
    RegionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    TaskName string
    The name of the batch task.
    TaskParams []BatchTaskTaskParamArgs
    The parameters for the task. See taskParams below.
    TaskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    TaskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    batch_id string
    The ID of the batch operation returned by the API.
    instance_ids list(string)
    A list of PolarDB application IDs to which the task will be applied.
    region_id string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    task_name string
    The name of the batch task.
    task_params list(object)
    The parameters for the task. See taskParams below.
    task_status string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    task_type string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    batchId String
    The ID of the batch operation returned by the API.
    instanceIds List<String>
    A list of PolarDB application IDs to which the task will be applied.
    regionId String
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName String
    The name of the batch task.
    taskParams List<BatchTaskTaskParam>
    The parameters for the task. See taskParams below.
    taskStatus String
    The status of the task. Valid values may include Running, Success, Failed, etc.
    taskType String
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    batchId string
    The ID of the batch operation returned by the API.
    instanceIds string[]
    A list of PolarDB application IDs to which the task will be applied.
    regionId string
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName string
    The name of the batch task.
    taskParams BatchTaskTaskParam[]
    The parameters for the task. See taskParams below.
    taskStatus string
    The status of the task. Valid values may include Running, Success, Failed, etc.
    taskType string
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    batch_id str
    The ID of the batch operation returned by the API.
    instance_ids Sequence[str]
    A list of PolarDB application IDs to which the task will be applied.
    region_id str
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    task_name str
    The name of the batch task.
    task_params Sequence[BatchTaskTaskParamArgs]
    The parameters for the task. See taskParams below.
    task_status str
    The status of the task. Valid values may include Running, Success, Failed, etc.
    task_type str
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.
    batchId String
    The ID of the batch operation returned by the API.
    instanceIds List<String>
    A list of PolarDB application IDs to which the task will be applied.
    regionId String
    The region ID where the PolarDB applications are located. If not specified, the provider's region is used.
    taskName String
    The name of the batch task.
    taskParams List<Property Map>
    The parameters for the task. See taskParams below.
    taskStatus String
    The status of the task. Valid values may include Running, Success, Failed, etc.
    taskType String
    The type of the batch task. Valid values: polarclawInstallSkills, polarclawUninstallSkills.

    Supporting Types

    BatchTaskTaskParam, BatchTaskTaskParamArgs

    SkillName string
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    Version string
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    SkillName string
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    Version string
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    skill_name string
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    version string
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    skillName String
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    version String
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    skillName string
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    version string
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    skill_name str
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    version str
    The version of the skill. If not specified, the latest version may be used depending on the task type.
    skillName String
    The name of the skill to be installed or uninstalled. For example, polarClaw.
    version String
    The version of the skill. If not specified, the latest version may be used depending on the task type.

    Import

    PolarDB Batch Task can be imported using the id, e.g.

    $ pulumi import alicloud:polardb/batchTask:BatchTask example pcb-abc12345678
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Viewing docs for Alibaba Cloud v3.105.0
    published on Thursday, Jul 16, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial