1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nas
  5. RecycleBin
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

alicloud.nas.RecycleBin

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.69.0 published on Monday, Dec 9, 2024 by Pulumi

    Provides a File Storage (NAS) Recycle Bin resource.

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

    NOTE: Available in v1.155.0+.

    Example Usage

    Basic Usage

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

    Create RecycleBin Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RecycleBin(name: string, args: RecycleBinArgs, opts?: CustomResourceOptions);
    @overload
    def RecycleBin(resource_name: str,
                   args: RecycleBinArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def RecycleBin(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   file_system_id: Optional[str] = None,
                   reserved_days: Optional[int] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var recycleBinResource = new AliCloud.Nas.RecycleBin("recycleBinResource", new()
    {
        FileSystemId = "string",
        ReservedDays = 0,
    });
    
    example, err := nas.NewRecycleBin(ctx, "recycleBinResource", &nas.RecycleBinArgs{
    	FileSystemId: pulumi.String("string"),
    	ReservedDays: pulumi.Int(0),
    })
    
    var recycleBinResource = new RecycleBin("recycleBinResource", RecycleBinArgs.builder()
        .fileSystemId("string")
        .reservedDays(0)
        .build());
    
    recycle_bin_resource = alicloud.nas.RecycleBin("recycleBinResource",
        file_system_id="string",
        reserved_days=0)
    
    const recycleBinResource = new alicloud.nas.RecycleBin("recycleBinResource", {
        fileSystemId: "string",
        reservedDays: 0,
    });
    
    type: alicloud:nas:RecycleBin
    properties:
        fileSystemId: string
        reservedDays: 0
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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

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

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

    To learn more about importing existing cloud resources, see Importing resources.

    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.69.0 published on Monday, Dec 9, 2024 by Pulumi