volcengine.nas.AutoSnapshotPolicyApply
Explore with Pulumi AI
Provides a resource to manage nas auto snapshot policy apply
Example Usage
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 pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.nas.get_zones()
foo_file_system = volcengine.nas.FileSystem("fooFileSystem",
file_system_name="acc-test-fs",
description="acc-test",
zone_id=foo_zones.zones[0].id,
capacity=103,
project_name="default",
tags=[volcengine.nas.FileSystemTagArgs(
key="k1",
value="v1",
)])
foo_auto_snapshot_policy = volcengine.nas.AutoSnapshotPolicy("fooAutoSnapshotPolicy",
auto_snapshot_policy_name="acc-test-auto_snapshot_policy",
repeat_weekdays="1,3,5,7",
time_points="0,7,17",
retention_days=20)
foo_auto_snapshot_policy_apply = volcengine.nas.AutoSnapshotPolicyApply("fooAutoSnapshotPolicyApply",
file_system_id=foo_file_system.id,
auto_snapshot_policy_id=foo_auto_snapshot_policy.id)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/nas"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := nas.GetZones(ctx, nil, nil)
if err != nil {
return err
}
fooFileSystem, err := nas.NewFileSystem(ctx, "fooFileSystem", &nas.FileSystemArgs{
FileSystemName: pulumi.String("acc-test-fs"),
Description: pulumi.String("acc-test"),
ZoneId: pulumi.String(fooZones.Zones[0].Id),
Capacity: pulumi.Int(103),
ProjectName: pulumi.String("default"),
Tags: nas.FileSystemTagArray{
&nas.FileSystemTagArgs{
Key: pulumi.String("k1"),
Value: pulumi.String("v1"),
},
},
})
if err != nil {
return err
}
fooAutoSnapshotPolicy, err := nas.NewAutoSnapshotPolicy(ctx, "fooAutoSnapshotPolicy", &nas.AutoSnapshotPolicyArgs{
AutoSnapshotPolicyName: pulumi.String("acc-test-auto_snapshot_policy"),
RepeatWeekdays: pulumi.String("1,3,5,7"),
TimePoints: pulumi.String("0,7,17"),
RetentionDays: pulumi.Int(20),
})
if err != nil {
return err
}
_, err = nas.NewAutoSnapshotPolicyApply(ctx, "fooAutoSnapshotPolicyApply", &nas.AutoSnapshotPolicyApplyArgs{
FileSystemId: fooFileSystem.ID(),
AutoSnapshotPolicyId: fooAutoSnapshotPolicy.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Nas.GetZones.Invoke();
var fooFileSystem = new Volcengine.Nas.FileSystem("fooFileSystem", new()
{
FileSystemName = "acc-test-fs",
Description = "acc-test",
ZoneId = fooZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
Capacity = 103,
ProjectName = "default",
Tags = new[]
{
new Volcengine.Nas.Inputs.FileSystemTagArgs
{
Key = "k1",
Value = "v1",
},
},
});
var fooAutoSnapshotPolicy = new Volcengine.Nas.AutoSnapshotPolicy("fooAutoSnapshotPolicy", new()
{
AutoSnapshotPolicyName = "acc-test-auto_snapshot_policy",
RepeatWeekdays = "1,3,5,7",
TimePoints = "0,7,17",
RetentionDays = 20,
});
var fooAutoSnapshotPolicyApply = new Volcengine.Nas.AutoSnapshotPolicyApply("fooAutoSnapshotPolicyApply", new()
{
FileSystemId = fooFileSystem.Id,
AutoSnapshotPolicyId = fooAutoSnapshotPolicy.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.nas.NasFunctions;
import com.pulumi.volcengine.nas.inputs.GetZonesArgs;
import com.pulumi.volcengine.nas.FileSystem;
import com.pulumi.volcengine.nas.FileSystemArgs;
import com.pulumi.volcengine.nas.inputs.FileSystemTagArgs;
import com.pulumi.volcengine.nas.AutoSnapshotPolicy;
import com.pulumi.volcengine.nas.AutoSnapshotPolicyArgs;
import com.pulumi.volcengine.nas.AutoSnapshotPolicyApply;
import com.pulumi.volcengine.nas.AutoSnapshotPolicyApplyArgs;
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 fooZones = NasFunctions.getZones();
var fooFileSystem = new FileSystem("fooFileSystem", FileSystemArgs.builder()
.fileSystemName("acc-test-fs")
.description("acc-test")
.zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.capacity(103)
.projectName("default")
.tags(FileSystemTagArgs.builder()
.key("k1")
.value("v1")
.build())
.build());
var fooAutoSnapshotPolicy = new AutoSnapshotPolicy("fooAutoSnapshotPolicy", AutoSnapshotPolicyArgs.builder()
.autoSnapshotPolicyName("acc-test-auto_snapshot_policy")
.repeatWeekdays("1,3,5,7")
.timePoints("0,7,17")
.retentionDays(20)
.build());
var fooAutoSnapshotPolicyApply = new AutoSnapshotPolicyApply("fooAutoSnapshotPolicyApply", AutoSnapshotPolicyApplyArgs.builder()
.fileSystemId(fooFileSystem.id())
.autoSnapshotPolicyId(fooAutoSnapshotPolicy.id())
.build());
}
}
resources:
fooFileSystem:
type: volcengine:nas:FileSystem
properties:
fileSystemName: acc-test-fs
description: acc-test
zoneId: ${fooZones.zones[0].id}
capacity: 103
projectName: default
tags:
- key: k1
value: v1
fooAutoSnapshotPolicy:
type: volcengine:nas:AutoSnapshotPolicy
properties:
autoSnapshotPolicyName: acc-test-auto_snapshot_policy
repeatWeekdays: 1,3,5,7
timePoints: 0,7,17
retentionDays: 20
fooAutoSnapshotPolicyApply:
type: volcengine:nas:AutoSnapshotPolicyApply
properties:
fileSystemId: ${fooFileSystem.id}
autoSnapshotPolicyId: ${fooAutoSnapshotPolicy.id}
variables:
fooZones:
fn::invoke:
Function: volcengine:nas:getZones
Arguments: {}
Create AutoSnapshotPolicyApply Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AutoSnapshotPolicyApply(name: string, args: AutoSnapshotPolicyApplyArgs, opts?: CustomResourceOptions);
@overload
def AutoSnapshotPolicyApply(resource_name: str,
args: AutoSnapshotPolicyApplyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AutoSnapshotPolicyApply(resource_name: str,
opts: Optional[ResourceOptions] = None,
auto_snapshot_policy_id: Optional[str] = None,
file_system_id: Optional[str] = None)
func NewAutoSnapshotPolicyApply(ctx *Context, name string, args AutoSnapshotPolicyApplyArgs, opts ...ResourceOption) (*AutoSnapshotPolicyApply, error)
public AutoSnapshotPolicyApply(string name, AutoSnapshotPolicyApplyArgs args, CustomResourceOptions? opts = null)
public AutoSnapshotPolicyApply(String name, AutoSnapshotPolicyApplyArgs args)
public AutoSnapshotPolicyApply(String name, AutoSnapshotPolicyApplyArgs args, CustomResourceOptions options)
type: volcengine:nas:AutoSnapshotPolicyApply
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AutoSnapshotPolicyApplyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args AutoSnapshotPolicyApplyArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args AutoSnapshotPolicyApplyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AutoSnapshotPolicyApplyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AutoSnapshotPolicyApplyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var autoSnapshotPolicyApplyResource = new Volcengine.Nas.AutoSnapshotPolicyApply("autoSnapshotPolicyApplyResource", new()
{
AutoSnapshotPolicyId = "string",
FileSystemId = "string",
});
example, err := nas.NewAutoSnapshotPolicyApply(ctx, "autoSnapshotPolicyApplyResource", &nas.AutoSnapshotPolicyApplyArgs{
AutoSnapshotPolicyId: pulumi.String("string"),
FileSystemId: pulumi.String("string"),
})
var autoSnapshotPolicyApplyResource = new AutoSnapshotPolicyApply("autoSnapshotPolicyApplyResource", AutoSnapshotPolicyApplyArgs.builder()
.autoSnapshotPolicyId("string")
.fileSystemId("string")
.build());
auto_snapshot_policy_apply_resource = volcengine.nas.AutoSnapshotPolicyApply("autoSnapshotPolicyApplyResource",
auto_snapshot_policy_id="string",
file_system_id="string")
const autoSnapshotPolicyApplyResource = new volcengine.nas.AutoSnapshotPolicyApply("autoSnapshotPolicyApplyResource", {
autoSnapshotPolicyId: "string",
fileSystemId: "string",
});
type: volcengine:nas:AutoSnapshotPolicyApply
properties:
autoSnapshotPolicyId: string
fileSystemId: string
AutoSnapshotPolicyApply Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AutoSnapshotPolicyApply resource accepts the following input properties:
- Auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- File
System stringId - The id of file system.
- Auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- File
System stringId - The id of file system.
- auto
Snapshot StringPolicy Id - The id of auto snapshot policy.
- file
System StringId - The id of file system.
- auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- file
System stringId - The id of file system.
- auto_
snapshot_ strpolicy_ id - The id of auto snapshot policy.
- file_
system_ strid - The id of file system.
- auto
Snapshot StringPolicy Id - The id of auto snapshot policy.
- file
System StringId - The id of file system.
Outputs
All input properties are implicitly available as output properties. Additionally, the AutoSnapshotPolicyApply resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing AutoSnapshotPolicyApply Resource
Get an existing AutoSnapshotPolicyApply resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: AutoSnapshotPolicyApplyState, opts?: CustomResourceOptions): AutoSnapshotPolicyApply
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_snapshot_policy_id: Optional[str] = None,
file_system_id: Optional[str] = None) -> AutoSnapshotPolicyApply
func GetAutoSnapshotPolicyApply(ctx *Context, name string, id IDInput, state *AutoSnapshotPolicyApplyState, opts ...ResourceOption) (*AutoSnapshotPolicyApply, error)
public static AutoSnapshotPolicyApply Get(string name, Input<string> id, AutoSnapshotPolicyApplyState? state, CustomResourceOptions? opts = null)
public static AutoSnapshotPolicyApply get(String name, Output<String> id, AutoSnapshotPolicyApplyState state, CustomResourceOptions options)
resources: _: type: volcengine:nas:AutoSnapshotPolicyApply get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- File
System stringId - The id of file system.
- Auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- File
System stringId - The id of file system.
- auto
Snapshot StringPolicy Id - The id of auto snapshot policy.
- file
System StringId - The id of file system.
- auto
Snapshot stringPolicy Id - The id of auto snapshot policy.
- file
System stringId - The id of file system.
- auto_
snapshot_ strpolicy_ id - The id of auto snapshot policy.
- file_
system_ strid - The id of file system.
- auto
Snapshot StringPolicy Id - The id of auto snapshot policy.
- file
System StringId - The id of file system.
Import
NasAutoSnapshotPolicyApply can be imported using the auto_snapshot_policy_id:file_system_id, e.g.
$ pulumi import volcengine:nas/autoSnapshotPolicyApply:AutoSnapshotPolicyApply default resource_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.