alicloud logo
Alibaba Cloud v3.29.0, Jan 20 23

alicloud.dbs.getBackupPlans

This data source provides the Dbs Backup Plans of the current Alibaba Cloud user.

NOTE: Available in v1.185.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.DBS.GetBackupPlans.Invoke();

    var nameRegex = AliCloud.DBS.GetBackupPlans.Invoke(new()
    {
        NameRegex = "^my-BackupPlan",
    });

    return new Dictionary<string, object?>
    {
        ["dbsBackupPlanId1"] = ids.Apply(getBackupPlansResult => getBackupPlansResult.Plans[0]?.Id),
        ["dbsBackupPlanId2"] = nameRegex.Apply(getBackupPlansResult => getBackupPlansResult.Plans[0]?.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/dbs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := dbs.GetBackupPlans(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("dbsBackupPlanId1", ids.Plans[0].Id)
		nameRegex, err := dbs.GetBackupPlans(ctx, &dbs.GetBackupPlansArgs{
			NameRegex: pulumi.StringRef("^my-BackupPlan"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("dbsBackupPlanId2", nameRegex.Plans[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.dbs.DbsFunctions;
import com.pulumi.alicloud.dbs.inputs.GetBackupPlansArgs;
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 ids = DbsFunctions.getBackupPlans();

        ctx.export("dbsBackupPlanId1", ids.applyValue(getBackupPlansResult -> getBackupPlansResult.plans()[0].id()));
        final var nameRegex = DbsFunctions.getBackupPlans(GetBackupPlansArgs.builder()
            .nameRegex("^my-BackupPlan")
            .build());

        ctx.export("dbsBackupPlanId2", nameRegex.applyValue(getBackupPlansResult -> getBackupPlansResult.plans()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.dbs.get_backup_plans()
pulumi.export("dbsBackupPlanId1", ids.plans[0].id)
name_regex = alicloud.dbs.get_backup_plans(name_regex="^my-BackupPlan")
pulumi.export("dbsBackupPlanId2", name_regex.plans[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.dbs.getBackupPlans({});
export const dbsBackupPlanId1 = ids.then(ids => ids.plans?.[0]?.id);
const nameRegex = alicloud.dbs.getBackupPlans({
    nameRegex: "^my-BackupPlan",
});
export const dbsBackupPlanId2 = nameRegex.then(nameRegex => nameRegex.plans?.[0]?.id);
variables:
  ids:
    fn::invoke:
      Function: alicloud:dbs:getBackupPlans
      Arguments: {}
  nameRegex:
    fn::invoke:
      Function: alicloud:dbs:getBackupPlans
      Arguments:
        nameRegex: ^my-BackupPlan
outputs:
  dbsBackupPlanId1: ${ids.plans[0].id}
  dbsBackupPlanId2: ${nameRegex.plans[0].id}

Using getBackupPlans

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 getBackupPlans(args: GetBackupPlansArgs, opts?: InvokeOptions): Promise<GetBackupPlansResult>
function getBackupPlansOutput(args: GetBackupPlansOutputArgs, opts?: InvokeOptions): Output<GetBackupPlansResult>
def get_backup_plans(backup_plan_name: Optional[str] = None,
                     enable_details: Optional[bool] = None,
                     ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     page_number: Optional[int] = None,
                     page_size: Optional[int] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetBackupPlansResult
def get_backup_plans_output(backup_plan_name: Optional[pulumi.Input[str]] = None,
                     enable_details: Optional[pulumi.Input[bool]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     page_number: Optional[pulumi.Input[int]] = None,
                     page_size: Optional[pulumi.Input[int]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetBackupPlansResult]
func GetBackupPlans(ctx *Context, args *GetBackupPlansArgs, opts ...InvokeOption) (*GetBackupPlansResult, error)
func GetBackupPlansOutput(ctx *Context, args *GetBackupPlansOutputArgs, opts ...InvokeOption) GetBackupPlansResultOutput

> Note: This function is named GetBackupPlans in the Go SDK.

public static class GetBackupPlans 
{
    public static Task<GetBackupPlansResult> InvokeAsync(GetBackupPlansArgs args, InvokeOptions? opts = null)
    public static Output<GetBackupPlansResult> Invoke(GetBackupPlansInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBackupPlansResult> getBackupPlans(GetBackupPlansArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:dbs/getBackupPlans:getBackupPlans
  arguments:
    # arguments dictionary

The following arguments are supported:

BackupPlanName string

The name of the resource.

EnableDetails bool

Default to true. Set it to false can hide the payment_type to output.

Ids List<string>

A list of Backup Plan IDs.

NameRegex string

A regex string to filter results by Backup Plan name.

OutputFile string
PageNumber int
PageSize int
Status string

The status of the resource.

BackupPlanName string

The name of the resource.

EnableDetails bool

Default to true. Set it to false can hide the payment_type to output.

Ids []string

A list of Backup Plan IDs.

NameRegex string

A regex string to filter results by Backup Plan name.

OutputFile string
PageNumber int
PageSize int
Status string

The status of the resource.

backupPlanName String

The name of the resource.

enableDetails Boolean

Default to true. Set it to false can hide the payment_type to output.

ids List<String>

A list of Backup Plan IDs.

nameRegex String

A regex string to filter results by Backup Plan name.

outputFile String
pageNumber Integer
pageSize Integer
status String

The status of the resource.

backupPlanName string

The name of the resource.

enableDetails boolean

Default to true. Set it to false can hide the payment_type to output.

ids string[]

A list of Backup Plan IDs.

nameRegex string

A regex string to filter results by Backup Plan name.

outputFile string
pageNumber number
pageSize number
status string

The status of the resource.

backup_plan_name str

The name of the resource.

enable_details bool

Default to true. Set it to false can hide the payment_type to output.

ids Sequence[str]

A list of Backup Plan IDs.

name_regex str

A regex string to filter results by Backup Plan name.

output_file str
page_number int
page_size int
status str

The status of the resource.

backupPlanName String

The name of the resource.

enableDetails Boolean

Default to true. Set it to false can hide the payment_type to output.

ids List<String>

A list of Backup Plan IDs.

nameRegex String

A regex string to filter results by Backup Plan name.

outputFile String
pageNumber Number
pageSize Number
status String

The status of the resource.

getBackupPlans Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
Plans List<Pulumi.AliCloud.DBS.Outputs.GetBackupPlansPlan>
BackupPlanName string
EnableDetails bool
NameRegex string
OutputFile string
PageNumber int
PageSize int
Status string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Plans []GetBackupPlansPlan
BackupPlanName string
EnableDetails bool
NameRegex string
OutputFile string
PageNumber int
PageSize int
Status string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
plans List<GetBackupPlansPlan>
backupPlanName String
enableDetails Boolean
nameRegex String
outputFile String
pageNumber Integer
pageSize Integer
status String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
plans GetBackupPlansPlan[]
backupPlanName string
enableDetails boolean
nameRegex string
outputFile string
pageNumber number
pageSize number
status string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
plans Sequence[GetBackupPlansPlan]
backup_plan_name str
enable_details bool
name_regex str
output_file str
page_number int
page_size int
status str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
plans List<Property Map>
backupPlanName String
enableDetails Boolean
nameRegex String
outputFile String
pageNumber Number
pageSize Number
status String

Supporting Types

GetBackupPlansPlan

BackupGatewayId string

The ID of the backup gateway.

BackupMethod string

The Backup method.

BackupObjects string

The backup object.

BackupPeriod string

Full backup cycle.

BackupPlanId string

The first ID of the resource.

BackupPlanName string

The name of the resource.

BackupRetentionPeriod int

The retention time of backup data.

BackupStartTime string

The start time of full Backup.

BackupStorageType string

Built-in storage type.

CrossAliyunId string

The UID that is backed up across Alibaba cloud accounts.

CrossRoleName string

The name of the RAM role that is backed up across Alibaba cloud accounts.

DatabaseType string

The database type.

DuplicationArchivePeriod int

The storage time for conversion to archive cold standby is 365 days by default.

DuplicationInfrequentAccessPeriod int

The storage time is converted to low-frequency access. The default time is 180 days.

EnableBackupLog bool

Whether to enable incremental log Backup.

Id string

The ID of the Backup Plan.

InstanceClass string

The Instance class.

OssBucketName string

The OSS Bucket name.

PaymentType string

The payment type of the resource.

ResourceGroupId string

The ID of the resource group.

SourceEndpointDatabaseName string

The name of the database.

SourceEndpointInstanceId string

The ID of the database instance.

SourceEndpointInstanceType string

The location of the database.

SourceEndpointRegion string

The region of the database.

SourceEndpointSid string

The Oracle SID name.

SourceEndpointUserName string

The source endpoint username.

Status string

The status of the resource.

BackupGatewayId string

The ID of the backup gateway.

BackupMethod string

The Backup method.

BackupObjects string

The backup object.

BackupPeriod string

Full backup cycle.

BackupPlanId string

The first ID of the resource.

BackupPlanName string

The name of the resource.

BackupRetentionPeriod int

The retention time of backup data.

BackupStartTime string

The start time of full Backup.

BackupStorageType string

Built-in storage type.

CrossAliyunId string

The UID that is backed up across Alibaba cloud accounts.

CrossRoleName string

The name of the RAM role that is backed up across Alibaba cloud accounts.

DatabaseType string

The database type.

DuplicationArchivePeriod int

The storage time for conversion to archive cold standby is 365 days by default.

DuplicationInfrequentAccessPeriod int

The storage time is converted to low-frequency access. The default time is 180 days.

EnableBackupLog bool

Whether to enable incremental log Backup.

Id string

The ID of the Backup Plan.

InstanceClass string

The Instance class.

OssBucketName string

The OSS Bucket name.

PaymentType string

The payment type of the resource.

ResourceGroupId string

The ID of the resource group.

SourceEndpointDatabaseName string

The name of the database.

SourceEndpointInstanceId string

The ID of the database instance.

SourceEndpointInstanceType string

The location of the database.

SourceEndpointRegion string

The region of the database.

SourceEndpointSid string

The Oracle SID name.

SourceEndpointUserName string

The source endpoint username.

Status string

The status of the resource.

backupGatewayId String

The ID of the backup gateway.

backupMethod String

The Backup method.

backupObjects String

The backup object.

backupPeriod String

Full backup cycle.

backupPlanId String

The first ID of the resource.

backupPlanName String

The name of the resource.

backupRetentionPeriod Integer

The retention time of backup data.

backupStartTime String

The start time of full Backup.

backupStorageType String

Built-in storage type.

crossAliyunId String

The UID that is backed up across Alibaba cloud accounts.

crossRoleName String

The name of the RAM role that is backed up across Alibaba cloud accounts.

databaseType String

The database type.

duplicationArchivePeriod Integer

The storage time for conversion to archive cold standby is 365 days by default.

duplicationInfrequentAccessPeriod Integer

The storage time is converted to low-frequency access. The default time is 180 days.

enableBackupLog Boolean

Whether to enable incremental log Backup.

id String

The ID of the Backup Plan.

instanceClass String

The Instance class.

ossBucketName String

The OSS Bucket name.

paymentType String

The payment type of the resource.

resourceGroupId String

The ID of the resource group.

sourceEndpointDatabaseName String

The name of the database.

sourceEndpointInstanceId String

The ID of the database instance.

sourceEndpointInstanceType String

The location of the database.

sourceEndpointRegion String

The region of the database.

sourceEndpointSid String

The Oracle SID name.

sourceEndpointUserName String

The source endpoint username.

status String

The status of the resource.

backupGatewayId string

The ID of the backup gateway.

backupMethod string

The Backup method.

backupObjects string

The backup object.

backupPeriod string

Full backup cycle.

backupPlanId string

The first ID of the resource.

backupPlanName string

The name of the resource.

backupRetentionPeriod number

The retention time of backup data.

backupStartTime string

The start time of full Backup.

backupStorageType string

Built-in storage type.

crossAliyunId string

The UID that is backed up across Alibaba cloud accounts.

crossRoleName string

The name of the RAM role that is backed up across Alibaba cloud accounts.

databaseType string

The database type.

duplicationArchivePeriod number

The storage time for conversion to archive cold standby is 365 days by default.

duplicationInfrequentAccessPeriod number

The storage time is converted to low-frequency access. The default time is 180 days.

enableBackupLog boolean

Whether to enable incremental log Backup.

id string

The ID of the Backup Plan.

instanceClass string

The Instance class.

ossBucketName string

The OSS Bucket name.

paymentType string

The payment type of the resource.

resourceGroupId string

The ID of the resource group.

sourceEndpointDatabaseName string

The name of the database.

sourceEndpointInstanceId string

The ID of the database instance.

sourceEndpointInstanceType string

The location of the database.

sourceEndpointRegion string

The region of the database.

sourceEndpointSid string

The Oracle SID name.

sourceEndpointUserName string

The source endpoint username.

status string

The status of the resource.

backup_gateway_id str

The ID of the backup gateway.

backup_method str

The Backup method.

backup_objects str

The backup object.

backup_period str

Full backup cycle.

backup_plan_id str

The first ID of the resource.

backup_plan_name str

The name of the resource.

backup_retention_period int

The retention time of backup data.

backup_start_time str

The start time of full Backup.

backup_storage_type str

Built-in storage type.

cross_aliyun_id str

The UID that is backed up across Alibaba cloud accounts.

cross_role_name str

The name of the RAM role that is backed up across Alibaba cloud accounts.

database_type str

The database type.

duplication_archive_period int

The storage time for conversion to archive cold standby is 365 days by default.

duplication_infrequent_access_period int

The storage time is converted to low-frequency access. The default time is 180 days.

enable_backup_log bool

Whether to enable incremental log Backup.

id str

The ID of the Backup Plan.

instance_class str

The Instance class.

oss_bucket_name str

The OSS Bucket name.

payment_type str

The payment type of the resource.

resource_group_id str

The ID of the resource group.

source_endpoint_database_name str

The name of the database.

source_endpoint_instance_id str

The ID of the database instance.

source_endpoint_instance_type str

The location of the database.

source_endpoint_region str

The region of the database.

source_endpoint_sid str

The Oracle SID name.

source_endpoint_user_name str

The source endpoint username.

status str

The status of the resource.

backupGatewayId String

The ID of the backup gateway.

backupMethod String

The Backup method.

backupObjects String

The backup object.

backupPeriod String

Full backup cycle.

backupPlanId String

The first ID of the resource.

backupPlanName String

The name of the resource.

backupRetentionPeriod Number

The retention time of backup data.

backupStartTime String

The start time of full Backup.

backupStorageType String

Built-in storage type.

crossAliyunId String

The UID that is backed up across Alibaba cloud accounts.

crossRoleName String

The name of the RAM role that is backed up across Alibaba cloud accounts.

databaseType String

The database type.

duplicationArchivePeriod Number

The storage time for conversion to archive cold standby is 365 days by default.

duplicationInfrequentAccessPeriod Number

The storage time is converted to low-frequency access. The default time is 180 days.

enableBackupLog Boolean

Whether to enable incremental log Backup.

id String

The ID of the Backup Plan.

instanceClass String

The Instance class.

ossBucketName String

The OSS Bucket name.

paymentType String

The payment type of the resource.

resourceGroupId String

The ID of the resource group.

sourceEndpointDatabaseName String

The name of the database.

sourceEndpointInstanceId String

The ID of the database instance.

sourceEndpointInstanceType String

The location of the database.

sourceEndpointRegion String

The region of the database.

sourceEndpointSid String

The Oracle SID name.

sourceEndpointUserName String

The source endpoint username.

status String

The status of the resource.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.