published on Thursday, Jul 16, 2026 by Pulumi
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_batch_task" "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_batch_task" "batchTaskResource" {
lifecycle {
create_before_destroy = true
}
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:
- Instance
Ids List<string> - A list of PolarDB application IDs to which the task will be applied.
- Task
Params List<Pulumi.Ali Cloud. Polar DB. Inputs. Batch Task Task Param> - The parameters for the task. See
taskParamsbelow. - 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.
- Instance
Ids []string - A list of PolarDB application IDs to which the task will be applied.
- Task
Params []BatchTask Task Param Args - The parameters for the task. See
taskParamsbelow. - 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.
- 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
taskParamsbelow. - 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.
- instance
Ids List<String> - A list of PolarDB application IDs to which the task will be applied.
- task
Params List<BatchTask Task Param> - The parameters for the task. See
taskParamsbelow. - 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.
- instance
Ids string[] - A list of PolarDB application IDs to which the task will be applied.
- task
Params BatchTask Task Param[] - The parameters for the task. See
taskParamsbelow. - 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.
- instance_
ids Sequence[str] - A list of PolarDB application IDs to which the task will be applied.
- task_
params Sequence[BatchTask Task Param Args] - The parameters for the task. See
taskParamsbelow. - 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.
- instance
Ids List<String> - A list of PolarDB application IDs to which the task will be applied.
- task
Params List<Property Map> - The parameters for the task. See
taskParamsbelow. - 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the BatchTask resource produces the following output properties:
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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) -> BatchTaskfunc 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_batch_task.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.
- 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<Pulumi.Ali Cloud. Polar DB. Inputs. Batch Task Task Param> - The parameters for the task. See
taskParamsbelow. - 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.
- Batch
Id string - The ID of the batch operation returned by the API.
- Instance
Ids []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 []BatchTask Task Param Args - The parameters for the task. See
taskParamsbelow. - 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.
- 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
taskParamsbelow. - 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.
- 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<BatchTask Task Param> - The parameters for the task. See
taskParamsbelow. - 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.
- batch
Id string - The ID of the batch operation returned by the API.
- instance
Ids 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 BatchTask Task Param[] - The parameters for the task. See
taskParamsbelow. - 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.
- 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[BatchTask Task Param Args] - The parameters for the task. See
taskParamsbelow. - 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.
- 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<Property Map> - The parameters for the task. See
taskParamsbelow. - 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.
Supporting Types
BatchTaskTaskParam, BatchTaskTaskParamArgs
- 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.
- 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.
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
alicloudTerraform Provider.
published on Thursday, Jul 16, 2026 by Pulumi