<reponame>Kagashino/pulumi-tctest<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.Tctest.Mysql
{
    [TctestResourceType("tctest:Mysql/instance:Instance")]
    public partial class Instance : Pulumi.CustomResource
    {
        /// <summary>
        /// Auto renew flag. NOTES: Only supported prepaid instance.
        /// </summary>
        [Output("autoRenewFlag")]
        public Output<int?> AutoRenewFlag { get; private set; } = null!;

        /// <summary>
        /// Indicates which availability zone will be used.
        /// </summary>
        [Output("availabilityZone")]
        public Output<string> AvailabilityZone { get; private set; } = null!;

        /// <summary>
        /// Pay type of instance. Valid values:`PREPAID`, `POSTPAID`. Default is `POSTPAID`.
        /// </summary>
        [Output("chargeType")]
        public Output<string?> ChargeType { get; private set; } = null!;

        /// <summary>
        /// CPU cores.
        /// </summary>
        [Output("cpu")]
        public Output<int> Cpu { get; private set; } = null!;

        /// <summary>
        /// Specify device type, available values: `UNIVERSAL` (default), `EXCLUSIVE`, `BASIC`.
        /// </summary>
        [Output("deviceType")]
        public Output<string?> DeviceType { get; private set; } = null!;

        /// <summary>
        /// The version number of the database engine to use. Supported versions include 5.5/5.6/5.7/8.0, and default is 5.7.
        /// </summary>
        [Output("engineVersion")]
        public Output<string?> EngineVersion { get; private set; } = null!;

        /// <summary>
        /// Specify whether to enable fast upgrade when upgrade instance spec, available value: `1` - enabled, `0` - disabled.
        /// </summary>
        [Output("fastUpgrade")]
        public Output<int?> FastUpgrade { get; private set; } = null!;

        /// <summary>
        /// Zone information about first slave instance.
        /// </summary>
        [Output("firstSlaveZone")]
        public Output<string?> FirstSlaveZone { get; private set; } = null!;

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

        /// <summary>
        /// Indicates whether GTID is enable. `0` - Not enabled; `1` - Enabled.
        /// </summary>
        [Output("gtid")]
        public Output<int> Gtid { get; private set; } = null!;

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

        /// <summary>
        /// host for public access.
        /// </summary>
        [Output("internetHost")]
        public Output<string> InternetHost { get; private set; } = null!;

        /// <summary>
        /// Access port for public access.
        /// </summary>
        [Output("internetPort")]
        public Output<int> InternetPort { get; private set; } = null!;

        /// <summary>
        /// Indicates whether to enable the access to an instance from public network: 0 - No, 1 - Yes.
        /// </summary>
        [Output("internetService")]
        public Output<int?> InternetService { get; private set; } = null!;

        /// <summary>
        /// instance intranet IP.
        /// </summary>
        [Output("intranetIp")]
        public Output<string> IntranetIp { get; private set; } = null!;

        /// <summary>
        /// Public access port. Valid value ranges: [1024~65535]. The default value is `3306`.
        /// </summary>
        [Output("intranetPort")]
        public Output<int?> IntranetPort { get; private set; } = null!;

        /// <summary>
        /// Indicates whether the instance is locked. Valid values: `0`, `1`. `0` - No; `1` - Yes.
        /// </summary>
        [Output("locked")]
        public Output<int> Locked { get; private set; } = null!;

        /// <summary>
        /// Memory size (in MB).
        /// </summary>
        [Output("memSize")]
        public Output<int> MemSize { get; private set; } = null!;

        /// <summary>
        /// Specify parameter template id.
        /// </summary>
        [Output("paramTemplateId")]
        public Output<int?> ParamTemplateId { get; private set; } = null!;

        /// <summary>
        /// List of parameters to use.
        /// </summary>
        [Output("parameters")]
        public Output<ImmutableDictionary<string, object>?> Parameters { get; private set; } = null!;

        /// <summary>
        /// Pay type of instance. Valid values: `0`, `1`. `0`: prepaid, `1`: postpaid.
        /// </summary>
        [Output("payType")]
        public Output<int?> PayType { get; private set; } = null!;

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Output("period")]
        public Output<int?> Period { get; private set; } = null!;

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Output("prepaidPeriod")]
        public Output<int?> PrepaidPeriod { get; private set; } = null!;

        /// <summary>
        /// Project ID, default value is 0.
        /// </summary>
        [Output("projectId")]
        public Output<int?> ProjectId { get; private set; } = null!;

        /// <summary>
        /// Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored
        /// when you purchase read-only instances or disaster recovery instances.
        /// </summary>
        [Output("rootPassword")]
        public Output<string?> RootPassword { get; private set; } = null!;

        /// <summary>
        /// Zone information about second slave instance.
        /// </summary>
        [Output("secondSlaveZone")]
        public Output<string?> SecondSlaveZone { get; private set; } = null!;

        /// <summary>
        /// Security groups to use.
        /// </summary>
        [Output("securityGroups")]
        public Output<ImmutableArray<string>> SecurityGroups { get; private set; } = null!;

        /// <summary>
        /// Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
        /// </summary>
        [Output("slaveDeployMode")]
        public Output<int?> SlaveDeployMode { get; private set; } = null!;

        /// <summary>
        /// Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
        /// </summary>
        [Output("slaveSyncMode")]
        public Output<int?> SlaveSyncMode { get; private set; } = null!;

        /// <summary>
        /// Instance status. Valid values: `0`, `1`, `4`, `5`. `0` - Creating; `1` - Running; `4` - Isolating; `5` - Isolated.
        /// </summary>
        [Output("status")]
        public Output<int> Status { get; private set; } = null!;

        /// <summary>
        /// Private network ID. If `vpc_id` is set, this value is required.
        /// </summary>
        [Output("subnetId")]
        public Output<string?> SubnetId { get; private set; } = null!;

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

        /// <summary>
        /// Indicates which kind of operations is being executed.
        /// </summary>
        [Output("taskStatus")]
        public Output<int> TaskStatus { get; private set; } = null!;

        /// <summary>
        /// Disk size (in GB).
        /// </summary>
        [Output("volumeSize")]
        public Output<int> VolumeSize { get; private set; } = null!;

        /// <summary>
        /// ID of VPC, which can be modified once every 24 hours and can't be removed.
        /// </summary>
        [Output("vpcId")]
        public Output<string?> VpcId { get; private set; } = null!;


        /// <summary>
        /// Create a Instance resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Instance(string name, InstanceArgs args, CustomResourceOptions? options = null)
            : base("tctest:Mysql/instance:Instance", name, args ?? new InstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Instance(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Mysql/instance:Instance", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Instance resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Instance Get(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
        {
            return new Instance(name, id, state, options);
        }
    }

    public sealed class InstanceArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Auto renew flag. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// Indicates which availability zone will be used.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// Pay type of instance. Valid values:`PREPAID`, `POSTPAID`. Default is `POSTPAID`.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// CPU cores.
        /// </summary>
        [Input("cpu")]
        public Input<int>? Cpu { get; set; }

        /// <summary>
        /// Specify device type, available values: `UNIVERSAL` (default), `EXCLUSIVE`, `BASIC`.
        /// </summary>
        [Input("deviceType")]
        public Input<string>? DeviceType { get; set; }

        /// <summary>
        /// The version number of the database engine to use. Supported versions include 5.5/5.6/5.7/8.0, and default is 5.7.
        /// </summary>
        [Input("engineVersion")]
        public Input<string>? EngineVersion { get; set; }

        /// <summary>
        /// Specify whether to enable fast upgrade when upgrade instance spec, available value: `1` - enabled, `0` - disabled.
        /// </summary>
        [Input("fastUpgrade")]
        public Input<int>? FastUpgrade { get; set; }

        /// <summary>
        /// Zone information about first slave instance.
        /// </summary>
        [Input("firstSlaveZone")]
        public Input<string>? FirstSlaveZone { get; set; }

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

        /// <summary>
        /// The name of a mysql instance.
        /// </summary>
        [Input("instanceName", required: true)]
        public Input<string> InstanceName { get; set; } = null!;

        /// <summary>
        /// Indicates whether to enable the access to an instance from public network: 0 - No, 1 - Yes.
        /// </summary>
        [Input("internetService")]
        public Input<int>? InternetService { get; set; }

        /// <summary>
        /// Public access port. Valid value ranges: [1024~65535]. The default value is `3306`.
        /// </summary>
        [Input("intranetPort")]
        public Input<int>? IntranetPort { get; set; }

        /// <summary>
        /// Memory size (in MB).
        /// </summary>
        [Input("memSize", required: true)]
        public Input<int> MemSize { get; set; } = null!;

        /// <summary>
        /// Specify parameter template id.
        /// </summary>
        [Input("paramTemplateId")]
        public Input<int>? ParamTemplateId { get; set; }

        [Input("parameters")]
        private InputMap<object>? _parameters;

        /// <summary>
        /// List of parameters to use.
        /// </summary>
        public InputMap<object> Parameters
        {
            get => _parameters ?? (_parameters = new InputMap<object>());
            set => _parameters = value;
        }

        /// <summary>
        /// Pay type of instance. Valid values: `0`, `1`. `0`: prepaid, `1`: postpaid.
        /// </summary>
        [Input("payType")]
        public Input<int>? PayType { get; set; }

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("prepaidPeriod")]
        public Input<int>? PrepaidPeriod { get; set; }

        /// <summary>
        /// Project ID, default value is 0.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored
        /// when you purchase read-only instances or disaster recovery instances.
        /// </summary>
        [Input("rootPassword")]
        public Input<string>? RootPassword { get; set; }

        /// <summary>
        /// Zone information about second slave instance.
        /// </summary>
        [Input("secondSlaveZone")]
        public Input<string>? SecondSlaveZone { get; set; }

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

        /// <summary>
        /// Security groups to use.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
        /// </summary>
        [Input("slaveDeployMode")]
        public Input<int>? SlaveDeployMode { get; set; }

        /// <summary>
        /// Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
        /// </summary>
        [Input("slaveSyncMode")]
        public Input<int>? SlaveSyncMode { get; set; }

        /// <summary>
        /// Private network ID. If `vpc_id` is set, this value is required.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

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

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

        /// <summary>
        /// Disk size (in GB).
        /// </summary>
        [Input("volumeSize", required: true)]
        public Input<int> VolumeSize { get; set; } = null!;

        /// <summary>
        /// ID of VPC, which can be modified once every 24 hours and can't be removed.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public InstanceArgs()
        {
        }
    }

    public sealed class InstanceState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Auto renew flag. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// Indicates which availability zone will be used.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// Pay type of instance. Valid values:`PREPAID`, `POSTPAID`. Default is `POSTPAID`.
        /// </summary>
        [Input("chargeType")]
        public Input<string>? ChargeType { get; set; }

        /// <summary>
        /// CPU cores.
        /// </summary>
        [Input("cpu")]
        public Input<int>? Cpu { get; set; }

        /// <summary>
        /// Specify device type, available values: `UNIVERSAL` (default), `EXCLUSIVE`, `BASIC`.
        /// </summary>
        [Input("deviceType")]
        public Input<string>? DeviceType { get; set; }

        /// <summary>
        /// The version number of the database engine to use. Supported versions include 5.5/5.6/5.7/8.0, and default is 5.7.
        /// </summary>
        [Input("engineVersion")]
        public Input<string>? EngineVersion { get; set; }

        /// <summary>
        /// Specify whether to enable fast upgrade when upgrade instance spec, available value: `1` - enabled, `0` - disabled.
        /// </summary>
        [Input("fastUpgrade")]
        public Input<int>? FastUpgrade { get; set; }

        /// <summary>
        /// Zone information about first slave instance.
        /// </summary>
        [Input("firstSlaveZone")]
        public Input<string>? FirstSlaveZone { get; set; }

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

        /// <summary>
        /// Indicates whether GTID is enable. `0` - Not enabled; `1` - Enabled.
        /// </summary>
        [Input("gtid")]
        public Input<int>? Gtid { get; set; }

        /// <summary>
        /// The name of a mysql instance.
        /// </summary>
        [Input("instanceName")]
        public Input<string>? InstanceName { get; set; }

        /// <summary>
        /// host for public access.
        /// </summary>
        [Input("internetHost")]
        public Input<string>? InternetHost { get; set; }

        /// <summary>
        /// Access port for public access.
        /// </summary>
        [Input("internetPort")]
        public Input<int>? InternetPort { get; set; }

        /// <summary>
        /// Indicates whether to enable the access to an instance from public network: 0 - No, 1 - Yes.
        /// </summary>
        [Input("internetService")]
        public Input<int>? InternetService { get; set; }

        /// <summary>
        /// instance intranet IP.
        /// </summary>
        [Input("intranetIp")]
        public Input<string>? IntranetIp { get; set; }

        /// <summary>
        /// Public access port. Valid value ranges: [1024~65535]. The default value is `3306`.
        /// </summary>
        [Input("intranetPort")]
        public Input<int>? IntranetPort { get; set; }

        /// <summary>
        /// Indicates whether the instance is locked. Valid values: `0`, `1`. `0` - No; `1` - Yes.
        /// </summary>
        [Input("locked")]
        public Input<int>? Locked { get; set; }

        /// <summary>
        /// Memory size (in MB).
        /// </summary>
        [Input("memSize")]
        public Input<int>? MemSize { get; set; }

        /// <summary>
        /// Specify parameter template id.
        /// </summary>
        [Input("paramTemplateId")]
        public Input<int>? ParamTemplateId { get; set; }

        [Input("parameters")]
        private InputMap<object>? _parameters;

        /// <summary>
        /// List of parameters to use.
        /// </summary>
        public InputMap<object> Parameters
        {
            get => _parameters ?? (_parameters = new InputMap<object>());
            set => _parameters = value;
        }

        /// <summary>
        /// Pay type of instance. Valid values: `0`, `1`. `0`: prepaid, `1`: postpaid.
        /// </summary>
        [Input("payType")]
        public Input<int>? PayType { get; set; }

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("period")]
        public Input<int>? Period { get; set; }

        /// <summary>
        /// Period of instance. NOTES: Only supported prepaid instance.
        /// </summary>
        [Input("prepaidPeriod")]
        public Input<int>? PrepaidPeriod { get; set; }

        /// <summary>
        /// Project ID, default value is 0.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        /// <summary>
        /// Password of root account. This parameter can be specified when you purchase master instances, but it should be ignored
        /// when you purchase read-only instances or disaster recovery instances.
        /// </summary>
        [Input("rootPassword")]
        public Input<string>? RootPassword { get; set; }

        /// <summary>
        /// Zone information about second slave instance.
        /// </summary>
        [Input("secondSlaveZone")]
        public Input<string>? SecondSlaveZone { get; set; }

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

        /// <summary>
        /// Security groups to use.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Availability zone deployment method. Available values: 0 - Single availability zone; 1 - Multiple availability zones.
        /// </summary>
        [Input("slaveDeployMode")]
        public Input<int>? SlaveDeployMode { get; set; }

        /// <summary>
        /// Data replication mode. 0 - Async replication; 1 - Semisync replication; 2 - Strongsync replication.
        /// </summary>
        [Input("slaveSyncMode")]
        public Input<int>? SlaveSyncMode { get; set; }

        /// <summary>
        /// Instance status. Valid values: `0`, `1`, `4`, `5`. `0` - Creating; `1` - Running; `4` - Isolating; `5` - Isolated.
        /// </summary>
        [Input("status")]
        public Input<int>? Status { get; set; }

        /// <summary>
        /// Private network ID. If `vpc_id` is set, this value is required.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

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

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

        /// <summary>
        /// Indicates which kind of operations is being executed.
        /// </summary>
        [Input("taskStatus")]
        public Input<int>? TaskStatus { get; set; }

        /// <summary>
        /// Disk size (in GB).
        /// </summary>
        [Input("volumeSize")]
        public Input<int>? VolumeSize { get; set; }

        /// <summary>
        /// ID of VPC, which can be modified once every 24 hours and can't be removed.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        public InstanceState()
        {
        }
    }
}
