ServerBackupPlanArgs

data class ServerBackupPlanArgs(val crossAccountRoleName: Output<String>? = null, val crossAccountType: Output<String>? = null, val crossAccountUserId: Output<Int>? = null, val details: Output<List<ServerBackupPlanDetailArgs>>? = null, val disabled: Output<Boolean>? = null, val ecsServerBackupPlanName: Output<String>? = null, val instanceId: Output<String>? = null, val retention: Output<Int>? = null, val schedule: Output<String>? = null) : ConvertibleToJava<ServerBackupPlanArgs>

Provides a Hybrid Backup Recovery (HBR) Server Backup Plan resource. For information about Hybrid Backup Recovery (HBR) Server Backup Plan and how to use it, see What is Server Backup Plan.

NOTE: Available in v1.142.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.hbr.ServerBackupPlan;
import com.pulumi.alicloud.hbr.ServerBackupPlanArgs;
import com.pulumi.alicloud.hbr.inputs.ServerBackupPlanDetailArgs;
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 exampleZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("Instance")
.build());
final var exampleInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
.availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.cpuCoreCount(1)
.memorySize(2)
.build());
final var exampleImages = EcsFunctions.getImages(GetImagesArgs.builder()
.nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
.owners("system")
.build());
var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.vpcName("terraform-example")
.cidrBlock("172.17.3.0/24")
.build());
var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
.vswitchName("terraform-example")
.cidrBlock("172.17.3.0/24")
.vpcId(exampleNetwork.id())
.zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
.vpcId(exampleNetwork.id())
.build());
var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
.imageId(exampleImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
.instanceType(exampleInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
.availabilityZone(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.securityGroups(exampleSecurityGroup.id())
.instanceName("terraform-example")
.internetChargeType("PayByBandwidth")
.vswitchId(exampleSwitch.id())
.build());
var exampleServerBackupPlan = new ServerBackupPlan("exampleServerBackupPlan", ServerBackupPlanArgs.builder()
.ecsServerBackupPlanName("terraform-example")
.instanceId(exampleInstance.id())
.schedule("I|1602673264|PT2H")
.retention(1)
.details(ServerBackupPlanDetailArgs.builder()
.appConsistent(true)
.snapshotGroup(true)
.build())
.disabled(false)
.build());
}
}

Import

Hybrid Backup Recovery (HBR) Server Backup Plan can be imported using the id, e.g.

$ pulumi import alicloud:hbr/serverBackupPlan:ServerBackupPlan example <id>

Constructors

Link copied to clipboard
fun ServerBackupPlanArgs(crossAccountRoleName: Output<String>? = null, crossAccountType: Output<String>? = null, crossAccountUserId: Output<Int>? = null, details: Output<List<ServerBackupPlanDetailArgs>>? = null, disabled: Output<Boolean>? = null, ecsServerBackupPlanName: Output<String>? = null, instanceId: Output<String>? = null, retention: Output<Int>? = null, schedule: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ServerBackupPlanArgs

Properties

Link copied to clipboard
val crossAccountRoleName: Output<String>? = null

The role name created in the original account RAM backup by the cross account managed by the current account.

Link copied to clipboard
val crossAccountType: Output<String>? = null

The type of the cross account backup. Valid values: SELF_ACCOUNT, CROSS_ACCOUNT.

Link copied to clipboard
val crossAccountUserId: Output<Int>? = null

The original account ID of the cross account backup managed by the current account.

Link copied to clipboard

ECS server backup plan details.

Link copied to clipboard
val disabled: Output<Boolean>? = null

Whether to disable the backup task. Valid values: true, false.

Link copied to clipboard
val ecsServerBackupPlanName: Output<String>? = null

The name of the backup plan. 1~64 characters, the backup plan name of each data source type in a single warehouse required to be unique.

Link copied to clipboard
val instanceId: Output<String>? = null

The ID of ECS instance.

Link copied to clipboard
val retention: Output<Int>? = null

Backup retention days, the minimum is 1.

Link copied to clipboard
val schedule: Output<String>? = null

Backup strategy. Optional format: I|{startTime}|{interval}