<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks<gh_stars>0// *** 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 a RDS Upgrade DB Instance resource.
    /// 
    /// For information about RDS Upgrade DB Instance and how to use it, see [What is ApsaraDB for RDS](https://www.alibabacloud.com/help/en/doc-detail/26092.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.153.0+.
    /// 
    /// ## Example Usage
    /// ### Create a RDS MySQL upgrade instance
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "tf-testaccdbinstance";
    ///     var creation = config.Get("creation") ?? "Rds";
    ///     var exampleZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = creation,
    ///     });
    /// 
    ///     var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
    ///     {
    ///         CidrBlock = "172.16.0.0/16",
    ///     });
    /// 
    ///     var exampleSwitch = new AliCloud.Vpc.Switch("exampleSwitch", new()
    ///     {
    ///         VpcId = exampleNetwork.Id,
    ///         CidrBlock = "172.16.0.0/24",
    ///         ZoneId = exampleZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///     });
    /// 
    ///     var exampleInstance = new AliCloud.Rds.Instance("exampleInstance", new()
    ///     {
    ///         Engine = "PostgreSQL",
    ///         EngineVersion = "12.0",
    ///         InstanceType = "pg.n2.small.2c",
    ///         InstanceStorage = 20,
    ///         InstanceChargeType = "Postpaid",
    ///         InstanceName = name,
    ///         VswitchId = exampleSwitch.Id,
    ///     });
    /// 
    ///     var exampleRdsUpgradeDbInstance = new AliCloud.Rds.RdsUpgradeDbInstance("exampleRdsUpgradeDbInstance", new()
    ///     {
    ///         SourceDbInstanceId = exampleInstance.Id,
    ///         TargetMajorVersion = "13.0",
    ///         DbInstanceClass = "pg.n2.small.2c",
    ///         DbInstanceStorage = 20,
    ///         InstanceNetworkType = "VPC",
    ///         DbInstanceStorageType = "cloud_ssd",
    ///         CollectStatMode = "After",
    ///         SwitchOver = "false",
    ///         PaymentType = "PayAsYouGo",
    ///         DbInstanceDescription = name,
    ///         VswitchId = exampleSwitch.Id,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// RDS Upgrade DB Instance can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:rds/rdsUpgradeDbInstance:RdsUpgradeDbInstance example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:rds/rdsUpgradeDbInstance:RdsUpgradeDbInstance")]
    public partial class RdsUpgradeDbInstance : global::Pulumi.CustomResource
    {
        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. This parameter indicates the authentication method. It is allowed only when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Output("acl")]
        public Output<string> Acl { get; private set; } = null!;

        /// <summary>
        /// How to upgrade the minor version of the instance. Valid values:
        /// * **Auto**: automatically upgrade the minor version.
        /// * **Manual**: It is not automatically upgraded. It is only mandatory when the current version is offline.
        /// </summary>
        [Output("autoUpgradeMinorVersion")]
        public Output<string> AutoUpgradeMinorVersion { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the certificate type. When the value of ssl_action is Open, the default value of this parameter is aliyun. Value range:
        /// * **aliyun**: using cloud certificates.
        /// * **custom**: use a custom certificate. Valid values: `aliyun`, `custom`.
        /// </summary>
        [Output("caType")]
        public Output<string> CaType { get; private set; } = null!;

        /// <summary>
        /// The file that contains the certificate used for TDE.
        /// </summary>
        [Output("certificate")]
        public Output<string?> Certificate { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the public key of the client certification authority. If the value of client_ca_enabled is 1, this parameter must be configured.
        /// </summary>
        [Output("clientCaCert")]
        public Output<string?> ClientCaCert { get; private set; } = null!;

        /// <summary>
        /// The client ca enabled.
        /// </summary>
        [Output("clientCaEnabled")]
        public Output<int?> ClientCaEnabled { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, which indicates that the client revokes the certificate file. If the value of client_crl_enabled is 1, this parameter must be configured.
        /// </summary>
        [Output("clientCertRevocationList")]
        public Output<string?> ClientCertRevocationList { get; private set; } = null!;

        /// <summary>
        /// The client crl enabled.
        /// </summary>
        [Output("clientCrlEnabled")]
        public Output<int?> ClientCrlEnabled { get; private set; } = null!;

        /// <summary>
        /// The time at which ApsaraDB RDS collects the statistics of the new instance.
        /// * **Before**: ApsaraDB RDS collects the statistics of the new instance before the switchover to ensure service stability. If the original instance contains a large amount of data, the upgrade may require a long period of time.
        /// * **After**: ApsaraDB RDS collects the statistics of the new instance after the switchover to accelerate the upgrade. If you access tables for which no statistics are generated, the query plans that you specify may be inaccurately executed. In addition, your database service may be unavailable during peak hours.
        /// </summary>
        [Output("collectStatMode")]
        public Output<string> CollectStatMode { get; private set; } = null!;

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

        /// <summary>
        /// The connection string prefix.
        /// </summary>
        [Output("connectionStringPrefix")]
        public Output<string?> ConnectionStringPrefix { get; private set; } = null!;

        /// <summary>
        /// The instance type of the new instance. For information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Output("dbInstanceClass")]
        public Output<string> DbInstanceClass { get; private set; } = null!;

        /// <summary>
        /// The db instance description.
        /// </summary>
        [Output("dbInstanceDescription")]
        public Output<string> DbInstanceDescription { get; private set; } = null!;

        /// <summary>
        /// The storage capacity of the new instance. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Output("dbInstanceStorage")]
        public Output<int> DbInstanceStorage { get; private set; } = null!;

        /// <summary>
        /// The type of storage media that is used for the new instance. Valid values:
        /// * **local_ssd**: local SSDs.
        /// * **cloud_ssd**: standard SSDs.
        /// * **cloud_essd**: enhanced SSDs (ESSDs) of performance level 1 (PL1).
        /// * **cloud_essd2**: ESSDs of PL2.
        /// * **cloud_essd3**: ESSDs of PL3.
        /// </summary>
        [Output("dbInstanceStorageType")]
        public Output<string> DbInstanceStorageType { get; private set; } = null!;

        /// <summary>
        /// The name of the database for which you want to enable TDE. Up to 50 names can be entered in a single request. If you specify multiple names, separate these names with commas (,).
        /// </summary>
        [Output("dbName")]
        public Output<string?> DbName { get; private set; } = null!;

        /// <summary>
        /// The ID of the dedicated cluster to which the new instance belongs. This parameter takes effect only when you create the new instance in a dedicated cluster.
        /// </summary>
        [Output("dedicatedHostGroupId")]
        public Output<string?> DedicatedHostGroupId { 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>
        /// The direction. Valid values: `Auto`, `Down`, `TempUpgrade`, `Up`.
        /// </summary>
        [Output("direction")]
        public Output<string?> Direction { get; private set; } = null!;

        /// <summary>
        /// The effective time.
        /// </summary>
        [Output("effectiveTime")]
        public Output<string?> EffectiveTime { get; private set; } = null!;

        /// <summary>
        /// The ID of the private key.
        /// </summary>
        [Output("encryptionKey")]
        public Output<string?> EncryptionKey { get; private set; } = null!;

        /// <summary>
        /// Database type. Value options: MySQL, SQLServer, PostgreSQL.
        /// </summary>
        [Output("engine")]
        public Output<string> Engine { get; private set; } = null!;

        /// <summary>
        /// Database version. Value:
        /// * MySQL: **5.5/5.6/5.7/8.0**.
        /// * SQL Server: **2008r2/08r2_ent_ha/2012/2012_ent_ha/2012_std_ha/2012_web/2014_std_ha/2016_ent_ha/2016_std_ha/2016_web/2017_std_ha/2017_ent/2019_std_ha/2019_ent**.
        /// * PostgreSQL: **9.4/10.0/11.0/12.0/13.0**.
        /// * MariaDB: **10.3**.
        /// </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>
        /// The high availability mode. Valid values:
        /// * **RPO**: Data persistence is preferred. The instance preferentially ensures data reliability to minimize data loss. Use this mode if you have higher requirements on data consistency.
        /// * **RTO**: Instance availability is preferred. The instance restores services as soon as possible to ensure availability. Use this mode if you have higher requirements on service availability.
        /// </summary>
        [Output("haMode")]
        public Output<string> HaMode { get; private set; } = null!;

        /// <summary>
        /// The network type of the instance. Valid values:
        /// * **Classic**: Classic Network.
        /// * **VPC**: VPC.
        /// </summary>
        [Output("instanceNetworkType")]
        public Output<string> InstanceNetworkType { get; private set; } = null!;

        /// <summary>
        /// The maintainable time period of the instance. Format: &lt;I&gt; HH:mm&lt;/I&gt; Z-&lt;I&gt; HH:mm&lt;/I&gt; Z(UTC time).
        /// </summary>
        [Output("maintainTime")]
        public Output<string> MaintainTime { 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.RdsUpgradeDbInstanceParameter>> Parameters { get; private set; } = null!;

        /// <summary>
        /// The password of the certificate.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        /// <summary>
        /// The billing method of the new instance. Valid values: `PayAsYouGo` and `Subscription`.
        /// </summary>
        [Output("paymentType")]
        public Output<string> PaymentType { get; private set; } = null!;

        /// <summary>
        /// The configuration of [AD domain](https://www.alibabacloud.com/help/en/doc-detail/349288.htm) (documented below).
        /// </summary>
        [Output("pgHbaConfs")]
        public Output<ImmutableArray<Outputs.RdsUpgradeDbInstancePgHbaConf>> PgHbaConfs { get; private set; } = null!;

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

        /// <summary>
        /// The intranet IP address of the new instance must be within the specified vSwitch IP address range. By default, the system automatically allocates by using **VPCId** and **VSwitchId**.
        /// </summary>
        [Output("privateIpAddress")]
        public Output<string> PrivateIpAddress { get; private set; } = null!;

        /// <summary>
        /// The file that contains the private key used for TDE.
        /// </summary>
        [Output("privateKey")]
        public Output<string?> PrivateKey { get; private set; } = null!;

        /// <summary>
        /// The released keep policy.
        /// </summary>
        [Output("releasedKeepPolicy")]
        public Output<string?> ReleasedKeepPolicy { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, indicating the authentication method of the replication permission. It is only allowed when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Output("replicationAcl")]
        public Output<string> ReplicationAcl { get; private set; } = null!;

        /// <summary>
        /// The resource group id.
        /// </summary>
        [Output("resourceGroupId")]
        public Output<string?> ResourceGroupId { get; private set; } = null!;

        /// <summary>
        /// The Alibaba Cloud Resource Name (ARN) of a RAM role. A RAM role is a virtual RAM identity that you can create within your Alibaba Cloud account. For more information, see [RAM role overview](https://www.alibabacloud.com/doc-detail/93689.htm).
        /// </summary>
        [Output("roleArn")]
        public Output<string?> RoleArn { get; private set; } = null!;

        /// <summary>
        /// The IP address whitelist of the instance. Separate multiple IP addresses with commas (,) and cannot be repeated. The following two formats are supported:
        /// * IP address form, for example: 10.23.12.24.
        /// * CIDR format, for example, 10.23.12.0/24 (no Inter-Domain Routing, 24 indicates the length of the prefix in the address, ranging from 1 to 32).
        /// </summary>
        [Output("securityIps")]
        public Output<ImmutableArray<string>> SecurityIps { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the content of the server certificate. If the CAType value is custom, this parameter must be configured.
        /// </summary>
        [Output("serverCert")]
        public Output<string> ServerCert { get; private set; } = null!;

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the private key of the server certificate. If the value of CAType is custom, this parameter must be configured.
        /// </summary>
        [Output("serverKey")]
        public Output<string> ServerKey { get; private set; } = null!;

        /// <summary>
        /// The source biz.
        /// </summary>
        [Output("sourceBiz")]
        public Output<string?> SourceBiz { get; private set; } = null!;

        /// <summary>
        /// The source db instance id.
        /// </summary>
        [Output("sourceDbInstanceId")]
        public Output<string> SourceDbInstanceId { get; private set; } = null!;

        /// <summary>
        /// Enable or disable SSL. Valid values: `0` and `1`.
        /// </summary>
        [Output("sslEnabled")]
        public Output<int> SslEnabled { get; private set; } = null!;

        /// <summary>
        /// Specifies whether ApsaraDB RDS automatically switches your workloads over to the new instance after data is migrated to the new instance. Valid values:
        /// * **true**: ApsaraDB RDS automatically switches workloads over to the new instance. If you set this parameter to true, you must take note of the following information:
        /// * After the switchover is complete, you cannot roll your workloads back to the original instance. Proceed with caution.
        /// * During the switchover, the original instance processes only read requests. You must perform the switchover during off-peak hours.
        /// * If read-only instances are attached to the original instance, you can set this parameter only to false. In this case, the read-only instances that are attached to the original instance cannot be cloned. After the upgrade is complete, you must create read-only instances for the new instance.
        /// * **false**: ApsaraDB RDS does not automatically switch your workloads over to the new instance. Before you perform an upgrade, we recommend that you set this parameter to false to test whether the new major engine version is compatible with your workloads. If you set this parameter to false, you must take note of the following information:
        /// * The data migration does not interrupt your workloads on the original instance.
        /// * After data is migrated to the new instance, you must update the endpoint configuration on your application. This update requires you to replace the endpoint of the original instance with the endpoint of the new instance. For more information about how to view the endpoint of an instance, see [View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance](https://www.alibabacloud.com/help/doc-detail/96788.htm).
        /// </summary>
        [Output("switchOver")]
        public Output<string> SwitchOver { get; private set; } = null!;

        /// <summary>
        /// The time at which you want to apply the specification changes. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
        /// </summary>
        [Output("switchTime")]
        public Output<string?> SwitchTime { get; private set; } = null!;

        /// <summary>
        /// The time at which ApsaraDB RDS switches your workloads over to the new instance. This parameter is used together with the SwitchOver parameter and takes effect only when you set the SwitchOver parameter to true. Valid values:
        /// * **Immediate**: After data is migrated to the new instance, ApsaraDB RDS immediately switches your workloads over to the new instance.
        /// * **MaintainTime**: After data is migrated to the new instance, ApsaraDB RDS switches your workloads over to the new instance during the maintenance window that you specify. You can call the [ModifyDBInstanceMaintainTime](https://www.alibabacloud.com/help/doc-detail/26249.htm) operation to change the maintenance window of an instance.
        /// </summary>
        [Output("switchTimeMode")]
        public Output<string?> SwitchTimeMode { get; private set; } = null!;

        /// <summary>
        /// [The data replication mode](https://www.alibabacloud.com/help/doc-detail/96055.htm). Valid values:
        /// * **Sync**: strong synchronization.
        /// * **Semi-sync**: Semi-synchronous.
        /// * **Async**: asynchronous.
        /// </summary>
        [Output("syncMode")]
        public Output<string> SyncMode { get; private set; } = null!;

        /// <summary>
        /// The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed.
        /// </summary>
        [Output("targetMajorVersion")]
        public Output<string> TargetMajorVersion { get; private set; } = null!;

        /// <summary>
        /// The availability check method of the instance. Valid values:
        /// - **SHORT**: Alibaba Cloud uses short-lived connections to check the availability of the instance.
        /// - **LONG**: Alibaba Cloud uses persistent connections to check the availability of the instance.
        /// </summary>
        [Output("tcpConnectionType")]
        public Output<string> TcpConnectionType { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable TDE. Valid values: `Enabled` and `Disabled`.
        /// </summary>
        [Output("tdeStatus")]
        public Output<string?> TdeStatus { get; private set; } = null!;

        /// <summary>
        /// The ID of the VPC to which the new instance belongs.
        /// </summary>
        [Output("vpcId")]
        public Output<string> VpcId { get; private set; } = null!;

        /// <summary>
        /// The ID of the vSwitch associated with the specified VPC.
        /// </summary>
        [Output("vswitchId")]
        public Output<string> VswitchId { get; private set; } = null!;

        /// <summary>
        /// The ID of the zone to which the new instance belongs. You can call the [DescribeRegions](https://www.alibabacloud.com/doc-detail/26243.htm) operation to query the most recent region list.
        /// </summary>
        [Output("zoneId")]
        public Output<string> ZoneId { get; private set; } = null!;

        /// <summary>
        /// The ID of the zone to which the secondary instance of the new instance belongs. You can specify this parameter only when the original instance runs RDS High-availability Edition. You can select a zone that belongs to the region where the original instance resides. You can call the [DescribeRegions](https://www.alibabacloud.com/help/doc-detail/26243.htm) operation to query zone IDs.
        /// </summary>
        [Output("zoneIdSlave1")]
        public Output<string> ZoneIdSlave1 { get; private set; } = null!;


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

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

    public sealed class RdsUpgradeDbInstanceArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. This parameter indicates the authentication method. It is allowed only when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Input("acl")]
        public Input<string>? Acl { get; set; }

        /// <summary>
        /// How to upgrade the minor version of the instance. Valid values:
        /// * **Auto**: automatically upgrade the minor version.
        /// * **Manual**: It is not automatically upgraded. It is only mandatory when the current version is offline.
        /// </summary>
        [Input("autoUpgradeMinorVersion")]
        public Input<string>? AutoUpgradeMinorVersion { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the certificate type. When the value of ssl_action is Open, the default value of this parameter is aliyun. Value range:
        /// * **aliyun**: using cloud certificates.
        /// * **custom**: use a custom certificate. Valid values: `aliyun`, `custom`.
        /// </summary>
        [Input("caType")]
        public Input<string>? CaType { get; set; }

        /// <summary>
        /// The file that contains the certificate used for TDE.
        /// </summary>
        [Input("certificate")]
        public Input<string>? Certificate { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the public key of the client certification authority. If the value of client_ca_enabled is 1, this parameter must be configured.
        /// </summary>
        [Input("clientCaCert")]
        public Input<string>? ClientCaCert { get; set; }

        /// <summary>
        /// The client ca enabled.
        /// </summary>
        [Input("clientCaEnabled")]
        public Input<int>? ClientCaEnabled { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, which indicates that the client revokes the certificate file. If the value of client_crl_enabled is 1, this parameter must be configured.
        /// </summary>
        [Input("clientCertRevocationList")]
        public Input<string>? ClientCertRevocationList { get; set; }

        /// <summary>
        /// The client crl enabled.
        /// </summary>
        [Input("clientCrlEnabled")]
        public Input<int>? ClientCrlEnabled { get; set; }

        /// <summary>
        /// The time at which ApsaraDB RDS collects the statistics of the new instance.
        /// * **Before**: ApsaraDB RDS collects the statistics of the new instance before the switchover to ensure service stability. If the original instance contains a large amount of data, the upgrade may require a long period of time.
        /// * **After**: ApsaraDB RDS collects the statistics of the new instance after the switchover to accelerate the upgrade. If you access tables for which no statistics are generated, the query plans that you specify may be inaccurately executed. In addition, your database service may be unavailable during peak hours.
        /// </summary>
        [Input("collectStatMode", required: true)]
        public Input<string> CollectStatMode { get; set; } = null!;

        /// <summary>
        /// The connection string prefix.
        /// </summary>
        [Input("connectionStringPrefix")]
        public Input<string>? ConnectionStringPrefix { get; set; }

        /// <summary>
        /// The instance type of the new instance. For information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Input("dbInstanceClass", required: true)]
        public Input<string> DbInstanceClass { get; set; } = null!;

        /// <summary>
        /// The db instance description.
        /// </summary>
        [Input("dbInstanceDescription")]
        public Input<string>? DbInstanceDescription { get; set; }

        /// <summary>
        /// The storage capacity of the new instance. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Input("dbInstanceStorage", required: true)]
        public Input<int> DbInstanceStorage { get; set; } = null!;

        /// <summary>
        /// The type of storage media that is used for the new instance. Valid values:
        /// * **local_ssd**: local SSDs.
        /// * **cloud_ssd**: standard SSDs.
        /// * **cloud_essd**: enhanced SSDs (ESSDs) of performance level 1 (PL1).
        /// * **cloud_essd2**: ESSDs of PL2.
        /// * **cloud_essd3**: ESSDs of PL3.
        /// </summary>
        [Input("dbInstanceStorageType", required: true)]
        public Input<string> DbInstanceStorageType { get; set; } = null!;

        /// <summary>
        /// The name of the database for which you want to enable TDE. Up to 50 names can be entered in a single request. If you specify multiple names, separate these names with commas (,).
        /// </summary>
        [Input("dbName")]
        public Input<string>? DbName { get; set; }

        /// <summary>
        /// The ID of the dedicated cluster to which the new instance belongs. This parameter takes effect only when you create the new instance in a dedicated cluster.
        /// </summary>
        [Input("dedicatedHostGroupId")]
        public Input<string>? DedicatedHostGroupId { 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>
        /// The direction. Valid values: `Auto`, `Down`, `TempUpgrade`, `Up`.
        /// </summary>
        [Input("direction")]
        public Input<string>? Direction { get; set; }

        /// <summary>
        /// The effective time.
        /// </summary>
        [Input("effectiveTime")]
        public Input<string>? EffectiveTime { get; set; }

        /// <summary>
        /// The ID of the private key.
        /// </summary>
        [Input("encryptionKey")]
        public Input<string>? EncryptionKey { get; set; }

        /// <summary>
        /// Database type. Value options: MySQL, SQLServer, PostgreSQL.
        /// </summary>
        [Input("engine")]
        public Input<string>? Engine { get; set; }

        /// <summary>
        /// Database version. Value:
        /// * MySQL: **5.5/5.6/5.7/8.0**.
        /// * SQL Server: **2008r2/08r2_ent_ha/2012/2012_ent_ha/2012_std_ha/2012_web/2014_std_ha/2016_ent_ha/2016_std_ha/2016_web/2017_std_ha/2017_ent/2019_std_ha/2019_ent**.
        /// * PostgreSQL: **9.4/10.0/11.0/12.0/13.0**.
        /// * MariaDB: **10.3**.
        /// </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>
        /// The high availability mode. Valid values:
        /// * **RPO**: Data persistence is preferred. The instance preferentially ensures data reliability to minimize data loss. Use this mode if you have higher requirements on data consistency.
        /// * **RTO**: Instance availability is preferred. The instance restores services as soon as possible to ensure availability. Use this mode if you have higher requirements on service availability.
        /// </summary>
        [Input("haMode")]
        public Input<string>? HaMode { get; set; }

        /// <summary>
        /// The network type of the instance. Valid values:
        /// * **Classic**: Classic Network.
        /// * **VPC**: VPC.
        /// </summary>
        [Input("instanceNetworkType", required: true)]
        public Input<string> InstanceNetworkType { get; set; } = null!;

        /// <summary>
        /// The maintainable time period of the instance. Format: &lt;I&gt; HH:mm&lt;/I&gt; Z-&lt;I&gt; HH:mm&lt;/I&gt; Z(UTC time).
        /// </summary>
        [Input("maintainTime")]
        public Input<string>? MaintainTime { get; set; }

        [Input("parameters")]
        private InputList<Inputs.RdsUpgradeDbInstanceParameterArgs>? _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.RdsUpgradeDbInstanceParameterArgs> Parameters
        {
            get => _parameters ?? (_parameters = new InputList<Inputs.RdsUpgradeDbInstanceParameterArgs>());
            set => _parameters = value;
        }

        /// <summary>
        /// The password of the certificate.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The billing method of the new instance. Valid values: `PayAsYouGo` and `Subscription`.
        /// </summary>
        [Input("paymentType", required: true)]
        public Input<string> PaymentType { get; set; } = null!;

        [Input("pgHbaConfs")]
        private InputList<Inputs.RdsUpgradeDbInstancePgHbaConfArgs>? _pgHbaConfs;

        /// <summary>
        /// The configuration of [AD domain](https://www.alibabacloud.com/help/en/doc-detail/349288.htm) (documented below).
        /// </summary>
        public InputList<Inputs.RdsUpgradeDbInstancePgHbaConfArgs> PgHbaConfs
        {
            get => _pgHbaConfs ?? (_pgHbaConfs = new InputList<Inputs.RdsUpgradeDbInstancePgHbaConfArgs>());
            set => _pgHbaConfs = value;
        }

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

        /// <summary>
        /// The intranet IP address of the new instance must be within the specified vSwitch IP address range. By default, the system automatically allocates by using **VPCId** and **VSwitchId**.
        /// </summary>
        [Input("privateIpAddress")]
        public Input<string>? PrivateIpAddress { get; set; }

        /// <summary>
        /// The file that contains the private key used for TDE.
        /// </summary>
        [Input("privateKey")]
        public Input<string>? PrivateKey { get; set; }

        /// <summary>
        /// The released keep policy.
        /// </summary>
        [Input("releasedKeepPolicy")]
        public Input<string>? ReleasedKeepPolicy { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, indicating the authentication method of the replication permission. It is only allowed when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Input("replicationAcl")]
        public Input<string>? ReplicationAcl { get; set; }

        /// <summary>
        /// The resource group id.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The Alibaba Cloud Resource Name (ARN) of a RAM role. A RAM role is a virtual RAM identity that you can create within your Alibaba Cloud account. For more information, see [RAM role overview](https://www.alibabacloud.com/doc-detail/93689.htm).
        /// </summary>
        [Input("roleArn")]
        public Input<string>? RoleArn { get; set; }

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

        /// <summary>
        /// The IP address whitelist of the instance. Separate multiple IP addresses with commas (,) and cannot be repeated. The following two formats are supported:
        /// * IP address form, for example: 10.23.12.24.
        /// * CIDR format, for example, 10.23.12.0/24 (no Inter-Domain Routing, 24 indicates the length of the prefix in the address, ranging from 1 to 32).
        /// </summary>
        public InputList<string> SecurityIps
        {
            get => _securityIps ?? (_securityIps = new InputList<string>());
            set => _securityIps = value;
        }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the content of the server certificate. If the CAType value is custom, this parameter must be configured.
        /// </summary>
        [Input("serverCert")]
        public Input<string>? ServerCert { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the private key of the server certificate. If the value of CAType is custom, this parameter must be configured.
        /// </summary>
        [Input("serverKey")]
        public Input<string>? ServerKey { get; set; }

        /// <summary>
        /// The source biz.
        /// </summary>
        [Input("sourceBiz")]
        public Input<string>? SourceBiz { get; set; }

        /// <summary>
        /// The source db instance id.
        /// </summary>
        [Input("sourceDbInstanceId", required: true)]
        public Input<string> SourceDbInstanceId { get; set; } = null!;

        /// <summary>
        /// Enable or disable SSL. Valid values: `0` and `1`.
        /// </summary>
        [Input("sslEnabled")]
        public Input<int>? SslEnabled { get; set; }

        /// <summary>
        /// Specifies whether ApsaraDB RDS automatically switches your workloads over to the new instance after data is migrated to the new instance. Valid values:
        /// * **true**: ApsaraDB RDS automatically switches workloads over to the new instance. If you set this parameter to true, you must take note of the following information:
        /// * After the switchover is complete, you cannot roll your workloads back to the original instance. Proceed with caution.
        /// * During the switchover, the original instance processes only read requests. You must perform the switchover during off-peak hours.
        /// * If read-only instances are attached to the original instance, you can set this parameter only to false. In this case, the read-only instances that are attached to the original instance cannot be cloned. After the upgrade is complete, you must create read-only instances for the new instance.
        /// * **false**: ApsaraDB RDS does not automatically switch your workloads over to the new instance. Before you perform an upgrade, we recommend that you set this parameter to false to test whether the new major engine version is compatible with your workloads. If you set this parameter to false, you must take note of the following information:
        /// * The data migration does not interrupt your workloads on the original instance.
        /// * After data is migrated to the new instance, you must update the endpoint configuration on your application. This update requires you to replace the endpoint of the original instance with the endpoint of the new instance. For more information about how to view the endpoint of an instance, see [View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance](https://www.alibabacloud.com/help/doc-detail/96788.htm).
        /// </summary>
        [Input("switchOver", required: true)]
        public Input<string> SwitchOver { get; set; } = null!;

        /// <summary>
        /// The time at which you want to apply the specification changes. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
        /// </summary>
        [Input("switchTime")]
        public Input<string>? SwitchTime { get; set; }

        /// <summary>
        /// The time at which ApsaraDB RDS switches your workloads over to the new instance. This parameter is used together with the SwitchOver parameter and takes effect only when you set the SwitchOver parameter to true. Valid values:
        /// * **Immediate**: After data is migrated to the new instance, ApsaraDB RDS immediately switches your workloads over to the new instance.
        /// * **MaintainTime**: After data is migrated to the new instance, ApsaraDB RDS switches your workloads over to the new instance during the maintenance window that you specify. You can call the [ModifyDBInstanceMaintainTime](https://www.alibabacloud.com/help/doc-detail/26249.htm) operation to change the maintenance window of an instance.
        /// </summary>
        [Input("switchTimeMode")]
        public Input<string>? SwitchTimeMode { get; set; }

        /// <summary>
        /// [The data replication mode](https://www.alibabacloud.com/help/doc-detail/96055.htm). Valid values:
        /// * **Sync**: strong synchronization.
        /// * **Semi-sync**: Semi-synchronous.
        /// * **Async**: asynchronous.
        /// </summary>
        [Input("syncMode")]
        public Input<string>? SyncMode { get; set; }

        /// <summary>
        /// The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed.
        /// </summary>
        [Input("targetMajorVersion", required: true)]
        public Input<string> TargetMajorVersion { get; set; } = null!;

        /// <summary>
        /// The availability check method of the instance. Valid values:
        /// - **SHORT**: Alibaba Cloud uses short-lived connections to check the availability of the instance.
        /// - **LONG**: Alibaba Cloud uses persistent connections to check the availability of the instance.
        /// </summary>
        [Input("tcpConnectionType")]
        public Input<string>? TcpConnectionType { get; set; }

        /// <summary>
        /// Specifies whether to enable TDE. Valid values: `Enabled` and `Disabled`.
        /// </summary>
        [Input("tdeStatus")]
        public Input<string>? TdeStatus { get; set; }

        /// <summary>
        /// The ID of the VPC to which the new instance belongs.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// The ID of the vSwitch associated with the specified VPC.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// The ID of the zone to which the new instance belongs. You can call the [DescribeRegions](https://www.alibabacloud.com/doc-detail/26243.htm) operation to query the most recent region list.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        /// <summary>
        /// The ID of the zone to which the secondary instance of the new instance belongs. You can specify this parameter only when the original instance runs RDS High-availability Edition. You can select a zone that belongs to the region where the original instance resides. You can call the [DescribeRegions](https://www.alibabacloud.com/help/doc-detail/26243.htm) operation to query zone IDs.
        /// </summary>
        [Input("zoneIdSlave1")]
        public Input<string>? ZoneIdSlave1 { get; set; }

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

    public sealed class RdsUpgradeDbInstanceState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. This parameter indicates the authentication method. It is allowed only when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Input("acl")]
        public Input<string>? Acl { get; set; }

        /// <summary>
        /// How to upgrade the minor version of the instance. Valid values:
        /// * **Auto**: automatically upgrade the minor version.
        /// * **Manual**: It is not automatically upgraded. It is only mandatory when the current version is offline.
        /// </summary>
        [Input("autoUpgradeMinorVersion")]
        public Input<string>? AutoUpgradeMinorVersion { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the certificate type. When the value of ssl_action is Open, the default value of this parameter is aliyun. Value range:
        /// * **aliyun**: using cloud certificates.
        /// * **custom**: use a custom certificate. Valid values: `aliyun`, `custom`.
        /// </summary>
        [Input("caType")]
        public Input<string>? CaType { get; set; }

        /// <summary>
        /// The file that contains the certificate used for TDE.
        /// </summary>
        [Input("certificate")]
        public Input<string>? Certificate { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the public key of the client certification authority. If the value of client_ca_enabled is 1, this parameter must be configured.
        /// </summary>
        [Input("clientCaCert")]
        public Input<string>? ClientCaCert { get; set; }

        /// <summary>
        /// The client ca enabled.
        /// </summary>
        [Input("clientCaEnabled")]
        public Input<int>? ClientCaEnabled { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, which indicates that the client revokes the certificate file. If the value of client_crl_enabled is 1, this parameter must be configured.
        /// </summary>
        [Input("clientCertRevocationList")]
        public Input<string>? ClientCertRevocationList { get; set; }

        /// <summary>
        /// The client crl enabled.
        /// </summary>
        [Input("clientCrlEnabled")]
        public Input<int>? ClientCrlEnabled { get; set; }

        /// <summary>
        /// The time at which ApsaraDB RDS collects the statistics of the new instance.
        /// * **Before**: ApsaraDB RDS collects the statistics of the new instance before the switchover to ensure service stability. If the original instance contains a large amount of data, the upgrade may require a long period of time.
        /// * **After**: ApsaraDB RDS collects the statistics of the new instance after the switchover to accelerate the upgrade. If you access tables for which no statistics are generated, the query plans that you specify may be inaccurately executed. In addition, your database service may be unavailable during peak hours.
        /// </summary>
        [Input("collectStatMode")]
        public Input<string>? CollectStatMode { get; set; }

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

        /// <summary>
        /// The connection string prefix.
        /// </summary>
        [Input("connectionStringPrefix")]
        public Input<string>? ConnectionStringPrefix { get; set; }

        /// <summary>
        /// The instance type of the new instance. For information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Input("dbInstanceClass")]
        public Input<string>? DbInstanceClass { get; set; }

        /// <summary>
        /// The db instance description.
        /// </summary>
        [Input("dbInstanceDescription")]
        public Input<string>? DbInstanceDescription { get; set; }

        /// <summary>
        /// The storage capacity of the new instance. Unit: GB. The storage capacity increases in increments of 5 GB. For more information, see [Primary ApsaraDB RDS instance types](https://www.alibabacloud.com/doc-detail/26312.htm).
        /// </summary>
        [Input("dbInstanceStorage")]
        public Input<int>? DbInstanceStorage { get; set; }

        /// <summary>
        /// The type of storage media that is used for the new instance. Valid values:
        /// * **local_ssd**: local SSDs.
        /// * **cloud_ssd**: standard SSDs.
        /// * **cloud_essd**: enhanced SSDs (ESSDs) of performance level 1 (PL1).
        /// * **cloud_essd2**: ESSDs of PL2.
        /// * **cloud_essd3**: ESSDs of PL3.
        /// </summary>
        [Input("dbInstanceStorageType")]
        public Input<string>? DbInstanceStorageType { get; set; }

        /// <summary>
        /// The name of the database for which you want to enable TDE. Up to 50 names can be entered in a single request. If you specify multiple names, separate these names with commas (,).
        /// </summary>
        [Input("dbName")]
        public Input<string>? DbName { get; set; }

        /// <summary>
        /// The ID of the dedicated cluster to which the new instance belongs. This parameter takes effect only when you create the new instance in a dedicated cluster.
        /// </summary>
        [Input("dedicatedHostGroupId")]
        public Input<string>? DedicatedHostGroupId { 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>
        /// The direction. Valid values: `Auto`, `Down`, `TempUpgrade`, `Up`.
        /// </summary>
        [Input("direction")]
        public Input<string>? Direction { get; set; }

        /// <summary>
        /// The effective time.
        /// </summary>
        [Input("effectiveTime")]
        public Input<string>? EffectiveTime { get; set; }

        /// <summary>
        /// The ID of the private key.
        /// </summary>
        [Input("encryptionKey")]
        public Input<string>? EncryptionKey { get; set; }

        /// <summary>
        /// Database type. Value options: MySQL, SQLServer, PostgreSQL.
        /// </summary>
        [Input("engine")]
        public Input<string>? Engine { get; set; }

        /// <summary>
        /// Database version. Value:
        /// * MySQL: **5.5/5.6/5.7/8.0**.
        /// * SQL Server: **2008r2/08r2_ent_ha/2012/2012_ent_ha/2012_std_ha/2012_web/2014_std_ha/2016_ent_ha/2016_std_ha/2016_web/2017_std_ha/2017_ent/2019_std_ha/2019_ent**.
        /// * PostgreSQL: **9.4/10.0/11.0/12.0/13.0**.
        /// * MariaDB: **10.3**.
        /// </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>
        /// The high availability mode. Valid values:
        /// * **RPO**: Data persistence is preferred. The instance preferentially ensures data reliability to minimize data loss. Use this mode if you have higher requirements on data consistency.
        /// * **RTO**: Instance availability is preferred. The instance restores services as soon as possible to ensure availability. Use this mode if you have higher requirements on service availability.
        /// </summary>
        [Input("haMode")]
        public Input<string>? HaMode { get; set; }

        /// <summary>
        /// The network type of the instance. Valid values:
        /// * **Classic**: Classic Network.
        /// * **VPC**: VPC.
        /// </summary>
        [Input("instanceNetworkType")]
        public Input<string>? InstanceNetworkType { get; set; }

        /// <summary>
        /// The maintainable time period of the instance. Format: &lt;I&gt; HH:mm&lt;/I&gt; Z-&lt;I&gt; HH:mm&lt;/I&gt; Z(UTC time).
        /// </summary>
        [Input("maintainTime")]
        public Input<string>? MaintainTime { get; set; }

        [Input("parameters")]
        private InputList<Inputs.RdsUpgradeDbInstanceParameterGetArgs>? _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.RdsUpgradeDbInstanceParameterGetArgs> Parameters
        {
            get => _parameters ?? (_parameters = new InputList<Inputs.RdsUpgradeDbInstanceParameterGetArgs>());
            set => _parameters = value;
        }

        /// <summary>
        /// The password of the certificate.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        /// <summary>
        /// The billing method of the new instance. Valid values: `PayAsYouGo` and `Subscription`.
        /// </summary>
        [Input("paymentType")]
        public Input<string>? PaymentType { get; set; }

        [Input("pgHbaConfs")]
        private InputList<Inputs.RdsUpgradeDbInstancePgHbaConfGetArgs>? _pgHbaConfs;

        /// <summary>
        /// The configuration of [AD domain](https://www.alibabacloud.com/help/en/doc-detail/349288.htm) (documented below).
        /// </summary>
        public InputList<Inputs.RdsUpgradeDbInstancePgHbaConfGetArgs> PgHbaConfs
        {
            get => _pgHbaConfs ?? (_pgHbaConfs = new InputList<Inputs.RdsUpgradeDbInstancePgHbaConfGetArgs>());
            set => _pgHbaConfs = value;
        }

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

        /// <summary>
        /// The intranet IP address of the new instance must be within the specified vSwitch IP address range. By default, the system automatically allocates by using **VPCId** and **VSwitchId**.
        /// </summary>
        [Input("privateIpAddress")]
        public Input<string>? PrivateIpAddress { get; set; }

        /// <summary>
        /// The file that contains the private key used for TDE.
        /// </summary>
        [Input("privateKey")]
        public Input<string>? PrivateKey { get; set; }

        /// <summary>
        /// The released keep policy.
        /// </summary>
        [Input("releasedKeepPolicy")]
        public Input<string>? ReleasedKeepPolicy { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version, indicating the authentication method of the replication permission. It is only allowed when the public key of the client certificate authority is enabled. Valid values: `cert` and `perfer` and `verify-ca` and `verify-full (supported by RDS PostgreSQL above 12)`.
        /// </summary>
        [Input("replicationAcl")]
        public Input<string>? ReplicationAcl { get; set; }

        /// <summary>
        /// The resource group id.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// The Alibaba Cloud Resource Name (ARN) of a RAM role. A RAM role is a virtual RAM identity that you can create within your Alibaba Cloud account. For more information, see [RAM role overview](https://www.alibabacloud.com/doc-detail/93689.htm).
        /// </summary>
        [Input("roleArn")]
        public Input<string>? RoleArn { get; set; }

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

        /// <summary>
        /// The IP address whitelist of the instance. Separate multiple IP addresses with commas (,) and cannot be repeated. The following two formats are supported:
        /// * IP address form, for example: 10.23.12.24.
        /// * CIDR format, for example, 10.23.12.0/24 (no Inter-Domain Routing, 24 indicates the length of the prefix in the address, ranging from 1 to 32).
        /// </summary>
        public InputList<string> SecurityIps
        {
            get => _securityIps ?? (_securityIps = new InputList<string>());
            set => _securityIps = value;
        }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the content of the server certificate. If the CAType value is custom, this parameter must be configured.
        /// </summary>
        [Input("serverCert")]
        public Input<string>? ServerCert { get; set; }

        /// <summary>
        /// This parameter is only supported by the RDS PostgreSQL cloud disk version. It indicates the private key of the server certificate. If the value of CAType is custom, this parameter must be configured.
        /// </summary>
        [Input("serverKey")]
        public Input<string>? ServerKey { get; set; }

        /// <summary>
        /// The source biz.
        /// </summary>
        [Input("sourceBiz")]
        public Input<string>? SourceBiz { get; set; }

        /// <summary>
        /// The source db instance id.
        /// </summary>
        [Input("sourceDbInstanceId")]
        public Input<string>? SourceDbInstanceId { get; set; }

        /// <summary>
        /// Enable or disable SSL. Valid values: `0` and `1`.
        /// </summary>
        [Input("sslEnabled")]
        public Input<int>? SslEnabled { get; set; }

        /// <summary>
        /// Specifies whether ApsaraDB RDS automatically switches your workloads over to the new instance after data is migrated to the new instance. Valid values:
        /// * **true**: ApsaraDB RDS automatically switches workloads over to the new instance. If you set this parameter to true, you must take note of the following information:
        /// * After the switchover is complete, you cannot roll your workloads back to the original instance. Proceed with caution.
        /// * During the switchover, the original instance processes only read requests. You must perform the switchover during off-peak hours.
        /// * If read-only instances are attached to the original instance, you can set this parameter only to false. In this case, the read-only instances that are attached to the original instance cannot be cloned. After the upgrade is complete, you must create read-only instances for the new instance.
        /// * **false**: ApsaraDB RDS does not automatically switch your workloads over to the new instance. Before you perform an upgrade, we recommend that you set this parameter to false to test whether the new major engine version is compatible with your workloads. If you set this parameter to false, you must take note of the following information:
        /// * The data migration does not interrupt your workloads on the original instance.
        /// * After data is migrated to the new instance, you must update the endpoint configuration on your application. This update requires you to replace the endpoint of the original instance with the endpoint of the new instance. For more information about how to view the endpoint of an instance, see [View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance](https://www.alibabacloud.com/help/doc-detail/96788.htm).
        /// </summary>
        [Input("switchOver")]
        public Input<string>? SwitchOver { get; set; }

        /// <summary>
        /// The time at which you want to apply the specification changes. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
        /// </summary>
        [Input("switchTime")]
        public Input<string>? SwitchTime { get; set; }

        /// <summary>
        /// The time at which ApsaraDB RDS switches your workloads over to the new instance. This parameter is used together with the SwitchOver parameter and takes effect only when you set the SwitchOver parameter to true. Valid values:
        /// * **Immediate**: After data is migrated to the new instance, ApsaraDB RDS immediately switches your workloads over to the new instance.
        /// * **MaintainTime**: After data is migrated to the new instance, ApsaraDB RDS switches your workloads over to the new instance during the maintenance window that you specify. You can call the [ModifyDBInstanceMaintainTime](https://www.alibabacloud.com/help/doc-detail/26249.htm) operation to change the maintenance window of an instance.
        /// </summary>
        [Input("switchTimeMode")]
        public Input<string>? SwitchTimeMode { get; set; }

        /// <summary>
        /// [The data replication mode](https://www.alibabacloud.com/help/doc-detail/96055.htm). Valid values:
        /// * **Sync**: strong synchronization.
        /// * **Semi-sync**: Semi-synchronous.
        /// * **Async**: asynchronous.
        /// </summary>
        [Input("syncMode")]
        public Input<string>? SyncMode { get; set; }

        /// <summary>
        /// The major engine version of the new instance. The value of this parameter must be the major engine version on which an upgrade check is performed.
        /// </summary>
        [Input("targetMajorVersion")]
        public Input<string>? TargetMajorVersion { get; set; }

        /// <summary>
        /// The availability check method of the instance. Valid values:
        /// - **SHORT**: Alibaba Cloud uses short-lived connections to check the availability of the instance.
        /// - **LONG**: Alibaba Cloud uses persistent connections to check the availability of the instance.
        /// </summary>
        [Input("tcpConnectionType")]
        public Input<string>? TcpConnectionType { get; set; }

        /// <summary>
        /// Specifies whether to enable TDE. Valid values: `Enabled` and `Disabled`.
        /// </summary>
        [Input("tdeStatus")]
        public Input<string>? TdeStatus { get; set; }

        /// <summary>
        /// The ID of the VPC to which the new instance belongs.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// The ID of the vSwitch associated with the specified VPC.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

        /// <summary>
        /// The ID of the zone to which the new instance belongs. You can call the [DescribeRegions](https://www.alibabacloud.com/doc-detail/26243.htm) operation to query the most recent region list.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        /// <summary>
        /// The ID of the zone to which the secondary instance of the new instance belongs. You can specify this parameter only when the original instance runs RDS High-availability Edition. You can select a zone that belongs to the region where the original instance resides. You can call the [DescribeRegions](https://www.alibabacloud.com/help/doc-detail/26243.htm) operation to query zone IDs.
        /// </summary>
        [Input("zoneIdSlave1")]
        public Input<string>? ZoneIdSlave1 { get; set; }

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