@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
109 lines • 4.44 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.AutoSnapshotPolicyAttachment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage ebs auto snapshot policy attachment
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@pulumi/volcengine";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooZones = volcengine.ecs.getZones({});
* const fooVolume = new volcengine.ebs.Volume("fooVolume", {
* volumeName: "acc-test-volume",
* volumeType: "ESSD_PL0",
* description: "acc-test",
* kind: "data",
* size: 500,
* zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
* volumeChargeType: "PostPaid",
* projectName: "default",
* });
* const fooAutoSnapshotPolicy = new volcengine.ebs.AutoSnapshotPolicy("fooAutoSnapshotPolicy", {
* autoSnapshotPolicyName: "acc-test-auto-snapshot-policy",
* timePoints: [
* "1",
* "5",
* "9",
* ],
* retentionDays: -1,
* repeatWeekdays: [
* "2",
* "6",
* ],
* projectName: "default",
* tags: [{
* key: "k1",
* value: "v1",
* }],
* });
* const fooAutoSnapshotPolicyAttachment = new volcengine.ebs.AutoSnapshotPolicyAttachment("fooAutoSnapshotPolicyAttachment", {
* autoSnapshotPolicyId: fooAutoSnapshotPolicy.id,
* volumeId: fooVolume.id,
* });
* ```
*
* ## Import
*
* EbsAutoSnapshotPolicyAttachment can be imported using the auto_snapshot_policy_id:volume_id, e.g.
*
* ```sh
* $ pulumi import volcengine:ebs/autoSnapshotPolicyAttachment:AutoSnapshotPolicyAttachment default resource_id
* ```
*/
class AutoSnapshotPolicyAttachment extends pulumi.CustomResource {
/**
* Get an existing AutoSnapshotPolicyAttachment 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 AutoSnapshotPolicyAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AutoSnapshotPolicyAttachment. 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'] === AutoSnapshotPolicyAttachment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["autoSnapshotPolicyId"] = state ? state.autoSnapshotPolicyId : undefined;
resourceInputs["volumeId"] = state ? state.volumeId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.autoSnapshotPolicyId === undefined) && !opts.urn) {
throw new Error("Missing required property 'autoSnapshotPolicyId'");
}
if ((!args || args.volumeId === undefined) && !opts.urn) {
throw new Error("Missing required property 'volumeId'");
}
resourceInputs["autoSnapshotPolicyId"] = args ? args.autoSnapshotPolicyId : undefined;
resourceInputs["volumeId"] = args ? args.volumeId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AutoSnapshotPolicyAttachment.__pulumiType, name, resourceInputs, opts);
}
}
exports.AutoSnapshotPolicyAttachment = AutoSnapshotPolicyAttachment;
/** @internal */
AutoSnapshotPolicyAttachment.__pulumiType = 'volcengine:ebs/autoSnapshotPolicyAttachment:AutoSnapshotPolicyAttachment';
//# sourceMappingURL=autoSnapshotPolicyAttachment.js.map