<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.Postgresql
{
    [TctestResourceType("tctest:Postgresql/readonlyGroup:ReadonlyGroup")]
    public partial class ReadonlyGroup : Pulumi.CustomResource
    {
        /// <summary>
        /// Create time of the postgresql instance.
        /// </summary>
        [Output("createTime")]
        public Output<string> CreateTime { get; private set; } = null!;

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

        /// <summary>
        /// Delay threshold in ms.
        /// </summary>
        [Output("maxReplayLag")]
        public Output<int> MaxReplayLag { get; private set; } = null!;

        /// <summary>
        /// Delayed log size threshold in MB.
        /// </summary>
        [Output("maxReplayLatency")]
        public Output<int> MaxReplayLatency { get; private set; } = null!;

        /// <summary>
        /// The minimum number of read-only replicas that must be retained in an RO group.
        /// </summary>
        [Output("minDelayEliminateReserve")]
        public Output<int> MinDelayEliminateReserve { get; private set; } = null!;

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

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

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary
        /// instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Output("replayLagEliminate")]
        public Output<int> ReplayLagEliminate { get; private set; } = null!;

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and
        /// the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Output("replayLatencyEliminate")]
        public Output<int> ReplayLatencyEliminate { get; private set; } = null!;

        /// <summary>
        /// ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
        /// </summary>
        [Output("securityGroupsIds")]
        public Output<ImmutableArray<string>> SecurityGroupsIds { 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>
        /// Create a ReadonlyGroup 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 ReadonlyGroup(string name, ReadonlyGroupArgs args, CustomResourceOptions? options = null)
            : base("tctest:Postgresql/readonlyGroup:ReadonlyGroup", name, args ?? new ReadonlyGroupArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class ReadonlyGroupArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Primary instance ID.
        /// </summary>
        [Input("masterDbInstanceId", required: true)]
        public Input<string> MasterDbInstanceId { get; set; } = null!;

        /// <summary>
        /// Delay threshold in ms.
        /// </summary>
        [Input("maxReplayLag", required: true)]
        public Input<int> MaxReplayLag { get; set; } = null!;

        /// <summary>
        /// Delayed log size threshold in MB.
        /// </summary>
        [Input("maxReplayLatency", required: true)]
        public Input<int> MaxReplayLatency { get; set; } = null!;

        /// <summary>
        /// The minimum number of read-only replicas that must be retained in an RO group.
        /// </summary>
        [Input("minDelayEliminateReserve", required: true)]
        public Input<int> MinDelayEliminateReserve { get; set; } = null!;

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

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

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary
        /// instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Input("replayLagEliminate", required: true)]
        public Input<int> ReplayLagEliminate { get; set; } = null!;

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and
        /// the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Input("replayLatencyEliminate", required: true)]
        public Input<int> ReplayLatencyEliminate { get; set; } = null!;

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

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

        /// <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!;

        public ReadonlyGroupArgs()
        {
        }
    }

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

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

        /// <summary>
        /// Delay threshold in ms.
        /// </summary>
        [Input("maxReplayLag")]
        public Input<int>? MaxReplayLag { get; set; }

        /// <summary>
        /// Delayed log size threshold in MB.
        /// </summary>
        [Input("maxReplayLatency")]
        public Input<int>? MaxReplayLatency { get; set; }

        /// <summary>
        /// The minimum number of read-only replicas that must be retained in an RO group.
        /// </summary>
        [Input("minDelayEliminateReserve")]
        public Input<int>? MinDelayEliminateReserve { get; set; }

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

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

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the delay between the read-only replica and the primary
        /// instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Input("replayLagEliminate")]
        public Input<int>? ReplayLagEliminate { get; set; }

        /// <summary>
        /// Whether to remove a read-only replica from an RO group if the sync log size difference between the read-only replica and
        /// the primary instance exceeds the threshold. Valid values: 0 (no), 1 (yes).
        /// </summary>
        [Input("replayLatencyEliminate")]
        public Input<int>? ReplayLatencyEliminate { get; set; }

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

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

        /// <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; }

        public ReadonlyGroupState()
        {
        }
    }
}
