// *** 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.Postgresql
{
    [TctestResourceType("tctest:Postgresql/readonlyInstance:ReadonlyInstance")]
    public partial class ReadonlyInstance : Pulumi.CustomResource
    {
        /// <summary>
        /// Renewal flag. Valid values: 0 (manual renewal), 1 (auto-renewal). Default value: 0.
        /// </summary>
        [Output("autoRenewFlag")]
        public Output<int?> AutoRenewFlag { get; private set; } = null!;

        /// <summary>
        /// Create time of the postgresql instance.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

        /// <summary>
        /// PostgreSQL kernel version, which must be the same as that of the primary instance.
        /// </summary>
        [Output("dbVersion")]
        public Output<string> DbVersion { get; private set; } = null!;

        /// <summary>
        /// instance billing mode. Valid values: PREPAID (monthly subscription), POSTPAID_BY_HOUR (pay-as-you-go).
        /// </summary>
        [Output("instanceChargeType")]
        public Output<string?> InstanceChargeType { get; private set; } = null!;

        /// <summary>
        /// ID of the primary instance to which the read-only replica belongs.
        /// </summary>
        [Output("masterDbInstanceId")]
        public Output<string> MasterDbInstanceId { get; private set; } = null!;

        /// <summary>
        /// Memory size(in GB). Allowed value must be larger than `memory` that data source `tencentcloud_postgresql_specinfos`
        /// provides.
        /// </summary>
        [Output("memory")]
        public Output<int> Memory { get; private set; } = null!;

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

        /// <summary>
        /// Whether to support IPv6 address access. Valid values: 1 (yes), 0 (no).
        /// </summary>
        [Output("needSupportIpv6")]
        public Output<int?> NeedSupportIpv6 { get; private set; } = null!;

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

        /// <summary>
        /// ID of security group.
        /// </summary>
        [Output("securityGroupsIds")]
        public Output<ImmutableArray<string>> SecurityGroupsIds { get; private set; } = null!;

        /// <summary>
        /// Instance storage capacity in GB.
        /// </summary>
        [Output("storage")]
        public Output<int> Storage { get; private set; } = null!;

        /// <summary>
        /// VPC subnet ID.
        /// </summary>
        [Output("subnetId")]
        public Output<string> SubnetId { get; private set; } = null!;

        /// <summary>
        /// VPC ID.
        /// </summary>
        [Output("vpcId")]
        public Output<string> VpcId { get; private set; } = null!;

        /// <summary>
        /// Availability zone ID, which can be obtained through the Zone field in the returned value of the DescribeZones API.
        /// </summary>
        [Output("zone")]
        public Output<string> Zone { 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("tctest:Postgresql/readonlyInstance:ReadonlyInstance", name, args ?? new ReadonlyInstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ReadonlyInstance(string name, Input<string> id, ReadonlyInstanceState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Postgresql/readonlyInstance:ReadonlyInstance", 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 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 : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Renewal flag. Valid values: 0 (manual renewal), 1 (auto-renewal). Default value: 0.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// PostgreSQL kernel version, which must be the same as that of the primary instance.
        /// </summary>
        [Input("dbVersion", required: true)]
        public Input<string> DbVersion { get; set; } = null!;

        /// <summary>
        /// instance billing mode. Valid values: PREPAID (monthly subscription), POSTPAID_BY_HOUR (pay-as-you-go).
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        /// <summary>
        /// ID of the primary instance to which the read-only replica belongs.
        /// </summary>
        [Input("masterDbInstanceId", required: true)]
        public Input<string> MasterDbInstanceId { get; set; } = null!;

        /// <summary>
        /// Memory size(in GB). Allowed value must be larger than `memory` that data source `tencentcloud_postgresql_specinfos`
        /// provides.
        /// </summary>
        [Input("memory", required: true)]
        public Input<int> Memory { get; set; } = null!;

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

        /// <summary>
        /// Whether to support IPv6 address access. Valid values: 1 (yes), 0 (no).
        /// </summary>
        [Input("needSupportIpv6")]
        public Input<int>? NeedSupportIpv6 { get; set; }

        /// <summary>
        /// Project ID.
        /// </summary>
        [Input("projectId", required: true)]
        public Input<int> ProjectId { get; set; } = null!;

        [Input("securityGroupsIds", required: true)]
        private InputList<string>? _securityGroupsIds;

        /// <summary>
        /// ID of security group.
        /// </summary>
        public InputList<string> SecurityGroupsIds
        {
            get => _securityGroupsIds ?? (_securityGroupsIds = new InputList<string>());
            set => _securityGroupsIds = value;
        }

        /// <summary>
        /// Instance storage capacity in GB.
        /// </summary>
        [Input("storage", required: true)]
        public Input<int> Storage { get; set; } = null!;

        /// <summary>
        /// VPC subnet ID.
        /// </summary>
        [Input("subnetId", required: true)]
        public Input<string> SubnetId { get; set; } = null!;

        /// <summary>
        /// VPC ID.
        /// </summary>
        [Input("vpcId", required: true)]
        public Input<string> VpcId { get; set; } = null!;

        /// <summary>
        /// Availability zone ID, which can be obtained through the Zone field in the returned value of the DescribeZones API.
        /// </summary>
        [Input("zone", required: true)]
        public Input<string> Zone { get; set; } = null!;

        public ReadonlyInstanceArgs()
        {
        }
    }

    public sealed class ReadonlyInstanceState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Renewal flag. Valid values: 0 (manual renewal), 1 (auto-renewal). Default value: 0.
        /// </summary>
        [Input("autoRenewFlag")]
        public Input<int>? AutoRenewFlag { get; set; }

        /// <summary>
        /// Create time of the postgresql instance.
        /// </summary>
        [Input("createTime")]
        public Input<string>? CreateTime { get; set; }

        /// <summary>
        /// PostgreSQL kernel version, which must be the same as that of the primary instance.
        /// </summary>
        [Input("dbVersion")]
        public Input<string>? DbVersion { get; set; }

        /// <summary>
        /// instance billing mode. Valid values: PREPAID (monthly subscription), POSTPAID_BY_HOUR (pay-as-you-go).
        /// </summary>
        [Input("instanceChargeType")]
        public Input<string>? InstanceChargeType { get; set; }

        /// <summary>
        /// ID of the primary instance to which the read-only replica belongs.
        /// </summary>
        [Input("masterDbInstanceId")]
        public Input<string>? MasterDbInstanceId { get; set; }

        /// <summary>
        /// Memory size(in GB). Allowed value must be larger than `memory` that data source `tencentcloud_postgresql_specinfos`
        /// provides.
        /// </summary>
        [Input("memory")]
        public Input<int>? Memory { get; set; }

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

        /// <summary>
        /// Whether to support IPv6 address access. Valid values: 1 (yes), 0 (no).
        /// </summary>
        [Input("needSupportIpv6")]
        public Input<int>? NeedSupportIpv6 { get; set; }

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

        [Input("securityGroupsIds")]
        private InputList<string>? _securityGroupsIds;

        /// <summary>
        /// ID of security group.
        /// </summary>
        public InputList<string> SecurityGroupsIds
        {
            get => _securityGroupsIds ?? (_securityGroupsIds = new InputList<string>());
            set => _securityGroupsIds = value;
        }

        /// <summary>
        /// Instance storage capacity in GB.
        /// </summary>
        [Input("storage")]
        public Input<int>? Storage { get; set; }

        /// <summary>
        /// VPC subnet ID.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

        /// <summary>
        /// VPC ID.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// Availability zone ID, which can be obtained through the Zone field in the returned value of the DescribeZones API.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public ReadonlyInstanceState()
        {
        }
    }
}
