<reponame>Kagashino/pulumi-tctest// *** 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.Tctest.Cfs
{
    [TctestResourceType("tctest:Cfs/accessRule:AccessRule")]
    public partial class AccessRule : Pulumi.CustomResource
    {
        /// <summary>
        /// ID of a access group.
        /// </summary>
        [Output("accessGroupId")]
        public Output<string> AccessGroupId { get; private set; } = null!;

        /// <summary>
        /// A single IP or a single IP address range such as 10.1.10.11 or 10.10.1.0/24 indicates that all IPs are allowed. Please
        /// note that the IP entered should be CVM's private IP.
        /// </summary>
        [Output("authClientIp")]
        public Output<string> AuthClientIp { get; private set; } = null!;

        /// <summary>
        /// The priority level of rule. Valid value ranges: (1~100). `1` indicates the highest priority.
        /// </summary>
        [Output("priority")]
        public Output<int> Priority { get; private set; } = null!;

        /// <summary>
        /// Read and write permissions. Valid values are `RO` and `RW`. and default is `RO`.
        /// </summary>
        [Output("rwPermission")]
        public Output<string?> RwPermission { get; private set; } = null!;

        /// <summary>
        /// The permissions of accessing users. Valid values are `all_squash`, `no_all_squash`, `root_squash` and `no_root_squash`.
        /// and default is `root_squash`. `all_squash` indicates that all access users are mapped as anonymous users or user groups;
        /// `no_all_squash` indicates that access users will match local users first and be mapped to anonymous users or user groups
        /// after matching failed; `root_squash` indicates that map access root users to anonymous users or user groups;
        /// `no_root_squash` indicates that access root users keep root account permission.
        /// </summary>
        [Output("userPermission")]
        public Output<string?> UserPermission { 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("tctest:Cfs/accessRule:AccessRule", name, args ?? new AccessRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

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

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of a access group.
        /// </summary>
        [Input("accessGroupId", required: true)]
        public Input<string> AccessGroupId { get; set; } = null!;

        /// <summary>
        /// A single IP or a single IP address range such as 10.1.10.11 or 10.10.1.0/24 indicates that all IPs are allowed. Please
        /// note that the IP entered should be CVM's private IP.
        /// </summary>
        [Input("authClientIp", required: true)]
        public Input<string> AuthClientIp { get; set; } = null!;

        /// <summary>
        /// The priority level of rule. Valid value ranges: (1~100). `1` indicates the highest priority.
        /// </summary>
        [Input("priority", required: true)]
        public Input<int> Priority { get; set; } = null!;

        /// <summary>
        /// Read and write permissions. Valid values are `RO` and `RW`. and default is `RO`.
        /// </summary>
        [Input("rwPermission")]
        public Input<string>? RwPermission { get; set; }

        /// <summary>
        /// The permissions of accessing users. Valid values are `all_squash`, `no_all_squash`, `root_squash` and `no_root_squash`.
        /// and default is `root_squash`. `all_squash` indicates that all access users are mapped as anonymous users or user groups;
        /// `no_all_squash` indicates that access users will match local users first and be mapped to anonymous users or user groups
        /// after matching failed; `root_squash` indicates that map access root users to anonymous users or user groups;
        /// `no_root_squash` indicates that access root users keep root account permission.
        /// </summary>
        [Input("userPermission")]
        public Input<string>? UserPermission { get; set; }

        public AccessRuleArgs()
        {
        }
    }

    public sealed class AccessRuleState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of a access group.
        /// </summary>
        [Input("accessGroupId")]
        public Input<string>? AccessGroupId { get; set; }

        /// <summary>
        /// A single IP or a single IP address range such as 10.1.10.11 or 10.10.1.0/24 indicates that all IPs are allowed. Please
        /// note that the IP entered should be CVM's private IP.
        /// </summary>
        [Input("authClientIp")]
        public Input<string>? AuthClientIp { get; set; }

        /// <summary>
        /// The priority level of rule. Valid value ranges: (1~100). `1` indicates the highest priority.
        /// </summary>
        [Input("priority")]
        public Input<int>? Priority { get; set; }

        /// <summary>
        /// Read and write permissions. Valid values are `RO` and `RW`. and default is `RO`.
        /// </summary>
        [Input("rwPermission")]
        public Input<string>? RwPermission { get; set; }

        /// <summary>
        /// The permissions of accessing users. Valid values are `all_squash`, `no_all_squash`, `root_squash` and `no_root_squash`.
        /// and default is `root_squash`. `all_squash` indicates that all access users are mapped as anonymous users or user groups;
        /// `no_all_squash` indicates that access users will match local users first and be mapped to anonymous users or user groups
        /// after matching failed; `root_squash` indicates that map access root users to anonymous users or user groups;
        /// `no_root_squash` indicates that access root users keep root account permission.
        /// </summary>
        [Input("userPermission")]
        public Input<string>? UserPermission { get; set; }

        public AccessRuleState()
        {
        }
    }
}
