# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['DatabaseInstanceArgs', 'DatabaseInstance']

@pulumi.input_type
class DatabaseInstanceArgs:
    def __init__(__self__, *,
                 capacity: Optional[pulumi.Input[_builtins.str]] = None,
                 custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]] = None,
                 enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
                 enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 node_count: Optional[pulumi.Input[_builtins.int]] = None,
                 parent_instance_ref: Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']] = None,
                 provider_config: Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']] = None,
                 purge_on_delete: Optional[pulumi.Input[_builtins.bool]] = None,
                 retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
                 stopped: Optional[pulumi.Input[_builtins.bool]] = None,
                 usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a DatabaseInstance resource.
        :param pulumi.Input[_builtins.str] capacity: The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        :param pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]] custom_tags: Custom tags associated with the instance. This field is only included on create and update responses
        :param pulumi.Input[_builtins.bool] enable_pg_native_login: Whether to enable PG native password login on the instance. Defaults to false
        :param pulumi.Input[_builtins.bool] enable_readable_secondaries: Whether to enable secondaries to serve read-only traffic. Defaults to false
        :param pulumi.Input[_builtins.str] name: The name of the instance. This is the unique identifier for the instance
        :param pulumi.Input[_builtins.int] node_count: The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        :param pulumi.Input['DatabaseInstanceParentInstanceRefArgs'] parent_instance_ref: The ref of the parent instance. This is only available if the instance is
               child instance.
               Input: For specifying the parent instance to create a child instance. Optional.
               Output: Only populated if provided as input to create a child instance
        :param pulumi.Input['DatabaseInstanceProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.bool] purge_on_delete: Purge the resource on delete
        :param pulumi.Input[_builtins.int] retention_window_in_days: The retention window for the instance. This is the time window in days
               for which the historical data is retained. The default value is 7 days.
               Valid values are 2 to 35 days
        :param pulumi.Input[_builtins.bool] stopped: Whether to stop the instance. An input only param, see effective_stopped for the output
        :param pulumi.Input[_builtins.str] usage_policy_id: The desired usage policy to associate with the instance
        """
        if capacity is not None:
            pulumi.set(__self__, "capacity", capacity)
        if custom_tags is not None:
            pulumi.set(__self__, "custom_tags", custom_tags)
        if enable_pg_native_login is not None:
            pulumi.set(__self__, "enable_pg_native_login", enable_pg_native_login)
        if enable_readable_secondaries is not None:
            pulumi.set(__self__, "enable_readable_secondaries", enable_readable_secondaries)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if node_count is not None:
            pulumi.set(__self__, "node_count", node_count)
        if parent_instance_ref is not None:
            pulumi.set(__self__, "parent_instance_ref", parent_instance_ref)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if purge_on_delete is not None:
            pulumi.set(__self__, "purge_on_delete", purge_on_delete)
        if retention_window_in_days is not None:
            pulumi.set(__self__, "retention_window_in_days", retention_window_in_days)
        if stopped is not None:
            pulumi.set(__self__, "stopped", stopped)
        if usage_policy_id is not None:
            pulumi.set(__self__, "usage_policy_id", usage_policy_id)

    @_builtins.property
    @pulumi.getter
    def capacity(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        """
        return pulumi.get(self, "capacity")

    @capacity.setter
    def capacity(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "capacity", value)

    @_builtins.property
    @pulumi.getter(name="customTags")
    def custom_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]]:
        """
        Custom tags associated with the instance. This field is only included on create and update responses
        """
        return pulumi.get(self, "custom_tags")

    @custom_tags.setter
    def custom_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]]):
        pulumi.set(self, "custom_tags", value)

    @_builtins.property
    @pulumi.getter(name="enablePgNativeLogin")
    def enable_pg_native_login(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to enable PG native password login on the instance. Defaults to false
        """
        return pulumi.get(self, "enable_pg_native_login")

    @enable_pg_native_login.setter
    def enable_pg_native_login(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enable_pg_native_login", value)

    @_builtins.property
    @pulumi.getter(name="enableReadableSecondaries")
    def enable_readable_secondaries(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to enable secondaries to serve read-only traffic. Defaults to false
        """
        return pulumi.get(self, "enable_readable_secondaries")

    @enable_readable_secondaries.setter
    def enable_readable_secondaries(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enable_readable_secondaries", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the instance. This is the unique identifier for the instance
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="nodeCount")
    def node_count(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
        1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        """
        return pulumi.get(self, "node_count")

    @node_count.setter
    def node_count(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "node_count", value)

    @_builtins.property
    @pulumi.getter(name="parentInstanceRef")
    def parent_instance_ref(self) -> Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']]:
        """
        The ref of the parent instance. This is only available if the instance is
        child instance.
        Input: For specifying the parent instance to create a child instance. Optional.
        Output: Only populated if provided as input to create a child instance
        """
        return pulumi.get(self, "parent_instance_ref")

    @parent_instance_ref.setter
    def parent_instance_ref(self, value: Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']]):
        pulumi.set(self, "parent_instance_ref", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="purgeOnDelete")
    def purge_on_delete(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Purge the resource on delete
        """
        return pulumi.get(self, "purge_on_delete")

    @purge_on_delete.setter
    def purge_on_delete(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "purge_on_delete", value)

    @_builtins.property
    @pulumi.getter(name="retentionWindowInDays")
    def retention_window_in_days(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The retention window for the instance. This is the time window in days
        for which the historical data is retained. The default value is 7 days.
        Valid values are 2 to 35 days
        """
        return pulumi.get(self, "retention_window_in_days")

    @retention_window_in_days.setter
    def retention_window_in_days(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "retention_window_in_days", value)

    @_builtins.property
    @pulumi.getter
    def stopped(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to stop the instance. An input only param, see effective_stopped for the output
        """
        return pulumi.get(self, "stopped")

    @stopped.setter
    def stopped(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "stopped", value)

    @_builtins.property
    @pulumi.getter(name="usagePolicyId")
    def usage_policy_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The desired usage policy to associate with the instance
        """
        return pulumi.get(self, "usage_policy_id")

    @usage_policy_id.setter
    def usage_policy_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "usage_policy_id", value)


@pulumi.input_type
class _DatabaseInstanceState:
    def __init__(__self__, *,
                 capacity: Optional[pulumi.Input[_builtins.str]] = None,
                 child_instance_refs: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceChildInstanceRefArgs']]]] = None,
                 creation_time: Optional[pulumi.Input[_builtins.str]] = None,
                 creator: Optional[pulumi.Input[_builtins.str]] = None,
                 custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]] = None,
                 effective_capacity: Optional[pulumi.Input[_builtins.str]] = None,
                 effective_custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceEffectiveCustomTagArgs']]]] = None,
                 effective_enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
                 effective_enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
                 effective_node_count: Optional[pulumi.Input[_builtins.int]] = None,
                 effective_retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
                 effective_stopped: Optional[pulumi.Input[_builtins.bool]] = None,
                 effective_usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None,
                 enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
                 enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 node_count: Optional[pulumi.Input[_builtins.int]] = None,
                 parent_instance_ref: Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']] = None,
                 pg_version: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']] = None,
                 purge_on_delete: Optional[pulumi.Input[_builtins.bool]] = None,
                 read_only_dns: Optional[pulumi.Input[_builtins.str]] = None,
                 read_write_dns: Optional[pulumi.Input[_builtins.str]] = None,
                 retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
                 state: Optional[pulumi.Input[_builtins.str]] = None,
                 stopped: Optional[pulumi.Input[_builtins.bool]] = None,
                 uid: Optional[pulumi.Input[_builtins.str]] = None,
                 usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering DatabaseInstance resources.
        :param pulumi.Input[_builtins.str] capacity: The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        :param pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceChildInstanceRefArgs']]] child_instance_refs: (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
               parent instance
        :param pulumi.Input[_builtins.str] creation_time: (string) - The timestamp when the instance was created
        :param pulumi.Input[_builtins.str] creator: (string) - The email of the creator of the instance
        :param pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]] custom_tags: Custom tags associated with the instance. This field is only included on create and update responses
        :param pulumi.Input[_builtins.str] effective_capacity: (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceEffectiveCustomTagArgs']]] effective_custom_tags: (list of CustomTag) - The recorded custom tags associated with the instance.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_enable_pg_native_login: (boolean) - Whether the instance has PG native password login enabled.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_enable_readable_secondaries: (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.int] effective_node_count: (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.int] effective_retention_window_in_days: (integer) - The retention window for the instance. This is the time window in days
               for which the historical data is retained.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_stopped: (boolean) - Whether the instance is stopped.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.str] effective_usage_policy_id: (string) - The policy that is applied to the instance.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] enable_pg_native_login: Whether to enable PG native password login on the instance. Defaults to false
        :param pulumi.Input[_builtins.bool] enable_readable_secondaries: Whether to enable secondaries to serve read-only traffic. Defaults to false
        :param pulumi.Input[_builtins.str] name: The name of the instance. This is the unique identifier for the instance
        :param pulumi.Input[_builtins.int] node_count: The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        :param pulumi.Input['DatabaseInstanceParentInstanceRefArgs'] parent_instance_ref: The ref of the parent instance. This is only available if the instance is
               child instance.
               Input: For specifying the parent instance to create a child instance. Optional.
               Output: Only populated if provided as input to create a child instance
        :param pulumi.Input[_builtins.str] pg_version: (string) - The version of Postgres running on the instance
        :param pulumi.Input['DatabaseInstanceProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.bool] purge_on_delete: Purge the resource on delete
        :param pulumi.Input[_builtins.str] read_only_dns: (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
               enable_readable_secondaries is true
        :param pulumi.Input[_builtins.str] read_write_dns: (string) - The DNS endpoint to connect to the instance for read+write access
        :param pulumi.Input[_builtins.int] retention_window_in_days: The retention window for the instance. This is the time window in days
               for which the historical data is retained. The default value is 7 days.
               Valid values are 2 to 35 days
        :param pulumi.Input[_builtins.str] state: (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
        :param pulumi.Input[_builtins.bool] stopped: Whether to stop the instance. An input only param, see effective_stopped for the output
        :param pulumi.Input[_builtins.str] uid: (string) - Id of the ref database instance
        :param pulumi.Input[_builtins.str] usage_policy_id: The desired usage policy to associate with the instance
        """
        if capacity is not None:
            pulumi.set(__self__, "capacity", capacity)
        if child_instance_refs is not None:
            pulumi.set(__self__, "child_instance_refs", child_instance_refs)
        if creation_time is not None:
            pulumi.set(__self__, "creation_time", creation_time)
        if creator is not None:
            pulumi.set(__self__, "creator", creator)
        if custom_tags is not None:
            pulumi.set(__self__, "custom_tags", custom_tags)
        if effective_capacity is not None:
            pulumi.set(__self__, "effective_capacity", effective_capacity)
        if effective_custom_tags is not None:
            pulumi.set(__self__, "effective_custom_tags", effective_custom_tags)
        if effective_enable_pg_native_login is not None:
            pulumi.set(__self__, "effective_enable_pg_native_login", effective_enable_pg_native_login)
        if effective_enable_readable_secondaries is not None:
            pulumi.set(__self__, "effective_enable_readable_secondaries", effective_enable_readable_secondaries)
        if effective_node_count is not None:
            pulumi.set(__self__, "effective_node_count", effective_node_count)
        if effective_retention_window_in_days is not None:
            pulumi.set(__self__, "effective_retention_window_in_days", effective_retention_window_in_days)
        if effective_stopped is not None:
            pulumi.set(__self__, "effective_stopped", effective_stopped)
        if effective_usage_policy_id is not None:
            pulumi.set(__self__, "effective_usage_policy_id", effective_usage_policy_id)
        if enable_pg_native_login is not None:
            pulumi.set(__self__, "enable_pg_native_login", enable_pg_native_login)
        if enable_readable_secondaries is not None:
            pulumi.set(__self__, "enable_readable_secondaries", enable_readable_secondaries)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if node_count is not None:
            pulumi.set(__self__, "node_count", node_count)
        if parent_instance_ref is not None:
            pulumi.set(__self__, "parent_instance_ref", parent_instance_ref)
        if pg_version is not None:
            pulumi.set(__self__, "pg_version", pg_version)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if purge_on_delete is not None:
            pulumi.set(__self__, "purge_on_delete", purge_on_delete)
        if read_only_dns is not None:
            pulumi.set(__self__, "read_only_dns", read_only_dns)
        if read_write_dns is not None:
            pulumi.set(__self__, "read_write_dns", read_write_dns)
        if retention_window_in_days is not None:
            pulumi.set(__self__, "retention_window_in_days", retention_window_in_days)
        if state is not None:
            pulumi.set(__self__, "state", state)
        if stopped is not None:
            pulumi.set(__self__, "stopped", stopped)
        if uid is not None:
            pulumi.set(__self__, "uid", uid)
        if usage_policy_id is not None:
            pulumi.set(__self__, "usage_policy_id", usage_policy_id)

    @_builtins.property
    @pulumi.getter
    def capacity(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        """
        return pulumi.get(self, "capacity")

    @capacity.setter
    def capacity(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "capacity", value)

    @_builtins.property
    @pulumi.getter(name="childInstanceRefs")
    def child_instance_refs(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceChildInstanceRefArgs']]]]:
        """
        (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
        parent instance
        """
        return pulumi.get(self, "child_instance_refs")

    @child_instance_refs.setter
    def child_instance_refs(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceChildInstanceRefArgs']]]]):
        pulumi.set(self, "child_instance_refs", value)

    @_builtins.property
    @pulumi.getter(name="creationTime")
    def creation_time(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The timestamp when the instance was created
        """
        return pulumi.get(self, "creation_time")

    @creation_time.setter
    def creation_time(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "creation_time", value)

    @_builtins.property
    @pulumi.getter
    def creator(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The email of the creator of the instance
        """
        return pulumi.get(self, "creator")

    @creator.setter
    def creator(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "creator", value)

    @_builtins.property
    @pulumi.getter(name="customTags")
    def custom_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]]:
        """
        Custom tags associated with the instance. This field is only included on create and update responses
        """
        return pulumi.get(self, "custom_tags")

    @custom_tags.setter
    def custom_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceCustomTagArgs']]]]):
        pulumi.set(self, "custom_tags", value)

    @_builtins.property
    @pulumi.getter(name="effectiveCapacity")
    def effective_capacity(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_capacity")

    @effective_capacity.setter
    def effective_capacity(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "effective_capacity", value)

    @_builtins.property
    @pulumi.getter(name="effectiveCustomTags")
    def effective_custom_tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceEffectiveCustomTagArgs']]]]:
        """
        (list of CustomTag) - The recorded custom tags associated with the instance.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_custom_tags")

    @effective_custom_tags.setter
    def effective_custom_tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['DatabaseInstanceEffectiveCustomTagArgs']]]]):
        pulumi.set(self, "effective_custom_tags", value)

    @_builtins.property
    @pulumi.getter(name="effectiveEnablePgNativeLogin")
    def effective_enable_pg_native_login(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        (boolean) - Whether the instance has PG native password login enabled.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_enable_pg_native_login")

    @effective_enable_pg_native_login.setter
    def effective_enable_pg_native_login(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "effective_enable_pg_native_login", value)

    @_builtins.property
    @pulumi.getter(name="effectiveEnableReadableSecondaries")
    def effective_enable_readable_secondaries(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_enable_readable_secondaries")

    @effective_enable_readable_secondaries.setter
    def effective_enable_readable_secondaries(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "effective_enable_readable_secondaries", value)

    @_builtins.property
    @pulumi.getter(name="effectiveNodeCount")
    def effective_node_count(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
        1 primary and 0 secondaries.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_node_count")

    @effective_node_count.setter
    def effective_node_count(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "effective_node_count", value)

    @_builtins.property
    @pulumi.getter(name="effectiveRetentionWindowInDays")
    def effective_retention_window_in_days(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        (integer) - The retention window for the instance. This is the time window in days
        for which the historical data is retained.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_retention_window_in_days")

    @effective_retention_window_in_days.setter
    def effective_retention_window_in_days(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "effective_retention_window_in_days", value)

    @_builtins.property
    @pulumi.getter(name="effectiveStopped")
    def effective_stopped(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        (boolean) - Whether the instance is stopped.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_stopped")

    @effective_stopped.setter
    def effective_stopped(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "effective_stopped", value)

    @_builtins.property
    @pulumi.getter(name="effectiveUsagePolicyId")
    def effective_usage_policy_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The policy that is applied to the instance.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_usage_policy_id")

    @effective_usage_policy_id.setter
    def effective_usage_policy_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "effective_usage_policy_id", value)

    @_builtins.property
    @pulumi.getter(name="enablePgNativeLogin")
    def enable_pg_native_login(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to enable PG native password login on the instance. Defaults to false
        """
        return pulumi.get(self, "enable_pg_native_login")

    @enable_pg_native_login.setter
    def enable_pg_native_login(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enable_pg_native_login", value)

    @_builtins.property
    @pulumi.getter(name="enableReadableSecondaries")
    def enable_readable_secondaries(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to enable secondaries to serve read-only traffic. Defaults to false
        """
        return pulumi.get(self, "enable_readable_secondaries")

    @enable_readable_secondaries.setter
    def enable_readable_secondaries(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "enable_readable_secondaries", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the instance. This is the unique identifier for the instance
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="nodeCount")
    def node_count(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
        1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        """
        return pulumi.get(self, "node_count")

    @node_count.setter
    def node_count(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "node_count", value)

    @_builtins.property
    @pulumi.getter(name="parentInstanceRef")
    def parent_instance_ref(self) -> Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']]:
        """
        The ref of the parent instance. This is only available if the instance is
        child instance.
        Input: For specifying the parent instance to create a child instance. Optional.
        Output: Only populated if provided as input to create a child instance
        """
        return pulumi.get(self, "parent_instance_ref")

    @parent_instance_ref.setter
    def parent_instance_ref(self, value: Optional[pulumi.Input['DatabaseInstanceParentInstanceRefArgs']]):
        pulumi.set(self, "parent_instance_ref", value)

    @_builtins.property
    @pulumi.getter(name="pgVersion")
    def pg_version(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The version of Postgres running on the instance
        """
        return pulumi.get(self, "pg_version")

    @pg_version.setter
    def pg_version(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "pg_version", value)

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

    @provider_config.setter
    def provider_config(self, value: Optional[pulumi.Input['DatabaseInstanceProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="purgeOnDelete")
    def purge_on_delete(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Purge the resource on delete
        """
        return pulumi.get(self, "purge_on_delete")

    @purge_on_delete.setter
    def purge_on_delete(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "purge_on_delete", value)

    @_builtins.property
    @pulumi.getter(name="readOnlyDns")
    def read_only_dns(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
        enable_readable_secondaries is true
        """
        return pulumi.get(self, "read_only_dns")

    @read_only_dns.setter
    def read_only_dns(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "read_only_dns", value)

    @_builtins.property
    @pulumi.getter(name="readWriteDns")
    def read_write_dns(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The DNS endpoint to connect to the instance for read+write access
        """
        return pulumi.get(self, "read_write_dns")

    @read_write_dns.setter
    def read_write_dns(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "read_write_dns", value)

    @_builtins.property
    @pulumi.getter(name="retentionWindowInDays")
    def retention_window_in_days(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The retention window for the instance. This is the time window in days
        for which the historical data is retained. The default value is 7 days.
        Valid values are 2 to 35 days
        """
        return pulumi.get(self, "retention_window_in_days")

    @retention_window_in_days.setter
    def retention_window_in_days(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "retention_window_in_days", value)

    @_builtins.property
    @pulumi.getter
    def state(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
        """
        return pulumi.get(self, "state")

    @state.setter
    def state(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "state", value)

    @_builtins.property
    @pulumi.getter
    def stopped(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to stop the instance. An input only param, see effective_stopped for the output
        """
        return pulumi.get(self, "stopped")

    @stopped.setter
    def stopped(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "stopped", value)

    @_builtins.property
    @pulumi.getter
    def uid(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - Id of the ref database instance
        """
        return pulumi.get(self, "uid")

    @uid.setter
    def uid(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "uid", value)

    @_builtins.property
    @pulumi.getter(name="usagePolicyId")
    def usage_policy_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The desired usage policy to associate with the instance
        """
        return pulumi.get(self, "usage_policy_id")

    @usage_policy_id.setter
    def usage_policy_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "usage_policy_id", value)


@pulumi.type_token("databricks:index/databaseInstance:DatabaseInstance")
class DatabaseInstance(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 capacity: Optional[pulumi.Input[_builtins.str]] = None,
                 custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceCustomTagArgs', 'DatabaseInstanceCustomTagArgsDict']]]]] = None,
                 enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
                 enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 node_count: Optional[pulumi.Input[_builtins.int]] = None,
                 parent_instance_ref: Optional[pulumi.Input[Union['DatabaseInstanceParentInstanceRefArgs', 'DatabaseInstanceParentInstanceRefArgsDict']]] = None,
                 provider_config: Optional[pulumi.Input[Union['DatabaseInstanceProviderConfigArgs', 'DatabaseInstanceProviderConfigArgsDict']]] = None,
                 purge_on_delete: Optional[pulumi.Input[_builtins.bool]] = None,
                 retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
                 stopped: Optional[pulumi.Input[_builtins.bool]] = None,
                 usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

        Lakebase Database Instances are managed Postgres instances, composed of a primary Postgres compute instance and 0 or more read replica instances.

        ## Example Usage

        ### Basic Example

        This example creates a simple Database Instance with the specified name and capacity.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_2")
        ```

        ### Example with Readable Secondaries

        This example creates a Database Instance with readable secondaries (and HA) enabled.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_2",
            node_count=2,
            enable_readable_secondaries=True)
        ```

        ### Example Child Instance Created From Parent

        This example creates a child Database Instance from a specified parent Database Instance at the current point in time.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        child = databricks.DatabaseInstance("child",
            name="my-database-instance",
            capacity="CU_2",
            parent_instance_ref={
                "name": "my-parent-instance",
            })
        ```

        ### Example with a usage policy and custom tags

        This example creates a Database Instance with an associated usage policy and custom tags.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_8",
            usage_policy_id="948192fa-a98b-498f-a09b-ecee79d8b983",
            custom_tags=[
                {
                    "key": "custom_tag_key1",
                    "value": "custom_tag_value1",
                },
                {
                    "key": "custom_tag_key2",
                    "value": "custom_tag_value2",
                },
            ])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] capacity: The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        :param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceCustomTagArgs', 'DatabaseInstanceCustomTagArgsDict']]]] custom_tags: Custom tags associated with the instance. This field is only included on create and update responses
        :param pulumi.Input[_builtins.bool] enable_pg_native_login: Whether to enable PG native password login on the instance. Defaults to false
        :param pulumi.Input[_builtins.bool] enable_readable_secondaries: Whether to enable secondaries to serve read-only traffic. Defaults to false
        :param pulumi.Input[_builtins.str] name: The name of the instance. This is the unique identifier for the instance
        :param pulumi.Input[_builtins.int] node_count: The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        :param pulumi.Input[Union['DatabaseInstanceParentInstanceRefArgs', 'DatabaseInstanceParentInstanceRefArgsDict']] parent_instance_ref: The ref of the parent instance. This is only available if the instance is
               child instance.
               Input: For specifying the parent instance to create a child instance. Optional.
               Output: Only populated if provided as input to create a child instance
        :param pulumi.Input[Union['DatabaseInstanceProviderConfigArgs', 'DatabaseInstanceProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.bool] purge_on_delete: Purge the resource on delete
        :param pulumi.Input[_builtins.int] retention_window_in_days: The retention window for the instance. This is the time window in days
               for which the historical data is retained. The default value is 7 days.
               Valid values are 2 to 35 days
        :param pulumi.Input[_builtins.bool] stopped: Whether to stop the instance. An input only param, see effective_stopped for the output
        :param pulumi.Input[_builtins.str] usage_policy_id: The desired usage policy to associate with the instance
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[DatabaseInstanceArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        [![Public Preview](https://img.shields.io/badge/Release_Stage-Public_Preview-yellowgreen)](https://docs.databricks.com/aws/en/release-notes/release-types)

        Lakebase Database Instances are managed Postgres instances, composed of a primary Postgres compute instance and 0 or more read replica instances.

        ## Example Usage

        ### Basic Example

        This example creates a simple Database Instance with the specified name and capacity.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_2")
        ```

        ### Example with Readable Secondaries

        This example creates a Database Instance with readable secondaries (and HA) enabled.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_2",
            node_count=2,
            enable_readable_secondaries=True)
        ```

        ### Example Child Instance Created From Parent

        This example creates a child Database Instance from a specified parent Database Instance at the current point in time.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        child = databricks.DatabaseInstance("child",
            name="my-database-instance",
            capacity="CU_2",
            parent_instance_ref={
                "name": "my-parent-instance",
            })
        ```

        ### Example with a usage policy and custom tags

        This example creates a Database Instance with an associated usage policy and custom tags.

        ```python
        import pulumi
        import pulumi_databricks as databricks

        this = databricks.DatabaseInstance("this",
            name="my-database-instance",
            capacity="CU_8",
            usage_policy_id="948192fa-a98b-498f-a09b-ecee79d8b983",
            custom_tags=[
                {
                    "key": "custom_tag_key1",
                    "value": "custom_tag_value1",
                },
                {
                    "key": "custom_tag_key2",
                    "value": "custom_tag_value2",
                },
            ])
        ```

        :param str resource_name: The name of the resource.
        :param DatabaseInstanceArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DatabaseInstanceArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 capacity: Optional[pulumi.Input[_builtins.str]] = None,
                 custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceCustomTagArgs', 'DatabaseInstanceCustomTagArgsDict']]]]] = None,
                 enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
                 enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 node_count: Optional[pulumi.Input[_builtins.int]] = None,
                 parent_instance_ref: Optional[pulumi.Input[Union['DatabaseInstanceParentInstanceRefArgs', 'DatabaseInstanceParentInstanceRefArgsDict']]] = None,
                 provider_config: Optional[pulumi.Input[Union['DatabaseInstanceProviderConfigArgs', 'DatabaseInstanceProviderConfigArgsDict']]] = None,
                 purge_on_delete: Optional[pulumi.Input[_builtins.bool]] = None,
                 retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
                 stopped: Optional[pulumi.Input[_builtins.bool]] = None,
                 usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = DatabaseInstanceArgs.__new__(DatabaseInstanceArgs)

            __props__.__dict__["capacity"] = capacity
            __props__.__dict__["custom_tags"] = custom_tags
            __props__.__dict__["enable_pg_native_login"] = enable_pg_native_login
            __props__.__dict__["enable_readable_secondaries"] = enable_readable_secondaries
            __props__.__dict__["name"] = name
            __props__.__dict__["node_count"] = node_count
            __props__.__dict__["parent_instance_ref"] = parent_instance_ref
            __props__.__dict__["provider_config"] = provider_config
            __props__.__dict__["purge_on_delete"] = purge_on_delete
            __props__.__dict__["retention_window_in_days"] = retention_window_in_days
            __props__.__dict__["stopped"] = stopped
            __props__.__dict__["usage_policy_id"] = usage_policy_id
            __props__.__dict__["child_instance_refs"] = None
            __props__.__dict__["creation_time"] = None
            __props__.__dict__["creator"] = None
            __props__.__dict__["effective_capacity"] = None
            __props__.__dict__["effective_custom_tags"] = None
            __props__.__dict__["effective_enable_pg_native_login"] = None
            __props__.__dict__["effective_enable_readable_secondaries"] = None
            __props__.__dict__["effective_node_count"] = None
            __props__.__dict__["effective_retention_window_in_days"] = None
            __props__.__dict__["effective_stopped"] = None
            __props__.__dict__["effective_usage_policy_id"] = None
            __props__.__dict__["pg_version"] = None
            __props__.__dict__["read_only_dns"] = None
            __props__.__dict__["read_write_dns"] = None
            __props__.__dict__["state"] = None
            __props__.__dict__["uid"] = None
        super(DatabaseInstance, __self__).__init__(
            'databricks:index/databaseInstance:DatabaseInstance',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            capacity: Optional[pulumi.Input[_builtins.str]] = None,
            child_instance_refs: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceChildInstanceRefArgs', 'DatabaseInstanceChildInstanceRefArgsDict']]]]] = None,
            creation_time: Optional[pulumi.Input[_builtins.str]] = None,
            creator: Optional[pulumi.Input[_builtins.str]] = None,
            custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceCustomTagArgs', 'DatabaseInstanceCustomTagArgsDict']]]]] = None,
            effective_capacity: Optional[pulumi.Input[_builtins.str]] = None,
            effective_custom_tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceEffectiveCustomTagArgs', 'DatabaseInstanceEffectiveCustomTagArgsDict']]]]] = None,
            effective_enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
            effective_enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
            effective_node_count: Optional[pulumi.Input[_builtins.int]] = None,
            effective_retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
            effective_stopped: Optional[pulumi.Input[_builtins.bool]] = None,
            effective_usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None,
            enable_pg_native_login: Optional[pulumi.Input[_builtins.bool]] = None,
            enable_readable_secondaries: Optional[pulumi.Input[_builtins.bool]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            node_count: Optional[pulumi.Input[_builtins.int]] = None,
            parent_instance_ref: Optional[pulumi.Input[Union['DatabaseInstanceParentInstanceRefArgs', 'DatabaseInstanceParentInstanceRefArgsDict']]] = None,
            pg_version: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['DatabaseInstanceProviderConfigArgs', 'DatabaseInstanceProviderConfigArgsDict']]] = None,
            purge_on_delete: Optional[pulumi.Input[_builtins.bool]] = None,
            read_only_dns: Optional[pulumi.Input[_builtins.str]] = None,
            read_write_dns: Optional[pulumi.Input[_builtins.str]] = None,
            retention_window_in_days: Optional[pulumi.Input[_builtins.int]] = None,
            state: Optional[pulumi.Input[_builtins.str]] = None,
            stopped: Optional[pulumi.Input[_builtins.bool]] = None,
            uid: Optional[pulumi.Input[_builtins.str]] = None,
            usage_policy_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'DatabaseInstance':
        """
        Get an existing DatabaseInstance resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] capacity: The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        :param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceChildInstanceRefArgs', 'DatabaseInstanceChildInstanceRefArgsDict']]]] child_instance_refs: (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
               parent instance
        :param pulumi.Input[_builtins.str] creation_time: (string) - The timestamp when the instance was created
        :param pulumi.Input[_builtins.str] creator: (string) - The email of the creator of the instance
        :param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceCustomTagArgs', 'DatabaseInstanceCustomTagArgsDict']]]] custom_tags: Custom tags associated with the instance. This field is only included on create and update responses
        :param pulumi.Input[_builtins.str] effective_capacity: (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[Sequence[pulumi.Input[Union['DatabaseInstanceEffectiveCustomTagArgs', 'DatabaseInstanceEffectiveCustomTagArgsDict']]]] effective_custom_tags: (list of CustomTag) - The recorded custom tags associated with the instance.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_enable_pg_native_login: (boolean) - Whether the instance has PG native password login enabled.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_enable_readable_secondaries: (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.int] effective_node_count: (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.int] effective_retention_window_in_days: (integer) - The retention window for the instance. This is the time window in days
               for which the historical data is retained.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] effective_stopped: (boolean) - Whether the instance is stopped.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.str] effective_usage_policy_id: (string) - The policy that is applied to the instance.
               This is an output only field that contains the value computed from the input field combined with
               server side defaults. Use the field without the effective_ prefix to set the value
        :param pulumi.Input[_builtins.bool] enable_pg_native_login: Whether to enable PG native password login on the instance. Defaults to false
        :param pulumi.Input[_builtins.bool] enable_readable_secondaries: Whether to enable secondaries to serve read-only traffic. Defaults to false
        :param pulumi.Input[_builtins.str] name: The name of the instance. This is the unique identifier for the instance
        :param pulumi.Input[_builtins.int] node_count: The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
               1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        :param pulumi.Input[Union['DatabaseInstanceParentInstanceRefArgs', 'DatabaseInstanceParentInstanceRefArgsDict']] parent_instance_ref: The ref of the parent instance. This is only available if the instance is
               child instance.
               Input: For specifying the parent instance to create a child instance. Optional.
               Output: Only populated if provided as input to create a child instance
        :param pulumi.Input[_builtins.str] pg_version: (string) - The version of Postgres running on the instance
        :param pulumi.Input[Union['DatabaseInstanceProviderConfigArgs', 'DatabaseInstanceProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.bool] purge_on_delete: Purge the resource on delete
        :param pulumi.Input[_builtins.str] read_only_dns: (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
               enable_readable_secondaries is true
        :param pulumi.Input[_builtins.str] read_write_dns: (string) - The DNS endpoint to connect to the instance for read+write access
        :param pulumi.Input[_builtins.int] retention_window_in_days: The retention window for the instance. This is the time window in days
               for which the historical data is retained. The default value is 7 days.
               Valid values are 2 to 35 days
        :param pulumi.Input[_builtins.str] state: (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
        :param pulumi.Input[_builtins.bool] stopped: Whether to stop the instance. An input only param, see effective_stopped for the output
        :param pulumi.Input[_builtins.str] uid: (string) - Id of the ref database instance
        :param pulumi.Input[_builtins.str] usage_policy_id: The desired usage policy to associate with the instance
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _DatabaseInstanceState.__new__(_DatabaseInstanceState)

        __props__.__dict__["capacity"] = capacity
        __props__.__dict__["child_instance_refs"] = child_instance_refs
        __props__.__dict__["creation_time"] = creation_time
        __props__.__dict__["creator"] = creator
        __props__.__dict__["custom_tags"] = custom_tags
        __props__.__dict__["effective_capacity"] = effective_capacity
        __props__.__dict__["effective_custom_tags"] = effective_custom_tags
        __props__.__dict__["effective_enable_pg_native_login"] = effective_enable_pg_native_login
        __props__.__dict__["effective_enable_readable_secondaries"] = effective_enable_readable_secondaries
        __props__.__dict__["effective_node_count"] = effective_node_count
        __props__.__dict__["effective_retention_window_in_days"] = effective_retention_window_in_days
        __props__.__dict__["effective_stopped"] = effective_stopped
        __props__.__dict__["effective_usage_policy_id"] = effective_usage_policy_id
        __props__.__dict__["enable_pg_native_login"] = enable_pg_native_login
        __props__.__dict__["enable_readable_secondaries"] = enable_readable_secondaries
        __props__.__dict__["name"] = name
        __props__.__dict__["node_count"] = node_count
        __props__.__dict__["parent_instance_ref"] = parent_instance_ref
        __props__.__dict__["pg_version"] = pg_version
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["purge_on_delete"] = purge_on_delete
        __props__.__dict__["read_only_dns"] = read_only_dns
        __props__.__dict__["read_write_dns"] = read_write_dns
        __props__.__dict__["retention_window_in_days"] = retention_window_in_days
        __props__.__dict__["state"] = state
        __props__.__dict__["stopped"] = stopped
        __props__.__dict__["uid"] = uid
        __props__.__dict__["usage_policy_id"] = usage_policy_id
        return DatabaseInstance(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def capacity(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The sku of the instance. Valid values are "CU_1", "CU_2", "CU_4", "CU_8"
        """
        return pulumi.get(self, "capacity")

    @_builtins.property
    @pulumi.getter(name="childInstanceRefs")
    def child_instance_refs(self) -> pulumi.Output[Sequence['outputs.DatabaseInstanceChildInstanceRef']]:
        """
        (list of DatabaseInstanceRef) - The refs of the child instances. This is only available if the instance is
        parent instance
        """
        return pulumi.get(self, "child_instance_refs")

    @_builtins.property
    @pulumi.getter(name="creationTime")
    def creation_time(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The timestamp when the instance was created
        """
        return pulumi.get(self, "creation_time")

    @_builtins.property
    @pulumi.getter
    def creator(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The email of the creator of the instance
        """
        return pulumi.get(self, "creator")

    @_builtins.property
    @pulumi.getter(name="customTags")
    def custom_tags(self) -> pulumi.Output[Sequence['outputs.DatabaseInstanceCustomTag']]:
        """
        Custom tags associated with the instance. This field is only included on create and update responses
        """
        return pulumi.get(self, "custom_tags")

    @_builtins.property
    @pulumi.getter(name="effectiveCapacity")
    def effective_capacity(self) -> pulumi.Output[_builtins.str]:
        """
        (string, deprecated) - Deprecated. The sku of the instance; this field will always match the value of capacity.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_capacity")

    @_builtins.property
    @pulumi.getter(name="effectiveCustomTags")
    def effective_custom_tags(self) -> pulumi.Output[Sequence['outputs.DatabaseInstanceEffectiveCustomTag']]:
        """
        (list of CustomTag) - The recorded custom tags associated with the instance.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_custom_tags")

    @_builtins.property
    @pulumi.getter(name="effectiveEnablePgNativeLogin")
    def effective_enable_pg_native_login(self) -> pulumi.Output[_builtins.bool]:
        """
        (boolean) - Whether the instance has PG native password login enabled.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_enable_pg_native_login")

    @_builtins.property
    @pulumi.getter(name="effectiveEnableReadableSecondaries")
    def effective_enable_readable_secondaries(self) -> pulumi.Output[_builtins.bool]:
        """
        (boolean) - Whether secondaries serving read-only traffic are enabled. Defaults to false.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_enable_readable_secondaries")

    @_builtins.property
    @pulumi.getter(name="effectiveNodeCount")
    def effective_node_count(self) -> pulumi.Output[_builtins.int]:
        """
        (integer) - The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
        1 primary and 0 secondaries.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_node_count")

    @_builtins.property
    @pulumi.getter(name="effectiveRetentionWindowInDays")
    def effective_retention_window_in_days(self) -> pulumi.Output[_builtins.int]:
        """
        (integer) - The retention window for the instance. This is the time window in days
        for which the historical data is retained.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_retention_window_in_days")

    @_builtins.property
    @pulumi.getter(name="effectiveStopped")
    def effective_stopped(self) -> pulumi.Output[_builtins.bool]:
        """
        (boolean) - Whether the instance is stopped.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_stopped")

    @_builtins.property
    @pulumi.getter(name="effectiveUsagePolicyId")
    def effective_usage_policy_id(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The policy that is applied to the instance.
        This is an output only field that contains the value computed from the input field combined with
        server side defaults. Use the field without the effective_ prefix to set the value
        """
        return pulumi.get(self, "effective_usage_policy_id")

    @_builtins.property
    @pulumi.getter(name="enablePgNativeLogin")
    def enable_pg_native_login(self) -> pulumi.Output[_builtins.bool]:
        """
        Whether to enable PG native password login on the instance. Defaults to false
        """
        return pulumi.get(self, "enable_pg_native_login")

    @_builtins.property
    @pulumi.getter(name="enableReadableSecondaries")
    def enable_readable_secondaries(self) -> pulumi.Output[_builtins.bool]:
        """
        Whether to enable secondaries to serve read-only traffic. Defaults to false
        """
        return pulumi.get(self, "enable_readable_secondaries")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the instance. This is the unique identifier for the instance
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="nodeCount")
    def node_count(self) -> pulumi.Output[_builtins.int]:
        """
        The number of nodes in the instance, composed of 1 primary and 0 or more secondaries. Defaults to
        1 primary and 0 secondaries. This field is input only, see effective_node_count for the output
        """
        return pulumi.get(self, "node_count")

    @_builtins.property
    @pulumi.getter(name="parentInstanceRef")
    def parent_instance_ref(self) -> pulumi.Output[Optional['outputs.DatabaseInstanceParentInstanceRef']]:
        """
        The ref of the parent instance. This is only available if the instance is
        child instance.
        Input: For specifying the parent instance to create a child instance. Optional.
        Output: Only populated if provided as input to create a child instance
        """
        return pulumi.get(self, "parent_instance_ref")

    @_builtins.property
    @pulumi.getter(name="pgVersion")
    def pg_version(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The version of Postgres running on the instance
        """
        return pulumi.get(self, "pg_version")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> pulumi.Output[Optional['outputs.DatabaseInstanceProviderConfig']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter(name="purgeOnDelete")
    def purge_on_delete(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Purge the resource on delete
        """
        return pulumi.get(self, "purge_on_delete")

    @_builtins.property
    @pulumi.getter(name="readOnlyDns")
    def read_only_dns(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The DNS endpoint to connect to the instance for read only access. This is only available if
        enable_readable_secondaries is true
        """
        return pulumi.get(self, "read_only_dns")

    @_builtins.property
    @pulumi.getter(name="readWriteDns")
    def read_write_dns(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The DNS endpoint to connect to the instance for read+write access
        """
        return pulumi.get(self, "read_write_dns")

    @_builtins.property
    @pulumi.getter(name="retentionWindowInDays")
    def retention_window_in_days(self) -> pulumi.Output[_builtins.int]:
        """
        The retention window for the instance. This is the time window in days
        for which the historical data is retained. The default value is 7 days.
        Valid values are 2 to 35 days
        """
        return pulumi.get(self, "retention_window_in_days")

    @_builtins.property
    @pulumi.getter
    def state(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The current state of the instance. Possible values are: `AVAILABLE`, `DELETING`, `FAILING_OVER`, `STARTING`, `STOPPED`, `UPDATING`
        """
        return pulumi.get(self, "state")

    @_builtins.property
    @pulumi.getter
    def stopped(self) -> pulumi.Output[_builtins.bool]:
        """
        Whether to stop the instance. An input only param, see effective_stopped for the output
        """
        return pulumi.get(self, "stopped")

    @_builtins.property
    @pulumi.getter
    def uid(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - Id of the ref database instance
        """
        return pulumi.get(self, "uid")

    @_builtins.property
    @pulumi.getter(name="usagePolicyId")
    def usage_policy_id(self) -> pulumi.Output[_builtins.str]:
        """
        The desired usage policy to associate with the instance
        """
        return pulumi.get(self, "usage_policy_id")

