@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
98 lines • 4.19 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutoSnapshotPolicyApply = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage nas auto snapshot policy apply
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.nas.getZones({});
* const fooFileSystem = new volcengine.nas.FileSystem("fooFileSystem", {
* fileSystemName: "acc-test-fs",
* description: "acc-test",
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* capacity: 103,
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooAutoSnapshotPolicy = new volcengine.nas.AutoSnapshotPolicy("fooAutoSnapshotPolicy", {
* autoSnapshotPolicyName: "acc-test-auto_snapshot_policy",
* repeatWeekdays: "1,3,5,7",
* timePoints: "0,7,17",
* retentionDays: 20,
* });
* const fooAutoSnapshotPolicyApply = new volcengine.nas.AutoSnapshotPolicyApply("fooAutoSnapshotPolicyApply", {
* fileSystemId: fooFileSystem.id,
* autoSnapshotPolicyId: fooAutoSnapshotPolicy.id,
* });
* ```
*
* ## Import
*
* NasAutoSnapshotPolicyApply can be imported using the auto_snapshot_policy_id:file_system_id, e.g.
*
* ```sh
* $ pulumi import volcengine:nas/autoSnapshotPolicyApply:AutoSnapshotPolicyApply default resource_id
* ```
*/
class AutoSnapshotPolicyApply extends pulumi.CustomResource {
/**
* Get an existing AutoSnapshotPolicyApply 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 Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new AutoSnapshotPolicyApply(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AutoSnapshotPolicyApply. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AutoSnapshotPolicyApply.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoSnapshotPolicyId"] = state ? state.autoSnapshotPolicyId : undefined;
resourceInputs["fileSystemId"] = state ? state.fileSystemId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.autoSnapshotPolicyId === undefined) && !opts.urn) {
throw new Error("Missing required property 'autoSnapshotPolicyId'");
}
if ((!args || args.fileSystemId === undefined) && !opts.urn) {
throw new Error("Missing required property 'fileSystemId'");
}
resourceInputs["autoSnapshotPolicyId"] = args ? args.autoSnapshotPolicyId : undefined;
resourceInputs["fileSystemId"] = args ? args.fileSystemId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AutoSnapshotPolicyApply.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutoSnapshotPolicyApply = AutoSnapshotPolicyApply;
/** @internal */
AutoSnapshotPolicyApply.__pulumiType = 'volcengine:nas/autoSnapshotPolicyApply:AutoSnapshotPolicyApply';
//# sourceMappingURL=autoSnapshotPolicyApply.js.map