com.pulumi.alicloud.hbr.EcsBackupPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.hbr;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.hbr.EcsBackupPlanArgs;
import com.pulumi.alicloud.hbr.inputs.EcsBackupPlanState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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](https://www.alibabacloud.com/help/doc-detail/186574.htm).
*
* > **NOTE:** Available in v1.132.0+.
*
* ## Example Usage
*
* Basic Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.random.integer;
* import com.pulumi.random.IntegerArgs;
* import com.pulumi.alicloud.hbr.Vault;
* import com.pulumi.alicloud.hbr.VaultArgs;
* 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 example = AlicloudFunctions.getZones(GetZonesArgs.builder()
* .availableResourceCreation("Instance")
* .build());
*
* final var exampleGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
* .availabilityZone(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
* .cpuCoreCount(1)
* .memorySize(2)
* .build());
*
* final var exampleGetImages = 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(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
* .build());
*
* var exampleSecurityGroup = new SecurityGroup("exampleSecurityGroup", SecurityGroupArgs.builder()
* .name("terraform-example")
* .vpcId(exampleNetwork.id())
* .build());
*
* var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
* .imageId(exampleGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
* .instanceType(exampleGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
* .availabilityZone(example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
* .securityGroups(exampleSecurityGroup.id())
* .instanceName("terraform-example")
* .internetChargeType("PayByBandwidth")
* .vswitchId(exampleSwitch.id())
* .build());
*
* var default_ = new Integer("default", IntegerArgs.builder()
* .min(10000)
* .max(99999)
* .build());
*
* var exampleVault = new Vault("exampleVault", VaultArgs.builder()
* .vaultName(String.format("terraform-example-%s", default_.result()))
* .build());
*
* var exampleEcsBackupPlan = new EcsBackupPlan("exampleEcsBackupPlan", EcsBackupPlanArgs.builder()
* .ecsBackupPlanName("terraform-example")
* .instanceId(exampleInstance.id())
* .vaultId(exampleVault.id())
* .retention("1")
* .schedule("I|1602673264|PT2H")
* .backupType("COMPLETE")
* .speedLimit("0:24:5120")
* .paths(
* "/home",
* "/var")
* .exclude("""
* ["/home/exclude"]
* """)
* .include("""
* ["/home/include"]
* """)
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Notice
*
* **About Backup path rules:**
* 1. If there is no wildcard `*`, you can enter 8 items of path.
* 2. When using wildcard `*`, only one item of path can be input, and wildcards like `/*{@literal /}*` are supported.
* 3. Each item of path only supports absolute paths, for example starting with `/`, `\`, `C:\`, `D:\`.
*
* **About Restrictions:**
* 1. When using `VSS`: multiple paths, UNC paths, wildcards, and excluded files not supported.
* 2. When using `UNC`: VSS not supported, wildcards not supported, and files to be excluded are not supported.
*
* **About include/exclude path rules:**
* 1. Supports up to 8 paths, including paths using wildcards `*`.
* 2. 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`.
* 3. If the path contains `/`, each `*` only matches a single-level path or file name. For example, `/a/*{@literal /}*{@literal /}` share will match `/a/b/c/share`, but not `/a/d/share`.
* 4. If the path ends with `/`, it means the folder matches. For example, `*tmp/` will match `/a/b/aaatmp/`, `/tmp/` and so on.
* 5. 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.
*
* ```sh
* $ pulumi import alicloud:hbr/ecsBackupPlan:EcsBackupPlan example <id>
* ```
*
*/
@ResourceType(type="alicloud:hbr/ecsBackupPlan:EcsBackupPlan")
public class EcsBackupPlan extends com.pulumi.resources.CustomResource {
/**
* Backup type. Valid values: `COMPLETE`.
*
*/
@Export(name="backupType", refs={String.class}, tree="[0]")
private Output backupType;
/**
* @return Backup type. Valid values: `COMPLETE`.
*
*/
public Output backupType() {
return this.backupType;
}
/**
* The role name created in the original account RAM backup by the cross account managed by the current account.
*
*/
@Export(name="crossAccountRoleName", refs={String.class}, tree="[0]")
private Output crossAccountRoleName;
/**
* @return The role name created in the original account RAM backup by the cross account managed by the current account.
*
*/
public Output> crossAccountRoleName() {
return Codegen.optional(this.crossAccountRoleName);
}
/**
* The type of the cross account backup. Valid values: `SELF_ACCOUNT`, `CROSS_ACCOUNT`.
*
*/
@Export(name="crossAccountType", refs={String.class}, tree="[0]")
private Output crossAccountType;
/**
* @return The type of the cross account backup. Valid values: `SELF_ACCOUNT`, `CROSS_ACCOUNT`.
*
*/
public Output crossAccountType() {
return this.crossAccountType;
}
/**
* The original account ID of the cross account backup managed by the current account.
*
*/
@Export(name="crossAccountUserId", refs={Integer.class}, tree="[0]")
private Output crossAccountUserId;
/**
* @return The original account ID of the cross account backup managed by the current account.
*
*/
public Output> crossAccountUserId() {
return Codegen.optional(this.crossAccountUserId);
}
/**
* The detail of the backup plan.
*
*/
@Export(name="detail", refs={String.class}, tree="[0]")
private Output detail;
/**
* @return The detail of the backup plan.
*
*/
public Output> detail() {
return Codegen.optional(this.detail);
}
/**
* Whether to disable the backup task. Valid values: `true`, `false`.
*
*/
@Export(name="disabled", refs={Boolean.class}, tree="[0]")
private Output disabled;
/**
* @return Whether to disable the backup task. Valid values: `true`, `false`.
*
*/
public Output disabled() {
return this.disabled;
}
/**
* 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.
*
*/
@Export(name="ecsBackupPlanName", refs={String.class}, tree="[0]")
private Output ecsBackupPlanName;
/**
* @return 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.
*
*/
public Output ecsBackupPlanName() {
return this.ecsBackupPlanName;
}
/**
* Exclude path. String of Json list, up to 255 characters. e.g. `"[\"/home/work\"]"`
*
*/
@Export(name="exclude", refs={String.class}, tree="[0]")
private Output exclude;
/**
* @return Exclude path. String of Json list, up to 255 characters. e.g. `"[\"/home/work\"]"`
*
*/
public Output> exclude() {
return Codegen.optional(this.exclude);
}
/**
* Include path. String of Json list, up to 255 characters. e.g. `"[\"/var\"]"`
*
*/
@Export(name="include", refs={String.class}, tree="[0]")
private Output include;
/**
* @return Include path. String of Json list, up to 255 characters. e.g. `"[\"/var\"]"`
*
*/
public Output> include() {
return Codegen.optional(this.include);
}
/**
* The ID of ECS instance. The ecs backup client must have been installed on the host.
*
*/
@Export(name="instanceId", refs={String.class}, tree="[0]")
private Output instanceId;
/**
* @return The ID of ECS instance. The ecs backup client must have been installed on the host.
*
*/
public Output instanceId() {
return this.instanceId;
}
/**
* Windows operating system with application consistency using VSS, e.g: `{\"UseVSS\":false}`.
*
*/
@Export(name="options", refs={String.class}, tree="[0]")
private Output options;
/**
* @return Windows operating system with application consistency using VSS, e.g: `{\"UseVSS\":false}`.
*
*/
public Output> options() {
return Codegen.optional(this.options);
}
/**
* List of backup path. e.g. `["/home", "/var"]`. **Note** If `path` is empty, it means that all directories will be backed up.
*
*/
@Export(name="paths", refs={List.class,String.class}, tree="[0,1]")
private Output> paths;
/**
* @return List of backup path. e.g. `["/home", "/var"]`. **Note** If `path` is empty, it means that all directories will be backed up.
*
*/
public Output>> paths() {
return Codegen.optional(this.paths);
}
/**
* Backup retention days, the minimum is 1.
*
*/
@Export(name="retention", refs={String.class}, tree="[0]")
private Output retention;
/**
* @return Backup retention days, the minimum is 1.
*
*/
public Output retention() {
return this.retention;
}
/**
* Backup strategy. Optional format: `I|{startTime}|{interval}`. It means to execute a backup task every `{interval}` starting from `{startTime}`. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.
* * `startTime` Backup start time, UNIX time seconds.
*
*/
@Export(name="schedule", refs={String.class}, tree="[0]")
private Output schedule;
/**
* @return Backup strategy. Optional format: `I|{startTime}|{interval}`. It means to execute a backup task every `{interval}` starting from `{startTime}`. The backup task for the elapsed time will not be compensated. If the last backup task has not completed yet, the next backup task will not be triggered.
* * `startTime` Backup start time, UNIX time seconds.
*
*/
public Output schedule() {
return this.schedule;
}
/**
* Flow control. The format is: `{start}|{end}|{bandwidth}`. Use `|` to separate multiple flow control configurations, multiple flow control configurations not allowed to have overlapping times.
*
*/
@Export(name="speedLimit", refs={String.class}, tree="[0]")
private Output speedLimit;
/**
* @return Flow control. The format is: `{start}|{end}|{bandwidth}`. Use `|` to separate multiple flow control configurations, multiple flow control configurations not allowed to have overlapping times.
*
*/
public Output> speedLimit() {
return Codegen.optional(this.speedLimit);
}
/**
* Attribute update_paths has been deprecated in v1.139.0+, and you do not need to set it anymore.
*
* @deprecated
* Attribute update_paths has been deprecated in v1.139.0+ and you do not need to set it anymore.
*
*/
@Deprecated /* Attribute update_paths has been deprecated in v1.139.0+ and you do not need to set it anymore. */
@Export(name="updatePaths", refs={Boolean.class}, tree="[0]")
private Output updatePaths;
/**
* @return Attribute update_paths has been deprecated in v1.139.0+, and you do not need to set it anymore.
*
*/
public Output> updatePaths() {
return Codegen.optional(this.updatePaths);
}
/**
* The ID of Backup vault.
*
*/
@Export(name="vaultId", refs={String.class}, tree="[0]")
private Output vaultId;
/**
* @return The ID of Backup vault.
*
*/
public Output vaultId() {
return this.vaultId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public EcsBackupPlan(String name) {
this(name, EcsBackupPlanArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public EcsBackupPlan(String name, EcsBackupPlanArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public EcsBackupPlan(String name, EcsBackupPlanArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:hbr/ecsBackupPlan:EcsBackupPlan", name, args == null ? EcsBackupPlanArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
}
private EcsBackupPlan(String name, Output id, @Nullable EcsBackupPlanState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:hbr/ecsBackupPlan:EcsBackupPlan", name, state, makeResourceOptions(options, id));
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static EcsBackupPlan get(String name, Output id, @Nullable EcsBackupPlanState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new EcsBackupPlan(name, id, state, options);
}
}