# 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__ = ['PostgresDatabaseArgs', 'PostgresDatabase']

@pulumi.input_type
class PostgresDatabaseArgs:
    def __init__(__self__, *,
                 parent: pulumi.Input[_builtins.str],
                 database_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['PostgresDatabaseProviderConfigArgs']] = None,
                 spec: Optional[pulumi.Input['PostgresDatabaseSpecArgs']] = None):
        """
        The set of arguments for constructing a PostgresDatabase resource.
        :param pulumi.Input[_builtins.str] parent: The branch containing this database.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input[_builtins.str] database_id: The ID to use for the Database, which will become the final component of
               the database's resource name.
               This ID becomes the database name in postgres.
               
               This value should be 4-63 characters, and only use characters available in DNS names,
               as defined by RFC-1123
               
               If database_id is not specified in the request, it is generated automatically
        :param pulumi.Input['PostgresDatabaseProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input['PostgresDatabaseSpecArgs'] spec: The desired state of the Database
        """
        pulumi.set(__self__, "parent", parent)
        if database_id is not None:
            pulumi.set(__self__, "database_id", database_id)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if spec is not None:
            pulumi.set(__self__, "spec", spec)

    @_builtins.property
    @pulumi.getter
    def parent(self) -> pulumi.Input[_builtins.str]:
        """
        The branch containing this database.
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "parent")

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

    @_builtins.property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID to use for the Database, which will become the final component of
        the database's resource name.
        This ID becomes the database name in postgres.

        This value should be 4-63 characters, and only use characters available in DNS names,
        as defined by RFC-1123

        If database_id is not specified in the request, it is generated automatically
        """
        return pulumi.get(self, "database_id")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PostgresDatabaseProviderConfigArgs']]:
        """
        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['PostgresDatabaseProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter
    def spec(self) -> Optional[pulumi.Input['PostgresDatabaseSpecArgs']]:
        """
        The desired state of the Database
        """
        return pulumi.get(self, "spec")

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


@pulumi.input_type
class _PostgresDatabaseState:
    def __init__(__self__, *,
                 create_time: Optional[pulumi.Input[_builtins.str]] = None,
                 database_id: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['PostgresDatabaseProviderConfigArgs']] = None,
                 spec: Optional[pulumi.Input['PostgresDatabaseSpecArgs']] = None,
                 status: Optional[pulumi.Input['PostgresDatabaseStatusArgs']] = None,
                 update_time: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering PostgresDatabase resources.
        :param pulumi.Input[_builtins.str] create_time: (string) - A timestamp indicating when the database was created
        :param pulumi.Input[_builtins.str] database_id: The ID to use for the Database, which will become the final component of
               the database's resource name.
               This ID becomes the database name in postgres.
               
               This value should be 4-63 characters, and only use characters available in DNS names,
               as defined by RFC-1123
               
               If database_id is not specified in the request, it is generated automatically
        :param pulumi.Input[_builtins.str] name: (string) - The resource name of the database.
               Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
        :param pulumi.Input[_builtins.str] parent: The branch containing this database.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input['PostgresDatabaseProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input['PostgresDatabaseSpecArgs'] spec: The desired state of the Database
        :param pulumi.Input['PostgresDatabaseStatusArgs'] status: (DatabaseDatabaseStatus) - The observed state of the Database
        :param pulumi.Input[_builtins.str] update_time: (string) - A timestamp indicating when the database was last updated
        """
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if database_id is not None:
            pulumi.set(__self__, "database_id", database_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if parent is not None:
            pulumi.set(__self__, "parent", parent)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if spec is not None:
            pulumi.set(__self__, "spec", spec)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if update_time is not None:
            pulumi.set(__self__, "update_time", update_time)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - A timestamp indicating when the database was created
        """
        return pulumi.get(self, "create_time")

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

    @_builtins.property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID to use for the Database, which will become the final component of
        the database's resource name.
        This ID becomes the database name in postgres.

        This value should be 4-63 characters, and only use characters available in DNS names,
        as defined by RFC-1123

        If database_id is not specified in the request, it is generated automatically
        """
        return pulumi.get(self, "database_id")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The resource name of the database.
        Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
        """
        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
    def parent(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The branch containing this database.
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "parent")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['PostgresDatabaseProviderConfigArgs']]:
        """
        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['PostgresDatabaseProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter
    def spec(self) -> Optional[pulumi.Input['PostgresDatabaseSpecArgs']]:
        """
        The desired state of the Database
        """
        return pulumi.get(self, "spec")

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

    @_builtins.property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input['PostgresDatabaseStatusArgs']]:
        """
        (DatabaseDatabaseStatus) - The observed state of the Database
        """
        return pulumi.get(self, "status")

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

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - A timestamp indicating when the database was last updated
        """
        return pulumi.get(self, "update_time")

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


@pulumi.type_token("databricks:index/postgresDatabase:PostgresDatabase")
class PostgresDatabase(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 database_id: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PostgresDatabaseProviderConfigArgs', 'PostgresDatabaseProviderConfigArgsDict']]] = None,
                 spec: Optional[pulumi.Input[Union['PostgresDatabaseSpecArgs', 'PostgresDatabaseSpecArgsDict']]] = None,
                 __props__=None):
        """
        [![Private Preview](https://img.shields.io/badge/Release_Stage-Private_Preview-blueviolet)](https://docs.databricks.com/aws/en/release-notes/release-types)

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] database_id: The ID to use for the Database, which will become the final component of
               the database's resource name.
               This ID becomes the database name in postgres.
               
               This value should be 4-63 characters, and only use characters available in DNS names,
               as defined by RFC-1123
               
               If database_id is not specified in the request, it is generated automatically
        :param pulumi.Input[_builtins.str] parent: The branch containing this database.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input[Union['PostgresDatabaseProviderConfigArgs', 'PostgresDatabaseProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[Union['PostgresDatabaseSpecArgs', 'PostgresDatabaseSpecArgsDict']] spec: The desired state of the Database
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: PostgresDatabaseArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        [![Private Preview](https://img.shields.io/badge/Release_Stage-Private_Preview-blueviolet)](https://docs.databricks.com/aws/en/release-notes/release-types)

        :param str resource_name: The name of the resource.
        :param PostgresDatabaseArgs 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(PostgresDatabaseArgs, 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,
                 database_id: Optional[pulumi.Input[_builtins.str]] = None,
                 parent: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['PostgresDatabaseProviderConfigArgs', 'PostgresDatabaseProviderConfigArgsDict']]] = None,
                 spec: Optional[pulumi.Input[Union['PostgresDatabaseSpecArgs', 'PostgresDatabaseSpecArgsDict']]] = 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__ = PostgresDatabaseArgs.__new__(PostgresDatabaseArgs)

            __props__.__dict__["database_id"] = database_id
            if parent is None and not opts.urn:
                raise TypeError("Missing required property 'parent'")
            __props__.__dict__["parent"] = parent
            __props__.__dict__["provider_config"] = provider_config
            __props__.__dict__["spec"] = spec
            __props__.__dict__["create_time"] = None
            __props__.__dict__["name"] = None
            __props__.__dict__["status"] = None
            __props__.__dict__["update_time"] = None
        super(PostgresDatabase, __self__).__init__(
            'databricks:index/postgresDatabase:PostgresDatabase',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            create_time: Optional[pulumi.Input[_builtins.str]] = None,
            database_id: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            parent: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['PostgresDatabaseProviderConfigArgs', 'PostgresDatabaseProviderConfigArgsDict']]] = None,
            spec: Optional[pulumi.Input[Union['PostgresDatabaseSpecArgs', 'PostgresDatabaseSpecArgsDict']]] = None,
            status: Optional[pulumi.Input[Union['PostgresDatabaseStatusArgs', 'PostgresDatabaseStatusArgsDict']]] = None,
            update_time: Optional[pulumi.Input[_builtins.str]] = None) -> 'PostgresDatabase':
        """
        Get an existing PostgresDatabase 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] create_time: (string) - A timestamp indicating when the database was created
        :param pulumi.Input[_builtins.str] database_id: The ID to use for the Database, which will become the final component of
               the database's resource name.
               This ID becomes the database name in postgres.
               
               This value should be 4-63 characters, and only use characters available in DNS names,
               as defined by RFC-1123
               
               If database_id is not specified in the request, it is generated automatically
        :param pulumi.Input[_builtins.str] name: (string) - The resource name of the database.
               Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
        :param pulumi.Input[_builtins.str] parent: The branch containing this database.
               Format: projects/{project_id}/branches/{branch_id}
        :param pulumi.Input[Union['PostgresDatabaseProviderConfigArgs', 'PostgresDatabaseProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[Union['PostgresDatabaseSpecArgs', 'PostgresDatabaseSpecArgsDict']] spec: The desired state of the Database
        :param pulumi.Input[Union['PostgresDatabaseStatusArgs', 'PostgresDatabaseStatusArgsDict']] status: (DatabaseDatabaseStatus) - The observed state of the Database
        :param pulumi.Input[_builtins.str] update_time: (string) - A timestamp indicating when the database was last updated
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _PostgresDatabaseState.__new__(_PostgresDatabaseState)

        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["database_id"] = database_id
        __props__.__dict__["name"] = name
        __props__.__dict__["parent"] = parent
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["spec"] = spec
        __props__.__dict__["status"] = status
        __props__.__dict__["update_time"] = update_time
        return PostgresDatabase(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - A timestamp indicating when the database was created
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter(name="databaseId")
    def database_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID to use for the Database, which will become the final component of
        the database's resource name.
        This ID becomes the database name in postgres.

        This value should be 4-63 characters, and only use characters available in DNS names,
        as defined by RFC-1123

        If database_id is not specified in the request, it is generated automatically
        """
        return pulumi.get(self, "database_id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The resource name of the database.
        Format: projects/{project_id}/branches/{branch_id}/databases/{database_id}
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def parent(self) -> pulumi.Output[_builtins.str]:
        """
        The branch containing this database.
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "parent")

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

    @_builtins.property
    @pulumi.getter
    def spec(self) -> pulumi.Output['outputs.PostgresDatabaseSpec']:
        """
        The desired state of the Database
        """
        return pulumi.get(self, "spec")

    @_builtins.property
    @pulumi.getter
    def status(self) -> pulumi.Output['outputs.PostgresDatabaseStatus']:
        """
        (DatabaseDatabaseStatus) - The observed state of the Database
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - A timestamp indicating when the database was last updated
        """
        return pulumi.get(self, "update_time")

