// *** 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.Rds
{
    /// <summary>
    /// Provides an RDS readonly instance resource.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var creation = config.Get("creation") ?? "Rds";
    ///     var name = config.Get("name") ?? "dbInstancevpc";
    ///     var defaultZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = creation,
    ///     });
    /// 
    ///     var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    ///     {
    ///         CidrBlock = "172.16.0.0/16",
    ///     });
    /// 
    ///     var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
    ///     {
    ///         VpcId = defaultNetwork.Id,
    ///         CidrBlock = "172.16.0.0/24",
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         VswitchName = name,
    ///     });
    /// 
    ///     var defaultInstance = new AliCloud.Rds.Instance("defaultInstance", new()
    ///     {
    ///         Engine = "MySQL",
    ///         EngineVersion = "5.6",
    ///         InstanceType = "rds.mysql.t1.small",
    ///         InstanceStorage = 20,
    ///         InstanceChargeType = "Postpaid",
    ///         InstanceName = name,
    ///         VswitchId = defaultSwitch.Id,
    ///         SecurityIps = new[]
    ///         {
    ///             "10.168.1.12",
    ///             "172.16.17.32",
    ///         },
    ///     });
    /// 
    ///     var defaultReadOnlyInstance = new AliCloud.Rds.ReadOnlyInstance("defaultReadOnlyInstance", new()
    ///     {
    ///         MasterDbInstanceId = defaultInstance.Id,
    ///         ZoneId = defaultInstance.ZoneId,
    ///         EngineVersion = defaultInstance.EngineVersion,
    ///         InstanceType = defaultInstance.InstanceType,
    ///         InstanceStorage = 30,
    ///         InstanceName = $"{name}ro",
    ///         VswitchId = defaultSwitch.Id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// RDS readonly instance can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:rds/readOnlyInstance:ReadOnlyInstance example rm-abc12345678
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:rds/readOnlyInstance:ReadOnlyInstance")]
    public partial class ReadOnlyInstance : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The method that is used to verify the identities of clients. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// </summary>
        [Output("acl")]
        public Output<string> Acl { get; private set; } = null!;

        /// <summary>
        /// Whether to renewal a DB instance automatically or not. It is valid when instance_charge_type is `PrePaid`. Default to `false`.
        /// </summary>
        [Output("autoRenew")]
        public Output<bool?> AutoRenew { get; private set; } = null!;

        /// <summary>
        /// Auto-renewal period of an instance, in the unit of the month. It is valid when instance_charge_type is `PrePaid`. Valid value:[1~12], Default to 1.
        /// </summary>
        [Output("autoRenewPeriod")]
        public Output<int?> AutoRenewPeriod { get; private set; } = null!;

        /// <summary>
        /// The type of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the SSLEnabled parameter to 1, the default value of this parameter is aliyun. It is valid only when `ssl_enabled  = 1`. Value range:
        /// - aliyun: a cloud certificate
        /// - custom: a custom certificate
        /// </summary>
        [Output("caType")]
        public Output<string> CaType { get; private set; } = null!;

        /// <summary>
        /// The public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCAEbabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Output("clientCaCert")]
        public Output<string?> ClientCaCert { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable the public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the public key
        /// - 0: disables the public key
        /// </summary>
        [Output("clientCaEnabled")]
        public Output<int?> ClientCaEnabled { get; private set; } = null!;

        /// <summary>
        /// The CRL that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCrlEnabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Output("clientCertRevocationList")]
        public Output<string?> ClientCertRevocationList { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable a certificate revocation list (CRL) that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the CRL
        /// - 0: disables the CRL
        /// </summary>
        [Output("clientCrlEnabled")]
        public Output<int?> ClientCrlEnabled { get; private set; } = null!;

        /// <summary>
        /// RDS database connection string.
        /// </summary>
        [Output("connectionString")]
        public Output<string> ConnectionString { get; private set; } = null!;

        /// <summary>
        /// The attribute of the IP address whitelist. By default, this parameter is empty.
        /// </summary>
        [Output("dbInstanceIpArrayAttribute")]
        public Output<string?> DbInstanceIpArrayAttribute { get; private set; } = null!;

        /// <summary>
        /// The name of the IP address whitelist. Default value: Default.
        /// </summary>
        [Output("dbInstanceIpArrayName")]
        public Output<string?> DbInstanceIpArrayName { get; private set; } = null!;

        /// <summary>
        /// The storage type of the instance. Valid values:
        /// - local_ssd: specifies to use local SSDs. This value is recommended.
        /// - cloud_ssd: specifies to use standard SSDs.
        /// - cloud_essd: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd2: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd3: specifies to use enhanced SSDs (ESSDs).
        /// </summary>
        [Output("dbInstanceStorageType")]
        public Output<string> DbInstanceStorageType { get; private set; } = null!;

        /// <summary>
        /// The switch of delete protection. Valid values:
        /// - true: delete protect.
        /// - false: no delete protect.
        /// </summary>
        [Output("deletionProtection")]
        public Output<bool?> DeletionProtection { get; private set; } = null!;

        /// <summary>
        /// Database type.
        /// </summary>
        [Output("engine")]
        public Output<string> Engine { get; private set; } = null!;

        /// <summary>
        /// Database version. Value options can refer to the latest docs [CreateDBInstance](https://www.alibabacloud.com/help/doc-detail/26228.htm) `EngineVersion`.
        /// </summary>
        [Output("engineVersion")]
        public Output<string> EngineVersion { get; private set; } = null!;

        /// <summary>
        /// Set it to true to make some parameter efficient when modifying them. Default to false.
        /// </summary>
        [Output("forceRestart")]
        public Output<bool?> ForceRestart { get; private set; } = null!;

        /// <summary>
        /// Valid values are `Prepaid`, `Postpaid`, Default to `Postpaid`. The interval between the two conversion operations must be greater than 15 minutes. Only when this parameter is `Postpaid`, the instance can be released.
        /// </summary>
        [Output("instanceChargeType")]
        public Output<string?> InstanceChargeType { get; private set; } = null!;

        /// <summary>
        /// The name of DB instance. It a string of 2 to 256 characters.
        /// </summary>
        [Output("instanceName")]
        public Output<string> InstanceName { get; private set; } = null!;

        /// <summary>
        /// User-defined DB instance storage space. Value range: [5, 2000] for MySQL/SQL Server HA dual node edition. Increase progressively at a rate of 5 GB. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Output("instanceStorage")]
        public Output<int> InstanceStorage { get; private set; } = null!;

        /// <summary>
        /// DB Instance type. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Output("instanceType")]
        public Output<string> InstanceType { get; private set; } = null!;

        /// <summary>
        /// ID of the master instance.
        /// </summary>
        [Output("masterDbInstanceId")]
        public Output<string> MasterDbInstanceId { get; private set; } = null!;

        /// <summary>
        /// The method that is used to modify the IP address whitelist. Default value: Cover. Valid values:
        /// - Cover: Use the value of the SecurityIps parameter to overwrite the existing entries in the IP address whitelist.
        /// - Append: Add the IP addresses and CIDR blocks that are specified in the SecurityIps parameter to the IP address whitelist.
        /// - Delete: Delete IP addresses and CIDR blocks that are specified in the SecurityIps parameter from the IP address whitelist. You must retain at least one IP address or CIDR block.
        /// </summary>
        [Output("modifyMode")]
        public Output<string?> ModifyMode { get; private set; } = null!;

        /// <summary>
        /// Set of parameters needs to be set after DB instance was launched. Available parameters can refer to the latest docs [View database parameter templates](https://www.alibabacloud.com/help/doc-detail/26284.htm).
        /// </summary>
        [Output("parameters")]
        public Output<ImmutableArray<Outputs.ReadOnlyInstanceParameter>> Parameters { get; private set; } = null!;

        /// <summary>
        /// The duration that you will buy DB instance (in month). It is valid when instance_charge_type is `PrePaid`. Valid values: [1~9], 12, 24, 36.
        /// </summary>
        [Output("period")]
        public Output<int?> Period { get; private set; } = null!;

        /// <summary>
        /// RDS database connection port.
        /// </summary>
        [Output("port")]
        public Output<string> Port { get; private set; } = null!;

        /// <summary>
        /// The method that is used to verify the replication permission. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// &gt; **NOTE:** Because of data backup and migration, change DB instance type and storage would cost 15~20 minutes. Please make full preparation before changing them.
        /// </summary>
        [Output("replicationAcl")]
        public Output<string> ReplicationAcl { get; private set; } = null!;

        /// <summary>
        /// The ID of resource group which the DB read-only instance belongs.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string> ResourceGroupId { get; private set; } = null!;

        /// <summary>
        /// The type of IP address in the IP address whitelist.
        /// </summary>
        [Output("securityIpType")]
        public Output<string?> SecurityIpType { get; private set; } = null!;

        /// <summary>
        /// List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).
        /// </summary>
        [Output("securityIps")]
        public Output<ImmutableArray<string>> SecurityIps { get; private set; } = null!;

        /// <summary>
        /// The content of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Output("serverCert")]
        public Output<string> ServerCert { get; private set; } = null!;

        /// <summary>
        /// The private key of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Output("serverKey")]
        public Output<string> ServerKey { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable or disable SSL encryption. Valid values:
        /// - 1: enables SSL encryption
        /// - 0: disables SSL encryption
        /// </summary>
        [Output("sslEnabled")]
        public Output<int> SslEnabled { get; private set; } = null!;

        /// <summary>
        /// The specific point in time when you want to perform the update. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. It is valid only when `upgrade_db_instance_kernel_version = true`. The time must be in UTC.
        /// </summary>
        [Output("switchTime")]
        public Output<string?> SwitchTime { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
        /// - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;

        /// <summary>
        /// The minor engine version to which you want to update the instance. If you do not specify this parameter, the instance is updated to the latest minor engine version. It is valid only when `upgrade_db_instance_kernel_version = true`. You must specify the minor engine version in one of the following formats:
        /// - PostgreSQL: rds_postgres_&lt;Major engine version&gt;00_&lt;Minor engine version&gt;. Example: rds_postgres_1200_20200830.
        /// - MySQL: &lt;RDS edition&gt;_&lt;Minor engine version&gt;. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229. The following RDS editions are supported:
        /// - rds: The instance runs RDS Basic or High-availability Edition.
        /// - xcluster: The instance runs MySQL 5.7 on RDS Enterprise Edition.
        /// - xcluster80: The instance runs MySQL 8.0 on RDS Enterprise Edition.
        /// - SQLServer: &lt;Minor engine version&gt;. Example: 15.0.4073.23.
        /// </summary>
        [Output("targetMinorVersion")]
        public Output<string> TargetMinorVersion { get; private set; } = null!;

        /// <summary>
        /// Whether to upgrade a minor version of the kernel. Valid values:
        /// - true: upgrade
        /// - false: not to upgrade
        /// </summary>
        [Output("upgradeDbInstanceKernelVersion")]
        public Output<bool?> UpgradeDbInstanceKernelVersion { get; private set; } = null!;

        /// <summary>
        /// The method to update the minor engine version. Default value: Immediate. It is valid only when `upgrade_db_instance_kernel_version = true`. Valid values:
        /// - Immediate: The minor engine version is immediately updated.
        /// - MaintainTime: The minor engine version is updated during the maintenance window. For more information about how to change the maintenance window, see ModifyDBInstanceMaintainTime.
        /// - SpecifyTime: The minor engine version is updated at the point in time you specify.
        /// </summary>
        [Output("upgradeTime")]
        public Output<string?> UpgradeTime { get; private set; } = null!;

        /// <summary>
        /// The virtual switch ID to launch DB instances in one VPC.
        /// </summary>
        [Output("vswitchId")]
        public Output<string?> VswitchId { get; private set; } = null!;

        /// <summary>
        /// The network type of the IP address whitelist. Default value: MIX. Valid values:
        /// - Classic: classic network in enhanced whitelist mode
        /// - VPC: virtual private cloud (VPC) in enhanced whitelist mode
        /// - MIX: standard whitelist mode
        /// &gt; **NOTE:** In standard whitelist mode, IP addresses and CIDR blocks can be added only to the default IP address whitelist. In enhanced whitelist mode, IP addresses and CIDR blocks can be added to both IP address whitelists of the classic network type and those of the VPC network type.
        /// </summary>
        [Output("whitelistNetworkType")]
        public Output<string?> WhitelistNetworkType { get; private set; } = null!;

        /// <summary>
        /// The Zone to launch the DB instance.
        /// </summary>
        [Output("zoneId")]
        public Output<string> ZoneId { get; private set; } = null!;


        /// <summary>
        /// Create a ReadOnlyInstance 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 ReadOnlyInstance(string name, ReadOnlyInstanceArgs args, CustomResourceOptions? options = null)
            : base("alicloud:rds/readOnlyInstance:ReadOnlyInstance", name, args ?? new ReadOnlyInstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ReadOnlyInstance(string name, Input<string> id, ReadOnlyInstanceState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:rds/readOnlyInstance:ReadOnlyInstance", 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 ReadOnlyInstance 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 ReadOnlyInstance Get(string name, Input<string> id, ReadOnlyInstanceState? state = null, CustomResourceOptions? options = null)
        {
            return new ReadOnlyInstance(name, id, state, options);
        }
    }

    public sealed class ReadOnlyInstanceArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The method that is used to verify the identities of clients. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// </summary>
        [Input("acl")]
        public Input<string>? Acl { get; set; }

        /// <summary>
        /// Whether to renewal a DB instance automatically or not. It is valid when instance_charge_type is `PrePaid`. Default to `false`.
        /// </summary>
        [Input("autoRenew")]
        public Input<bool>? AutoRenew { get; set; }

        /// <summary>
        /// Auto-renewal period of an instance, in the unit of the month. It is valid when instance_charge_type is `PrePaid`. Valid value:[1~12], Default to 1.
        /// </summary>
        [Input("autoRenewPeriod")]
        public Input<int>? AutoRenewPeriod { get; set; }

        /// <summary>
        /// The type of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the SSLEnabled parameter to 1, the default value of this parameter is aliyun. It is valid only when `ssl_enabled  = 1`. Value range:
        /// - aliyun: a cloud certificate
        /// - custom: a custom certificate
        /// </summary>
        [Input("caType")]
        public Input<string>? CaType { get; set; }

        /// <summary>
        /// The public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCAEbabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("clientCaCert")]
        public Input<string>? ClientCaCert { get; set; }

        /// <summary>
        /// Specifies whether to enable the public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the public key
        /// - 0: disables the public key
        /// </summary>
        [Input("clientCaEnabled")]
        public Input<int>? ClientCaEnabled { get; set; }

        /// <summary>
        /// The CRL that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCrlEnabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("clientCertRevocationList")]
        public Input<string>? ClientCertRevocationList { get; set; }

        /// <summary>
        /// Specifies whether to enable a certificate revocation list (CRL) that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the CRL
        /// - 0: disables the CRL
        /// </summary>
        [Input("clientCrlEnabled")]
        public Input<int>? ClientCrlEnabled { get; set; }

        /// <summary>
        /// The attribute of the IP address whitelist. By default, this parameter is empty.
        /// </summary>
        [Input("dbInstanceIpArrayAttribute")]
        public Input<string>? DbInstanceIpArrayAttribute { get; set; }

        /// <summary>
        /// The name of the IP address whitelist. Default value: Default.
        /// </summary>
        [Input("dbInstanceIpArrayName")]
        public Input<string>? DbInstanceIpArrayName { get; set; }

        /// <summary>
        /// The storage type of the instance. Valid values:
        /// - local_ssd: specifies to use local SSDs. This value is recommended.
        /// - cloud_ssd: specifies to use standard SSDs.
        /// - cloud_essd: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd2: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd3: specifies to use enhanced SSDs (ESSDs).
        /// </summary>
        [Input("dbInstanceStorageType")]
        public Input<string>? DbInstanceStorageType { get; set; }

        /// <summary>
        /// The switch of delete protection. Valid values:
        /// - true: delete protect.
        /// - false: no delete protect.
        /// </summary>
        [Input("deletionProtection")]
        public Input<bool>? DeletionProtection { get; set; }

        /// <summary>
        /// Database version. Value options can refer to the latest docs [CreateDBInstance](https://www.alibabacloud.com/help/doc-detail/26228.htm) `EngineVersion`.
        /// </summary>
        [Input("engineVersion", required: true)]
        public Input<string> EngineVersion { get; set; } = null!;

        /// <summary>
        /// Set it to true to make some parameter efficient when modifying them. Default to false.
        /// </summary>
        [Input("forceRestart")]
        public Input<bool>? ForceRestart { get; set; }

        /// <summary>
        /// Valid values are `Prepaid`, `Postpaid`, Default to `Postpaid`. The interval between the two conversion operations must be greater than 15 minutes. Only when this parameter is `Postpaid`, the instance can be released.
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        /// <summary>
        /// The name of DB instance. It a string of 2 to 256 characters.
        /// </summary>
        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// User-defined DB instance storage space. Value range: [5, 2000] for MySQL/SQL Server HA dual node edition. Increase progressively at a rate of 5 GB. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Input("instanceStorage", required: true)]
        public Input<int> InstanceStorage { get; set; } = null!;

        /// <summary>
        /// DB Instance type. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Input("instanceType", required: true)]
        public Input<string> InstanceType { get; set; } = null!;

        /// <summary>
        /// ID of the master instance.
        /// </summary>
        [Input("masterDbInstanceId", required: true)]
        public Input<string> MasterDbInstanceId { get; set; } = null!;

        /// <summary>
        /// The method that is used to modify the IP address whitelist. Default value: Cover. Valid values:
        /// - Cover: Use the value of the SecurityIps parameter to overwrite the existing entries in the IP address whitelist.
        /// - Append: Add the IP addresses and CIDR blocks that are specified in the SecurityIps parameter to the IP address whitelist.
        /// - Delete: Delete IP addresses and CIDR blocks that are specified in the SecurityIps parameter from the IP address whitelist. You must retain at least one IP address or CIDR block.
        /// </summary>
        [Input("modifyMode")]
        public Input<string>? ModifyMode { get; set; }

        [Input("parameters")]
        private InputList<Inputs.ReadOnlyInstanceParameterArgs>? _parameters;

        /// <summary>
        /// Set of parameters needs to be set after DB instance was launched. Available parameters can refer to the latest docs [View database parameter templates](https://www.alibabacloud.com/help/doc-detail/26284.htm).
        /// </summary>
        public InputList<Inputs.ReadOnlyInstanceParameterArgs> Parameters
        {
            get => _parameters ?? (_parameters = new InputList<Inputs.ReadOnlyInstanceParameterArgs>());
            set => _parameters = value;
        }

        /// <summary>
        /// The duration that you will buy DB instance (in month). It is valid when instance_charge_type is `PrePaid`. Valid values: [1~9], 12, 24, 36.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// The method that is used to verify the replication permission. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// &gt; **NOTE:** Because of data backup and migration, change DB instance type and storage would cost 15~20 minutes. Please make full preparation before changing them.
        /// </summary>
        [Input("replicationAcl")]
        public Input<string>? ReplicationAcl { get; set; }

        /// <summary>
        /// The ID of resource group which the DB read-only instance belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The type of IP address in the IP address whitelist.
        /// </summary>
        [Input("securityIpType")]
        public Input<string>? SecurityIpType { get; set; }

        [Input("securityIps")]
        private InputList<string>? _securityIps;

        /// <summary>
        /// List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).
        /// </summary>
        public InputList<string> SecurityIps
        {
            get => _securityIps ?? (_securityIps = new InputList<string>());
            set => _securityIps = value;
        }

        /// <summary>
        /// The content of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("serverCert")]
        public Input<string>? ServerCert { get; set; }

        /// <summary>
        /// The private key of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("serverKey")]
        public Input<string>? ServerKey { get; set; }

        /// <summary>
        /// Specifies whether to enable or disable SSL encryption. Valid values:
        /// - 1: enables SSL encryption
        /// - 0: disables SSL encryption
        /// </summary>
        [Input("sslEnabled")]
        public Input<int>? SslEnabled { get; set; }

        /// <summary>
        /// The specific point in time when you want to perform the update. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. It is valid only when `upgrade_db_instance_kernel_version = true`. The time must be in UTC.
        /// </summary>
        [Input("switchTime")]
        public Input<string>? SwitchTime { get; set; }

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

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
        /// - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// The minor engine version to which you want to update the instance. If you do not specify this parameter, the instance is updated to the latest minor engine version. It is valid only when `upgrade_db_instance_kernel_version = true`. You must specify the minor engine version in one of the following formats:
        /// - PostgreSQL: rds_postgres_&lt;Major engine version&gt;00_&lt;Minor engine version&gt;. Example: rds_postgres_1200_20200830.
        /// - MySQL: &lt;RDS edition&gt;_&lt;Minor engine version&gt;. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229. The following RDS editions are supported:
        /// - rds: The instance runs RDS Basic or High-availability Edition.
        /// - xcluster: The instance runs MySQL 5.7 on RDS Enterprise Edition.
        /// - xcluster80: The instance runs MySQL 8.0 on RDS Enterprise Edition.
        /// - SQLServer: &lt;Minor engine version&gt;. Example: 15.0.4073.23.
        /// </summary>
        [Input("targetMinorVersion")]
        public Input<string>? TargetMinorVersion { get; set; }

        /// <summary>
        /// Whether to upgrade a minor version of the kernel. Valid values:
        /// - true: upgrade
        /// - false: not to upgrade
        /// </summary>
        [Input("upgradeDbInstanceKernelVersion")]
        public Input<bool>? UpgradeDbInstanceKernelVersion { get; set; }

        /// <summary>
        /// The method to update the minor engine version. Default value: Immediate. It is valid only when `upgrade_db_instance_kernel_version = true`. Valid values:
        /// - Immediate: The minor engine version is immediately updated.
        /// - MaintainTime: The minor engine version is updated during the maintenance window. For more information about how to change the maintenance window, see ModifyDBInstanceMaintainTime.
        /// - SpecifyTime: The minor engine version is updated at the point in time you specify.
        /// </summary>
        [Input("upgradeTime")]
        public Input<string>? UpgradeTime { get; set; }

        /// <summary>
        /// The virtual switch ID to launch DB instances in one VPC.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// The network type of the IP address whitelist. Default value: MIX. Valid values:
        /// - Classic: classic network in enhanced whitelist mode
        /// - VPC: virtual private cloud (VPC) in enhanced whitelist mode
        /// - MIX: standard whitelist mode
        /// &gt; **NOTE:** In standard whitelist mode, IP addresses and CIDR blocks can be added only to the default IP address whitelist. In enhanced whitelist mode, IP addresses and CIDR blocks can be added to both IP address whitelists of the classic network type and those of the VPC network type.
        /// </summary>
        [Input("whitelistNetworkType")]
        public Input<string>? WhitelistNetworkType { get; set; }

        /// <summary>
        /// The Zone to launch the DB instance.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

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

    public sealed class ReadOnlyInstanceState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The method that is used to verify the identities of clients. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// </summary>
        [Input("acl")]
        public Input<string>? Acl { get; set; }

        /// <summary>
        /// Whether to renewal a DB instance automatically or not. It is valid when instance_charge_type is `PrePaid`. Default to `false`.
        /// </summary>
        [Input("autoRenew")]
        public Input<bool>? AutoRenew { get; set; }

        /// <summary>
        /// Auto-renewal period of an instance, in the unit of the month. It is valid when instance_charge_type is `PrePaid`. Valid value:[1~12], Default to 1.
        /// </summary>
        [Input("autoRenewPeriod")]
        public Input<int>? AutoRenewPeriod { get; set; }

        /// <summary>
        /// The type of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the SSLEnabled parameter to 1, the default value of this parameter is aliyun. It is valid only when `ssl_enabled  = 1`. Value range:
        /// - aliyun: a cloud certificate
        /// - custom: a custom certificate
        /// </summary>
        [Input("caType")]
        public Input<string>? CaType { get; set; }

        /// <summary>
        /// The public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCAEbabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("clientCaCert")]
        public Input<string>? ClientCaCert { get; set; }

        /// <summary>
        /// Specifies whether to enable the public key of the CA that issues client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the public key
        /// - 0: disables the public key
        /// </summary>
        [Input("clientCaEnabled")]
        public Input<int>? ClientCaEnabled { get; set; }

        /// <summary>
        /// The CRL that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the ClientCrlEnabled parameter to 1, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("clientCertRevocationList")]
        public Input<string>? ClientCertRevocationList { get; set; }

        /// <summary>
        /// Specifies whether to enable a certificate revocation list (CRL) that contains revoked client certificates. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - 1: enables the CRL
        /// - 0: disables the CRL
        /// </summary>
        [Input("clientCrlEnabled")]
        public Input<int>? ClientCrlEnabled { get; set; }

        /// <summary>
        /// RDS database connection string.
        /// </summary>
        [Input("connectionString")]
        public Input<string>? ConnectionString { get; set; }

        /// <summary>
        /// The attribute of the IP address whitelist. By default, this parameter is empty.
        /// </summary>
        [Input("dbInstanceIpArrayAttribute")]
        public Input<string>? DbInstanceIpArrayAttribute { get; set; }

        /// <summary>
        /// The name of the IP address whitelist. Default value: Default.
        /// </summary>
        [Input("dbInstanceIpArrayName")]
        public Input<string>? DbInstanceIpArrayName { get; set; }

        /// <summary>
        /// The storage type of the instance. Valid values:
        /// - local_ssd: specifies to use local SSDs. This value is recommended.
        /// - cloud_ssd: specifies to use standard SSDs.
        /// - cloud_essd: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd2: specifies to use enhanced SSDs (ESSDs).
        /// - cloud_essd3: specifies to use enhanced SSDs (ESSDs).
        /// </summary>
        [Input("dbInstanceStorageType")]
        public Input<string>? DbInstanceStorageType { get; set; }

        /// <summary>
        /// The switch of delete protection. Valid values:
        /// - true: delete protect.
        /// - false: no delete protect.
        /// </summary>
        [Input("deletionProtection")]
        public Input<bool>? DeletionProtection { get; set; }

        /// <summary>
        /// Database type.
        /// </summary>
        [Input("engine")]
        public Input<string>? Engine { get; set; }

        /// <summary>
        /// Database version. Value options can refer to the latest docs [CreateDBInstance](https://www.alibabacloud.com/help/doc-detail/26228.htm) `EngineVersion`.
        /// </summary>
        [Input("engineVersion")]
        public Input<string>? EngineVersion { get; set; }

        /// <summary>
        /// Set it to true to make some parameter efficient when modifying them. Default to false.
        /// </summary>
        [Input("forceRestart")]
        public Input<bool>? ForceRestart { get; set; }

        /// <summary>
        /// Valid values are `Prepaid`, `Postpaid`, Default to `Postpaid`. The interval between the two conversion operations must be greater than 15 minutes. Only when this parameter is `Postpaid`, the instance can be released.
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        /// <summary>
        /// The name of DB instance. It a string of 2 to 256 characters.
        /// </summary>
        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// User-defined DB instance storage space. Value range: [5, 2000] for MySQL/SQL Server HA dual node edition. Increase progressively at a rate of 5 GB. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Input("instanceStorage")]
        public Input<int>? InstanceStorage { get; set; }

        /// <summary>
        /// DB Instance type. For details, see [Instance type table](https://www.alibabacloud.com/help/doc-detail/26312.htm).
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// ID of the master instance.
        /// </summary>
        [Input("masterDbInstanceId")]
        public Input<string>? MasterDbInstanceId { get; set; }

        /// <summary>
        /// The method that is used to modify the IP address whitelist. Default value: Cover. Valid values:
        /// - Cover: Use the value of the SecurityIps parameter to overwrite the existing entries in the IP address whitelist.
        /// - Append: Add the IP addresses and CIDR blocks that are specified in the SecurityIps parameter to the IP address whitelist.
        /// - Delete: Delete IP addresses and CIDR blocks that are specified in the SecurityIps parameter from the IP address whitelist. You must retain at least one IP address or CIDR block.
        /// </summary>
        [Input("modifyMode")]
        public Input<string>? ModifyMode { get; set; }

        [Input("parameters")]
        private InputList<Inputs.ReadOnlyInstanceParameterGetArgs>? _parameters;

        /// <summary>
        /// Set of parameters needs to be set after DB instance was launched. Available parameters can refer to the latest docs [View database parameter templates](https://www.alibabacloud.com/help/doc-detail/26284.htm).
        /// </summary>
        public InputList<Inputs.ReadOnlyInstanceParameterGetArgs> Parameters
        {
            get => _parameters ?? (_parameters = new InputList<Inputs.ReadOnlyInstanceParameterGetArgs>());
            set => _parameters = value;
        }

        /// <summary>
        /// The duration that you will buy DB instance (in month). It is valid when instance_charge_type is `PrePaid`. Valid values: [1~9], 12, 24, 36.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// RDS database connection port.
        /// </summary>
        [Input("port")]
        public Input<string>? Port { get; set; }

        /// <summary>
        /// The method that is used to verify the replication permission. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. In addition, this parameter is available only when the public key of the CA that issues client certificates is enabled. It is valid only when `ssl_enabled  = 1`. Valid values:
        /// - cert
        /// - perfer
        /// - verify-ca
        /// - verify-full (supported only when the instance runs PostgreSQL 12 or later)
        /// &gt; **NOTE:** Because of data backup and migration, change DB instance type and storage would cost 15~20 minutes. Please make full preparation before changing them.
        /// </summary>
        [Input("replicationAcl")]
        public Input<string>? ReplicationAcl { get; set; }

        /// <summary>
        /// The ID of resource group which the DB read-only instance belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The type of IP address in the IP address whitelist.
        /// </summary>
        [Input("securityIpType")]
        public Input<string>? SecurityIpType { get; set; }

        [Input("securityIps")]
        private InputList<string>? _securityIps;

        /// <summary>
        /// List of IP addresses allowed to access all databases of an instance. The list contains up to 1,000 IP addresses, separated by commas. Supported formats include 0.0.0.0/0, 10.23.12.24 (IP), and 10.23.12.24/24 (Classless Inter-Domain Routing (CIDR) mode. /24 represents the length of the prefix in an IP address. The range of the prefix length is [1,32]).
        /// </summary>
        public InputList<string> SecurityIps
        {
            get => _securityIps ?? (_securityIps = new InputList<string>());
            set => _securityIps = value;
        }

        /// <summary>
        /// The content of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("serverCert")]
        public Input<string>? ServerCert { get; set; }

        /// <summary>
        /// The private key of the server certificate. This parameter is supported only when the instance runs PostgreSQL with standard or enhanced SSDs. If you set the CAType parameter to custom, you must also specify this parameter. It is valid only when `ssl_enabled  = 1`.
        /// </summary>
        [Input("serverKey")]
        public Input<string>? ServerKey { get; set; }

        /// <summary>
        /// Specifies whether to enable or disable SSL encryption. Valid values:
        /// - 1: enables SSL encryption
        /// - 0: disables SSL encryption
        /// </summary>
        [Input("sslEnabled")]
        public Input<int>? SslEnabled { get; set; }

        /// <summary>
        /// The specific point in time when you want to perform the update. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. It is valid only when `upgrade_db_instance_kernel_version = true`. The time must be in UTC.
        /// </summary>
        [Input("switchTime")]
        public Input<string>? SwitchTime { get; set; }

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

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// - Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.
        /// - Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        /// <summary>
        /// The minor engine version to which you want to update the instance. If you do not specify this parameter, the instance is updated to the latest minor engine version. It is valid only when `upgrade_db_instance_kernel_version = true`. You must specify the minor engine version in one of the following formats:
        /// - PostgreSQL: rds_postgres_&lt;Major engine version&gt;00_&lt;Minor engine version&gt;. Example: rds_postgres_1200_20200830.
        /// - MySQL: &lt;RDS edition&gt;_&lt;Minor engine version&gt;. Examples: rds_20200229, xcluster_20200229, and xcluster80_20200229. The following RDS editions are supported:
        /// - rds: The instance runs RDS Basic or High-availability Edition.
        /// - xcluster: The instance runs MySQL 5.7 on RDS Enterprise Edition.
        /// - xcluster80: The instance runs MySQL 8.0 on RDS Enterprise Edition.
        /// - SQLServer: &lt;Minor engine version&gt;. Example: 15.0.4073.23.
        /// </summary>
        [Input("targetMinorVersion")]
        public Input<string>? TargetMinorVersion { get; set; }

        /// <summary>
        /// Whether to upgrade a minor version of the kernel. Valid values:
        /// - true: upgrade
        /// - false: not to upgrade
        /// </summary>
        [Input("upgradeDbInstanceKernelVersion")]
        public Input<bool>? UpgradeDbInstanceKernelVersion { get; set; }

        /// <summary>
        /// The method to update the minor engine version. Default value: Immediate. It is valid only when `upgrade_db_instance_kernel_version = true`. Valid values:
        /// - Immediate: The minor engine version is immediately updated.
        /// - MaintainTime: The minor engine version is updated during the maintenance window. For more information about how to change the maintenance window, see ModifyDBInstanceMaintainTime.
        /// - SpecifyTime: The minor engine version is updated at the point in time you specify.
        /// </summary>
        [Input("upgradeTime")]
        public Input<string>? UpgradeTime { get; set; }

        /// <summary>
        /// The virtual switch ID to launch DB instances in one VPC.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// The network type of the IP address whitelist. Default value: MIX. Valid values:
        /// - Classic: classic network in enhanced whitelist mode
        /// - VPC: virtual private cloud (VPC) in enhanced whitelist mode
        /// - MIX: standard whitelist mode
        /// &gt; **NOTE:** In standard whitelist mode, IP addresses and CIDR blocks can be added only to the default IP address whitelist. In enhanced whitelist mode, IP addresses and CIDR blocks can be added to both IP address whitelists of the classic network type and those of the VPC network type.
        /// </summary>
        [Input("whitelistNetworkType")]
        public Input<string>? WhitelistNetworkType { get; set; }

        /// <summary>
        /// The Zone to launch the DB instance.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

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