<filename>sdk/dotnet/Redis/Instance.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.Tctest.Redis
{
    [TctestResourceType("tctest:Redis/instance:Instance")]
    public partial class Instance : Pulumi.CustomResource
    {
        /// <summary>
        /// Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
        /// </summary>
        [Output("autoRenewFlag")]
        public Output<int?> AutoRenewFlag { get; private set; } = null!;

        /// <summary>
        /// The available zone ID of an instance to be created, please refer to `tencentcloud_redis_zone_config.list`.
        /// </summary>
        [Output("availabilityZone")]
        public Output<string> AvailabilityZone { get; private set; } = null!;

        /// <summary>
        /// The charge type of instance. Valid values: `PREPAID` and `POSTPAID`. Default value is `POSTPAID`. Note: TencentCloud
        /// International only supports `POSTPAID`. Caution that update operation on this field will delete old instances and create
        /// new with new charge type.
        /// </summary>
        [Output("chargeType")]
        public Output<string?> ChargeType { get; private set; } = null!;

        /// <summary>
        /// The time when the instance was created.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted
        /// instead of staying recycle bin. Note: only works for `PREPAID` instance.
        /// </summary>
        [Output("forceDelete")]
        public Output<bool?> ForceDelete { get; private set; } = null!;

        /// <summary>
        /// IP address of an instance.
        /// </summary>
        [Output("ip")]
        public Output<string> Ip { get; private set; } = null!;

        /// <summary>
        /// The memory volume of an available instance(in MB), please refer to
        /// `tencentcloud_redis_zone_config.list[zone].shard_memories`. When redis is standard type, it represents total memory size
        /// of the instance; when Redis is cluster type, it represents memory size of per sharding.
        /// </summary>
        [Output("memSize")]
        public Output<int> MemSize { get; private set; } = null!;

        /// <summary>
        /// Instance name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
        /// </summary>
        [Output("noAuth")]
        public Output<bool?> NoAuth { get; private set; } = null!;

        /// <summary>
        /// Password for a Redis user, which should be 8 to 16 characters. NOTE: Only `no_auth=true` specified can make password
        /// empty.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        /// <summary>
        /// The port used to access a redis instance. The default value is 6379. And this value can't be changed after creation, or
        /// the Redis instance will be recreated.
        /// </summary>
        [Output("port")]
        public Output<int?> Port { get; private set; } = null!;

        /// <summary>
        /// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to `PREPAID`.
        /// Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`.
        /// </summary>
        [Output("prepaidPeriod")]
        public Output<int?> PrepaidPeriod { get; private set; } = null!;

        /// <summary>
        /// Specifies which project the instance should belong to.
        /// </summary>
        [Output("projectId")]
        public Output<int?> ProjectId { get; private set; } = null!;

        /// <summary>
        /// The number of instance copies. This is not required for standalone and master slave versions.
        /// </summary>
        [Output("redisReplicasNum")]
        public Output<int?> RedisReplicasNum { get; private set; } = null!;

        /// <summary>
        /// The number of instance shard. This is not required for standalone and master slave versions.
        /// </summary>
        [Output("redisShardNum")]
        public Output<int?> RedisShardNum { get; private set; } = null!;

        /// <summary>
        /// ID of replica nodes available zone. This is not required for standalone and master slave versions.
        /// </summary>
        [Output("replicaZoneIds")]
        public Output<ImmutableArray<int>> ReplicaZoneIds { get; private set; } = null!;

        /// <summary>
        /// Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica
        /// read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed
        /// to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the
        /// recommended number of replicas &gt;=2.
        /// </summary>
        [Output("replicasReadOnly")]
        public Output<bool?> ReplicasReadOnly { get; private set; } = null!;

        /// <summary>
        /// ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
        /// </summary>
        [Output("securityGroups")]
        public Output<ImmutableArray<string>> SecurityGroups { get; private set; } = null!;

        /// <summary>
        /// Current status of an instance, maybe: init, processing, online, isolate and todelete.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// Specifies which subnet the instance should belong to.
        /// </summary>
        [Output("subnetId")]
        public Output<string> SubnetId { get; private set; } = null!;

        /// <summary>
        /// Instance tags.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;

        /// <summary>
        /// Instance type. Available values:
        /// `cluster_ckv`,`cluster_redis5.0`,`cluster_redis`,`master_slave_ckv`,`master_slave_redis4.0`,`master_slave_redis5.0`,`master_slave_redis`,`standalone_redis`,
        /// specific region support specific types, need to refer data `tencentcloud_redis_zone_config`.
        /// </summary>
        [Output("type")]
        public Output<string?> Type { get; private set; } = null!;

        /// <summary>
        /// Instance type. Available values reference data source `tencentcloud_redis_zone_config` or
        /// [document](https://intl.cloud.tencent.com/document/product/239/32069).
        /// </summary>
        [Output("typeId")]
        public Output<int?> TypeId { get; private set; } = null!;

        /// <summary>
        /// ID of the vpc with which the instance is to be associated.
        /// </summary>
        [Output("vpcId")]
        public Output<string> VpcId { get; private set; } = null!;


        /// <summary>
        /// Create a Instance 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 Instance(string name, InstanceArgs args, CustomResourceOptions? options = null)
            : base("tctest:Redis/instance:Instance", name, args ?? new InstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Instance(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Redis/instance:Instance", 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 Instance 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 Instance Get(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
        {
            return new Instance(name, id, state, options);
        }
    }

    public sealed class InstanceArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// The available zone ID of an instance to be created, please refer to `tencentcloud_redis_zone_config.list`.
        /// </summary>
        [Input("availabilityZone", required: true)]
        public Input<string> AvailabilityZone { get; set; } = null!;

        /// <summary>
        /// The charge type of instance. Valid values: `PREPAID` and `POSTPAID`. Default value is `POSTPAID`. Note: TencentCloud
        /// International only supports `POSTPAID`. Caution that update operation on this field will delete old instances and create
        /// new with new charge type.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted
        /// instead of staying recycle bin. Note: only works for `PREPAID` instance.
        /// </summary>
        [Input("forceDelete")]
        public Input<bool>? ForceDelete { get; set; }

        /// <summary>
        /// The memory volume of an available instance(in MB), please refer to
        /// `tencentcloud_redis_zone_config.list[zone].shard_memories`. When redis is standard type, it represents total memory size
        /// of the instance; when Redis is cluster type, it represents memory size of per sharding.
        /// </summary>
        [Input("memSize", required: true)]
        public Input<int> MemSize { get; set; } = null!;

        /// <summary>
        /// Instance name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
        /// </summary>
        [Input("noAuth")]
        public Input<bool>? NoAuth { get; set; }

        /// <summary>
        /// Password for a Redis user, which should be 8 to 16 characters. NOTE: Only `no_auth=true` specified can make password
        /// empty.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The port used to access a redis instance. The default value is 6379. And this value can't be changed after creation, or
        /// the Redis instance will be recreated.
        /// </summary>
        [Input("port")]
        public Input<int>? Port { get; set; }

        /// <summary>
        /// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to `PREPAID`.
        /// Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`.
        /// </summary>
        [Input("prepaidPeriod")]
        public Input<int>? PrepaidPeriod { get; set; }

        /// <summary>
        /// Specifies which project the instance should belong to.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// The number of instance copies. This is not required for standalone and master slave versions.
        /// </summary>
        [Input("redisReplicasNum")]
        public Input<int>? RedisReplicasNum { get; set; }

        /// <summary>
        /// The number of instance shard. This is not required for standalone and master slave versions.
        /// </summary>
        [Input("redisShardNum")]
        public Input<int>? RedisShardNum { get; set; }

        [Input("replicaZoneIds")]
        private InputList<int>? _replicaZoneIds;

        /// <summary>
        /// ID of replica nodes available zone. This is not required for standalone and master slave versions.
        /// </summary>
        public InputList<int> ReplicaZoneIds
        {
            get => _replicaZoneIds ?? (_replicaZoneIds = new InputList<int>());
            set => _replicaZoneIds = value;
        }

        /// <summary>
        /// Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica
        /// read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed
        /// to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the
        /// recommended number of replicas &gt;=2.
        /// </summary>
        [Input("replicasReadOnly")]
        public Input<bool>? ReplicasReadOnly { get; set; }

        [Input("securityGroups")]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Specifies which subnet the instance should belong to.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Instance tags.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// Instance type. Available values:
        /// `cluster_ckv`,`cluster_redis5.0`,`cluster_redis`,`master_slave_ckv`,`master_slave_redis4.0`,`master_slave_redis5.0`,`master_slave_redis`,`standalone_redis`,
        /// specific region support specific types, need to refer data `tencentcloud_redis_zone_config`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// Instance type. Available values reference data source `tencentcloud_redis_zone_config` or
        /// [document](https://intl.cloud.tencent.com/document/product/239/32069).
        /// </summary>
        [Input("typeId")]
        public Input<int>? TypeId { get; set; }

        /// <summary>
        /// ID of the vpc with which the instance is to be associated.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public InstanceArgs()
        {
        }
    }

    public sealed class InstanceState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Auto-renew flag. 0 - default state (manual renewal); 1 - automatic renewal; 2 - explicit no automatic renewal.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// The available zone ID of an instance to be created, please refer to `tencentcloud_redis_zone_config.list`.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// The charge type of instance. Valid values: `PREPAID` and `POSTPAID`. Default value is `POSTPAID`. Note: TencentCloud
        /// International only supports `POSTPAID`. Caution that update operation on this field will delete old instances and create
        /// new with new charge type.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// The time when the instance was created.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// Indicate whether to delete Redis instance directly or not. Default is false. If set true, the instance will be deleted
        /// instead of staying recycle bin. Note: only works for `PREPAID` instance.
        /// </summary>
        [Input("forceDelete")]
        public Input<bool>? ForceDelete { get; set; }

        /// <summary>
        /// IP address of an instance.
        /// </summary>
        [Input("ip")]
        public Input<string>? Ip { get; set; }

        /// <summary>
        /// The memory volume of an available instance(in MB), please refer to
        /// `tencentcloud_redis_zone_config.list[zone].shard_memories`. When redis is standard type, it represents total memory size
        /// of the instance; when Redis is cluster type, it represents memory size of per sharding.
        /// </summary>
        [Input("memSize")]
        public Input<int>? MemSize { get; set; }

        /// <summary>
        /// Instance name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Indicates whether the redis instance support no-auth access. NOTE: Only available in private cloud environment.
        /// </summary>
        [Input("noAuth")]
        public Input<bool>? NoAuth { get; set; }

        /// <summary>
        /// Password for a Redis user, which should be 8 to 16 characters. NOTE: Only `no_auth=true` specified can make password
        /// empty.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The port used to access a redis instance. The default value is 6379. And this value can't be changed after creation, or
        /// the Redis instance will be recreated.
        /// </summary>
        [Input("port")]
        public Input<int>? Port { get; set; }

        /// <summary>
        /// The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when charge_type is set to `PREPAID`.
        /// Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`.
        /// </summary>
        [Input("prepaidPeriod")]
        public Input<int>? PrepaidPeriod { get; set; }

        /// <summary>
        /// Specifies which project the instance should belong to.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// The number of instance copies. This is not required for standalone and master slave versions.
        /// </summary>
        [Input("redisReplicasNum")]
        public Input<int>? RedisReplicasNum { get; set; }

        /// <summary>
        /// The number of instance shard. This is not required for standalone and master slave versions.
        /// </summary>
        [Input("redisShardNum")]
        public Input<int>? RedisShardNum { get; set; }

        [Input("replicaZoneIds")]
        private InputList<int>? _replicaZoneIds;

        /// <summary>
        /// ID of replica nodes available zone. This is not required for standalone and master slave versions.
        /// </summary>
        public InputList<int> ReplicaZoneIds
        {
            get => _replicaZoneIds ?? (_replicaZoneIds = new InputList<int>());
            set => _replicaZoneIds = value;
        }

        /// <summary>
        /// Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica
        /// read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed
        /// to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the
        /// recommended number of replicas &gt;=2.
        /// </summary>
        [Input("replicasReadOnly")]
        public Input<bool>? ReplicasReadOnly { get; set; }

        [Input("securityGroups")]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Current status of an instance, maybe: init, processing, online, isolate and todelete.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Specifies which subnet the instance should belong to.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Instance tags.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// Instance type. Available values:
        /// `cluster_ckv`,`cluster_redis5.0`,`cluster_redis`,`master_slave_ckv`,`master_slave_redis4.0`,`master_slave_redis5.0`,`master_slave_redis`,`standalone_redis`,
        /// specific region support specific types, need to refer data `tencentcloud_redis_zone_config`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// Instance type. Available values reference data source `tencentcloud_redis_zone_config` or
        /// [document](https://intl.cloud.tencent.com/document/product/239/32069).
        /// </summary>
        [Input("typeId")]
        public Input<int>? TypeId { get; set; }

        /// <summary>
        /// ID of the vpc with which the instance is to be associated.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public InstanceState()
        {
        }
    }
}
