// *** 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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Redis
{
    /// <summary>
    /// Provides a resource to create a redis replica_readonly
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var replicaReadonly = new Tencentcloud.Redis.ReplicaReadonly("replicaReadonly", new Tencentcloud.Redis.ReplicaReadonlyArgs
    ///         {
    ///             InstanceId = "crs-c1nl9rpv",
    ///             Operate = "enable",
    ///             ReadonlyPolicies = 
    ///             {
    ///                 "master",
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Redis/replicaReadonly:ReplicaReadonly")]
    public partial class ReplicaReadonly : Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Output("instanceId")]
        public Output<string> InstanceId { get; private set; } = null!;

        /// <summary>
        /// The replica is read-only, `enable` - enable read-write splitting, `disable`- disable read-write splitting.
        /// </summary>
        [Output("operate")]
        public Output<string> Operate { get; private set; } = null!;

        /// <summary>
        /// Routing policy: Enter `master` or `replication`, which indicates the master node or slave node.
        /// </summary>
        [Output("readonlyPolicies")]
        public Output<ImmutableArray<string>> ReadonlyPolicies { get; private set; } = null!;


        /// <summary>
        /// Create a ReplicaReadonly 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 ReplicaReadonly(string name, ReplicaReadonlyArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Redis/replicaReadonly:ReplicaReadonly", name, args ?? new ReplicaReadonlyArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ReplicaReadonly(string name, Input<string> id, ReplicaReadonlyState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Redis/replicaReadonly:ReplicaReadonly", 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/tencentcloudstack",
            };
            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 ReplicaReadonly 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 ReplicaReadonly Get(string name, Input<string> id, ReplicaReadonlyState? state = null, CustomResourceOptions? options = null)
        {
            return new ReplicaReadonly(name, id, state, options);
        }
    }

    public sealed class ReplicaReadonlyArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The replica is read-only, `enable` - enable read-write splitting, `disable`- disable read-write splitting.
        /// </summary>
        [Input("operate", required: true)]
        public Input<string> Operate { get; set; } = null!;

        [Input("readonlyPolicies")]
        private InputList<string>? _readonlyPolicies;

        /// <summary>
        /// Routing policy: Enter `master` or `replication`, which indicates the master node or slave node.
        /// </summary>
        public InputList<string> ReadonlyPolicies
        {
            get => _readonlyPolicies ?? (_readonlyPolicies = new InputList<string>());
            set => _readonlyPolicies = value;
        }

        public ReplicaReadonlyArgs()
        {
        }
    }

    public sealed class ReplicaReadonlyState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of instance.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// The replica is read-only, `enable` - enable read-write splitting, `disable`- disable read-write splitting.
        /// </summary>
        [Input("operate")]
        public Input<string>? Operate { get; set; }

        [Input("readonlyPolicies")]
        private InputList<string>? _readonlyPolicies;

        /// <summary>
        /// Routing policy: Enter `master` or `replication`, which indicates the master node or slave node.
        /// </summary>
        public InputList<string> ReadonlyPolicies
        {
            get => _readonlyPolicies ?? (_readonlyPolicies = new InputList<string>());
            set => _readonlyPolicies = value;
        }

        public ReplicaReadonlyState()
        {
        }
    }
}
