published on Thursday, Nov 5, 2026 by ibm-cloud
published on Thursday, Nov 5, 2026 by ibm-cloud
Provides a read-only data source for database_tasks. Supports both Classic and Gen2 database instances. You can then reference the fields of the data source in other resources within the same configuration using interpolation syntax.
Example Usage
Classic
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const databaseTasks = ibm.getDatabaseTasks({
deploymentId: database.id,
});
import pulumi
import pulumi_ibm as ibm
database_tasks = ibm.get_database_tasks(deployment_id=database["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.GetDatabaseTasks(ctx, &ibm.GetDatabaseTasksArgs{
DeploymentId: database.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var databaseTasks = Ibm.GetDatabaseTasks.Invoke(new()
{
DeploymentId = database.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetDatabaseTasksArgs;
import java.util.List;
import java.util.ArrayList;
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) {
final var databaseTasks = IbmFunctions.getDatabaseTasks(GetDatabaseTasksArgs.builder()
.deploymentId(database.id())
.build());
}
}
variables:
databaseTasks:
fn::invoke:
function: ibm:getDatabaseTasks
arguments:
deploymentId: ${database.id}
Example coming soon!
Gen2
For Gen2 instances, the deployment_id is a Gen2 database instance CRN. The data source returns a single task representing the current instance state.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const databaseTasks = ibm.getDatabaseTasks({
deploymentId: "crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::",
});
import pulumi
import pulumi_ibm as ibm
database_tasks = ibm.get_database_tasks(deployment_id="crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.GetDatabaseTasks(ctx, &ibm.GetDatabaseTasksArgs{
DeploymentId: "crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var databaseTasks = Ibm.GetDatabaseTasks.Invoke(new()
{
DeploymentId = "crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IbmFunctions;
import com.pulumi.ibm.inputs.GetDatabaseTasksArgs;
import java.util.List;
import java.util.ArrayList;
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) {
final var databaseTasks = IbmFunctions.getDatabaseTasks(GetDatabaseTasksArgs.builder()
.deploymentId("crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::")
.build());
}
}
variables:
databaseTasks:
fn::invoke:
function: ibm:getDatabaseTasks
arguments:
deploymentId: 'crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::'
Example coming soon!
Gen2 Behaviour
For Gen2 database instances, the data source derives task information from the current instance state via the Resource Controller API rather than the ICD tasks API. tasks always contains exactly one entry. The instance state is mapped to task attributes as follows:
| Instance State | status | progress_percent |
|---|---|---|
active | completed | 100 |
provisioning, preparing | running | 50 |
inactive | queued | 0 |
failed, removed | failed | 0 |
Using getDatabaseTasks
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDatabaseTasks(args: GetDatabaseTasksArgs, opts?: InvokeOptions): Promise<GetDatabaseTasksResult>
function getDatabaseTasksOutput(args: GetDatabaseTasksOutputArgs, opts?: InvokeOutputOptions): Output<GetDatabaseTasksResult>def get_database_tasks(deployment_id: Optional[str] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatabaseTasksResult
def get_database_tasks_output(deployment_id: pulumi.Input[Optional[str]] = None,
id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetDatabaseTasksResult]func GetDatabaseTasks(ctx *Context, args *GetDatabaseTasksArgs, opts ...InvokeOption) (*GetDatabaseTasksResult, error)
func GetDatabaseTasksOutput(ctx *Context, args *GetDatabaseTasksOutputArgs, opts ...InvokeOption) GetDatabaseTasksResultOutput> Note: This function is named GetDatabaseTasks in the Go SDK.
public static class GetDatabaseTasks
{
public static Task<GetDatabaseTasksResult> InvokeAsync(GetDatabaseTasksArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseTasksResult> Invoke(GetDatabaseTasksInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetDatabaseTasksResult> Invoke(GetDatabaseTasksInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetDatabaseTasksResult> getDatabaseTasks(GetDatabaseTasksArgs args, InvokeOptions options)
public static Output<GetDatabaseTasksResult> getDatabaseTasks(GetDatabaseTasksArgs args, InvokeOptions options)
public static Output<GetDatabaseTasksResult> getDatabaseTasks(GetDatabaseTasksArgs args, InvokeOutputOptions options)
fn::invoke:
function: ibm:index/getDatabaseTasks:getDatabaseTasks
arguments:
# arguments dictionarydata "ibm_get_database_tasks" "name" {
# arguments
}The following arguments are supported:
- Deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- Id string
- Deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- Id string
- deployment_
id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- id string
- deployment
Id String Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- id String
- deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- id string
- deployment_
id str Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- id str
- deployment
Id String Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- id String
getDatabaseTasks Result
The following output properties are available:
- Deployment
Id string - (Optional, String) ID of the deployment the task is being performed on.
- Id string
- Tasks
List<Get
Database Tasks Task> - (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- Deployment
Id string - (Optional, String) ID of the deployment the task is being performed on.
- Id string
- Tasks
[]Get
Database Tasks Task - (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- deployment_
id string - (Optional, String) ID of the deployment the task is being performed on.
- id string
- tasks list(object)
- (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- deployment
Id String - (Optional, String) ID of the deployment the task is being performed on.
- id String
- tasks
List<Get
Database Tasks Task> - (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- deployment
Id string - (Optional, String) ID of the deployment the task is being performed on.
- id string
- tasks
Get
Database Tasks Task[] - (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- deployment_
id str - (Optional, String) ID of the deployment the task is being performed on.
- id str
- tasks
Sequence[Get
Database Tasks Task] - (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
- deployment
Id String - (Optional, String) ID of the deployment the task is being performed on.
- id String
- tasks List<Property Map>
- (Optional, List) An array of tasks. Always contains exactly one entry for Gen2 instances. Nested scheme for tasks:
Supporting Types
GetDatabaseTasksTask
- Created
At string - (Optional, String) Date and time when the task was created.
- Deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- Description string
- (Optional, String) Human-readable description of the task.
- Progress
Percent double - (Optional, Integer) Indicator as percentage of progress of the task.
- Status string
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- Task
Id string - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- Created
At string - (Optional, String) Date and time when the task was created.
- Deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- Description string
- (Optional, String) Human-readable description of the task.
- Progress
Percent float64 - (Optional, Integer) Indicator as percentage of progress of the task.
- Status string
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- Task
Id string - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- created_
at string - (Optional, String) Date and time when the task was created.
- deployment_
id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- description string
- (Optional, String) Human-readable description of the task.
- progress_
percent number - (Optional, Integer) Indicator as percentage of progress of the task.
- status string
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- task_
id string - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- created
At String - (Optional, String) Date and time when the task was created.
- deployment
Id String Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- description String
- (Optional, String) Human-readable description of the task.
- progress
Percent Double - (Optional, Integer) Indicator as percentage of progress of the task.
- status String
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- task
Id String - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- created
At string - (Optional, String) Date and time when the task was created.
- deployment
Id string Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- description string
- (Optional, String) Human-readable description of the task.
- progress
Percent number - (Optional, Integer) Indicator as percentage of progress of the task.
- status string
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- task
Id string - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- created_
at str - (Optional, String) Date and time when the task was created.
- deployment_
id str Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- description str
- (Optional, String) Human-readable description of the task.
- progress_
percent float - (Optional, Integer) Indicator as percentage of progress of the task.
- status str
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- task_
id str - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
- created
At String - (Optional, String) Date and time when the task was created.
- deployment
Id String Deployment ID.
Classic: The database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:us-east:a/<account_id>:<instance_id>::Gen2: The Gen2 database instance CRN, for example:
crn:v1:bluemix:public:databases-for-postgresql:<region>:a/<account_id>:<instance_id>::The Gen2 deployment CRN can be retrieved from:
- The
idattribute of anibm.Databaseresource configured with a Gen2 plan. - The IBM Cloud UI under Databases → your instance → Overview.
- The
- description String
- (Optional, String) Human-readable description of the task.
- progress
Percent Number - (Optional, Integer) Indicator as percentage of progress of the task.
- status String
- (Optional, String) The status of the task.
- Constraints: Allowable values are:
running,completed,failed,queued.
- Constraints: Allowable values are:
- task
Id String - (Optional, String) ID of the task. Empty string
""for Gen2 instances.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibmTerraform Provider.
published on Thursday, Nov 5, 2026 by ibm-cloud