1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. nas
  5. RecycleBin
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

alicloud.nas.RecycleBin

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi

    Provides a Network Attached Storage (NAS) Recycle Bin resource.

    For information about Network Attached Storage (NAS) Recycle Bin and how to use it, see What is Recycle Bin.

    NOTE: Available in v1.155.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleZones = AliCloud.Nas.GetZones.Invoke(new()
        {
            FileSystemType = "standard",
        });
    
        var exampleFileSystem = new AliCloud.Nas.FileSystem("exampleFileSystem", new()
        {
            ProtocolType = "NFS",
            StorageType = "Performance",
            Description = "terraform-example",
            EncryptType = 1,
            ZoneId = exampleZones.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneId),
        });
    
        var exampleRecycleBin = new AliCloud.Nas.RecycleBin("exampleRecycleBin", new()
        {
            FileSystemId = exampleFileSystem.Id,
            ReservedDays = 3,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleZones, err := nas.GetZones(ctx, &nas.GetZonesArgs{
    			FileSystemType: pulumi.StringRef("standard"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleFileSystem, err := nas.NewFileSystem(ctx, "exampleFileSystem", &nas.FileSystemArgs{
    			ProtocolType: pulumi.String("NFS"),
    			StorageType:  pulumi.String("Performance"),
    			Description:  pulumi.String("terraform-example"),
    			EncryptType:  pulumi.Int(1),
    			ZoneId:       *pulumi.String(exampleZones.Zones[0].ZoneId),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = nas.NewRecycleBin(ctx, "exampleRecycleBin", &nas.RecycleBinArgs{
    			FileSystemId: exampleFileSystem.ID(),
    			ReservedDays: pulumi.Int(3),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.nas.NasFunctions;
    import com.pulumi.alicloud.nas.inputs.GetZonesArgs;
    import com.pulumi.alicloud.nas.FileSystem;
    import com.pulumi.alicloud.nas.FileSystemArgs;
    import com.pulumi.alicloud.nas.RecycleBin;
    import com.pulumi.alicloud.nas.RecycleBinArgs;
    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 exampleZones = NasFunctions.getZones(GetZonesArgs.builder()
                .fileSystemType("standard")
                .build());
    
            var exampleFileSystem = new FileSystem("exampleFileSystem", FileSystemArgs.builder()        
                .protocolType("NFS")
                .storageType("Performance")
                .description("terraform-example")
                .encryptType("1")
                .zoneId(exampleZones.applyValue(getZonesResult -> getZonesResult.zones()[0].zoneId()))
                .build());
    
            var exampleRecycleBin = new RecycleBin("exampleRecycleBin", RecycleBinArgs.builder()        
                .fileSystemId(exampleFileSystem.id())
                .reservedDays(3)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example_zones = alicloud.nas.get_zones(file_system_type="standard")
    example_file_system = alicloud.nas.FileSystem("exampleFileSystem",
        protocol_type="NFS",
        storage_type="Performance",
        description="terraform-example",
        encrypt_type=1,
        zone_id=example_zones.zones[0].zone_id)
    example_recycle_bin = alicloud.nas.RecycleBin("exampleRecycleBin",
        file_system_id=example_file_system.id,
        reserved_days=3)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const exampleZones = alicloud.nas.getZones({
        fileSystemType: "standard",
    });
    const exampleFileSystem = new alicloud.nas.FileSystem("exampleFileSystem", {
        protocolType: "NFS",
        storageType: "Performance",
        description: "terraform-example",
        encryptType: 1,
        zoneId: exampleZones.then(exampleZones => exampleZones.zones?.[0]?.zoneId),
    });
    const exampleRecycleBin = new alicloud.nas.RecycleBin("exampleRecycleBin", {
        fileSystemId: exampleFileSystem.id,
        reservedDays: 3,
    });
    
    resources:
      exampleFileSystem:
        type: alicloud:nas:FileSystem
        properties:
          protocolType: NFS
          storageType: Performance
          description: terraform-example
          encryptType: '1'
          zoneId: ${exampleZones.zones[0].zoneId}
      exampleRecycleBin:
        type: alicloud:nas:RecycleBin
        properties:
          fileSystemId: ${exampleFileSystem.id}
          reservedDays: 3
    variables:
      exampleZones:
        fn::invoke:
          Function: alicloud:nas:getZones
          Arguments:
            fileSystemType: standard
    

    Create RecycleBin Resource

    new RecycleBin(name: string, args: RecycleBinArgs, opts?: CustomResourceOptions);
    @overload
    def RecycleBin(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   file_system_id: Optional[str] = None,
                   reserved_days: Optional[int] = None)
    @overload
    def RecycleBin(resource_name: str,
                   args: RecycleBinArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewRecycleBin(ctx *Context, name string, args RecycleBinArgs, opts ...ResourceOption) (*RecycleBin, error)
    public RecycleBin(string name, RecycleBinArgs args, CustomResourceOptions? opts = null)
    public RecycleBin(String name, RecycleBinArgs args)
    public RecycleBin(String name, RecycleBinArgs args, CustomResourceOptions options)
    
    type: alicloud:nas:RecycleBin
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RecycleBinArgs
    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 RecycleBinArgs
    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 RecycleBinArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RecycleBinArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RecycleBinArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RecycleBin Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The RecycleBin resource accepts the following input properties:

    FileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    ReservedDays int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    FileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    ReservedDays int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    fileSystemId String
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays Integer
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    fileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays number
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    file_system_id str
    The ID of the file system for which you want to enable the recycle bin feature.
    reserved_days int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    fileSystemId String
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays Number
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RecycleBin resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the recycle bin.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the recycle bin.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the recycle bin.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the recycle bin.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the recycle bin.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the recycle bin.

    Look up Existing RecycleBin Resource

    Get an existing RecycleBin 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?: RecycleBinState, opts?: CustomResourceOptions): RecycleBin
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            file_system_id: Optional[str] = None,
            reserved_days: Optional[int] = None,
            status: Optional[str] = None) -> RecycleBin
    func GetRecycleBin(ctx *Context, name string, id IDInput, state *RecycleBinState, opts ...ResourceOption) (*RecycleBin, error)
    public static RecycleBin Get(string name, Input<string> id, RecycleBinState? state, CustomResourceOptions? opts = null)
    public static RecycleBin get(String name, Output<String> id, RecycleBinState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    FileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    ReservedDays int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    Status string
    The status of the recycle bin.
    FileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    ReservedDays int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    Status string
    The status of the recycle bin.
    fileSystemId String
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays Integer
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    status String
    The status of the recycle bin.
    fileSystemId string
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays number
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    status string
    The status of the recycle bin.
    file_system_id str
    The ID of the file system for which you want to enable the recycle bin feature.
    reserved_days int
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    status str
    The status of the recycle bin.
    fileSystemId String
    The ID of the file system for which you want to enable the recycle bin feature.
    reservedDays Number
    The period for which the files in the recycle bin are retained. Unit: days. Valid values: 1 to 180.
    status String
    The status of the recycle bin.

    Import

    Network Attached Storage (NAS) Recycle Bin can be imported using the id, e.g.

     $ pulumi import alicloud:nas/recycleBin:RecycleBin example <file_system_id>
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.49.0 published on Sunday, Feb 4, 2024 by Pulumi