<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<filename>sdk/dotnet/Nas/AccessRule.cs// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Nas
{
    /// <summary>
    /// Provides a Nas Access Rule resource.
    /// 
    /// When NAS is activated, the Default VPC Permission Group is automatically generated. It allows all IP addresses in a VPC to access the mount point with full permissions. Full permissions include Read/Write permission with no restriction on root users.
    /// 
    /// &gt; **NOTE:** Available in v1.34.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var fooAccessGroup = new AliCloud.Nas.AccessGroup("fooAccessGroup", new()
    ///     {
    ///         AccessGroupName = "tf-NasConfigName",
    ///         AccessGroupType = "Vpc",
    ///         Description = "tf-testAccNasConfig",
    ///     });
    /// 
    ///     var fooAccessRule = new AliCloud.Nas.AccessRule("fooAccessRule", new()
    ///     {
    ///         AccessGroupName = fooAccessGroup.AccessGroupName,
    ///         SourceCidrIp = "168.1.1.0/16",
    ///         RwAccessType = "RDWR",
    ///         UserAccessType = "no_squash",
    ///         Priority = 2,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Nas Access Rule can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:nas/accessRule:AccessRule foo tf-testAccNasConfigName:1
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:nas/accessRule:AccessRule")]
    public partial class AccessRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Permission group name.
        /// </summary>
        [Output("accessGroupName")]
        public Output<string> AccessGroupName { get; private set; } = null!;

        /// <summary>
        /// The nas access rule ID.
        /// </summary>
        [Output("accessRuleId")]
        public Output<string> AccessRuleId { get; private set; } = null!;

        /// <summary>
        /// Priority level. Range: 1-100. Default value: `1`.
        /// </summary>
        [Output("priority")]
        public Output<int?> Priority { get; private set; } = null!;

        /// <summary>
        /// Read-write permission type: `RDWR` (default), `RDONLY`.
        /// </summary>
        [Output("rwAccessType")]
        public Output<string?> RwAccessType { get; private set; } = null!;

        /// <summary>
        /// Address or address segment.
        /// </summary>
        [Output("sourceCidrIp")]
        public Output<string> SourceCidrIp { get; private set; } = null!;

        /// <summary>
        /// User permission type: `no_squash` (default), `root_squash`, `all_squash`.
        /// </summary>
        [Output("userAccessType")]
        public Output<string?> UserAccessType { get; private set; } = null!;


        /// <summary>
        /// Create a AccessRule resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public AccessRule(string name, AccessRuleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:nas/accessRule:AccessRule", name, args ?? new AccessRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AccessRule(string name, Input<string> id, AccessRuleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:nas/accessRule:AccessRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing AccessRule resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static AccessRule Get(string name, Input<string> id, AccessRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new AccessRule(name, id, state, options);
        }
    }

    public sealed class AccessRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Permission group name.
        /// </summary>
        [Input("accessGroupName", required: true)]
        public Input<string> AccessGroupName { get; set; } = null!;

        /// <summary>
        /// Priority level. Range: 1-100. Default value: `1`.
        /// </summary>
        [Input("priority")]
        public Input<int>? Priority { get; set; }

        /// <summary>
        /// Read-write permission type: `RDWR` (default), `RDONLY`.
        /// </summary>
        [Input("rwAccessType")]
        public Input<string>? RwAccessType { get; set; }

        /// <summary>
        /// Address or address segment.
        /// </summary>
        [Input("sourceCidrIp", required: true)]
        public Input<string> SourceCidrIp { get; set; } = null!;

        /// <summary>
        /// User permission type: `no_squash` (default), `root_squash`, `all_squash`.
        /// </summary>
        [Input("userAccessType")]
        public Input<string>? UserAccessType { get; set; }

        public AccessRuleArgs()
        {
        }
        public static new AccessRuleArgs Empty => new AccessRuleArgs();
    }

    public sealed class AccessRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Permission group name.
        /// </summary>
        [Input("accessGroupName")]
        public Input<string>? AccessGroupName { get; set; }

        /// <summary>
        /// The nas access rule ID.
        /// </summary>
        [Input("accessRuleId")]
        public Input<string>? AccessRuleId { get; set; }

        /// <summary>
        /// Priority level. Range: 1-100. Default value: `1`.
        /// </summary>
        [Input("priority")]
        public Input<int>? Priority { get; set; }

        /// <summary>
        /// Read-write permission type: `RDWR` (default), `RDONLY`.
        /// </summary>
        [Input("rwAccessType")]
        public Input<string>? RwAccessType { get; set; }

        /// <summary>
        /// Address or address segment.
        /// </summary>
        [Input("sourceCidrIp")]
        public Input<string>? SourceCidrIp { get; set; }

        /// <summary>
        /// User permission type: `no_squash` (default), `root_squash`, `all_squash`.
        /// </summary>
        [Input("userAccessType")]
        public Input<string>? UserAccessType { get; set; }

        public AccessRuleState()
        {
        }
        public static new AccessRuleState Empty => new AccessRuleState();
    }
}
