Ecs Backup Plan
Provides a HBR Ecs Backup Plan resource. For information about HBR Ecs Backup Plan and how to use it, see What is Ecs Backup Plan.
NOTE: Available in v1.132.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.hbr.Vault;
import com.pulumi.alicloud.hbr.VaultArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
import com.pulumi.alicloud.hbr.EcsBackupPlan;
import com.pulumi.alicloud.hbr.EcsBackupPlanArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("valut-name");
var defaultVault = new Vault("defaultVault", VaultArgs.builder()
.vaultName(name)
.build());
final var defaultInstances = EcsFunctions.getInstances(GetInstancesArgs.builder()
.nameRegex("no-deleteing-hbr-ecs-backup-plan")
.status("Running")
.build());
var example = new EcsBackupPlan("example", EcsBackupPlanArgs.builder()
.ecsBackupPlanName("example_value")
.instanceId(defaultInstances.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()))
.vaultId(defaultVault.id())
.retention("1")
.schedule("I|1602673264|PT2H")
.backupType("COMPLETE")
.speedLimit("0:24:5120")
.paths(
"/home",
"/var")
.exclude("""
["/home/exclude"]
""")
.include("""
["/home/include"]
""")
.build());
}
}
Notice
About Backup path rules:
If there is no wildcard
*
, you can enter 8 items of path.When using wildcard
*
, only one item of path can be input, and wildcards like/*/*
are supported.Each item of path only supports absolute paths, for example starting with
/
,\
,C:\
,D:\
. About Restrictions:When using
VSS
: multiple paths, UNC paths, wildcards, and excluded files not supported.When using
UNC
: VSS not supported, wildcards not supported, and files to be excluded are not supported. About include/exclude path rules:Supports up to 8 paths, including paths using wildcards
*
.If the path does not contain
/
, then*
matches multiple path names or file names, for example*abc*
will match/abc/
,/d/eabcd/
,/a/abc
;*.txt
will match all files with an extension.txt
.If the path contains
/
, each*
only matches a single-level path or file name. For example,/a/*/*/
share will match/a/b/c/share
, but not/a/d/share
.If the path ends with
/
, it means the folder matches. For example,*tmp/
will match/a/b/aaatmp/
,/tmp/
and so on.The path separator takes Linux system
/
as an example, if it is Windows system, please replace it with\
.
Import
HBR Ecs Backup Plan can be imported using the id, e.g.
$ pulumi import alicloud:hbr/ecsBackupPlan:EcsBackupPlan example <id>
////