# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = ['VirtualInstanceArgs', 'VirtualInstance']

@pulumi.input_type
class VirtualInstanceArgs:
    def __init__(__self__, *,
                 size: pulumi.Input[str],
                 auto_suspend_seconds: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 mount_refresh_interval_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 remount_on_resume: Optional[pulumi.Input[bool]] = None):
        """
        The set of arguments for constructing a VirtualInstance resource.
        :param pulumi.Input[str] size: Requested virtual instance size. Note that this field is called type in the API documentation.
        :param pulumi.Input[int] auto_suspend_seconds: Number of seconds without queries after which the Virtual Instance is suspended.
        :param pulumi.Input[str] description: Description of the virtual instance.
        :param pulumi.Input[int] mount_refresh_interval_seconds: Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        :param pulumi.Input[str] name: Name of the virtual instance.
        :param pulumi.Input[bool] remount_on_resume: When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        """
        pulumi.set(__self__, "size", size)
        if auto_suspend_seconds is not None:
            pulumi.set(__self__, "auto_suspend_seconds", auto_suspend_seconds)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if mount_refresh_interval_seconds is not None:
            pulumi.set(__self__, "mount_refresh_interval_seconds", mount_refresh_interval_seconds)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if remount_on_resume is not None:
            pulumi.set(__self__, "remount_on_resume", remount_on_resume)

    @property
    @pulumi.getter
    def size(self) -> pulumi.Input[str]:
        """
        Requested virtual instance size. Note that this field is called type in the API documentation.
        """
        return pulumi.get(self, "size")

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

    @property
    @pulumi.getter(name="autoSuspendSeconds")
    def auto_suspend_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        Number of seconds without queries after which the Virtual Instance is suspended.
        """
        return pulumi.get(self, "auto_suspend_seconds")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Description of the virtual instance.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="mountRefreshIntervalSeconds")
    def mount_refresh_interval_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        """
        return pulumi.get(self, "mount_refresh_interval_seconds")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the virtual instance.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="remountOnResume")
    def remount_on_resume(self) -> Optional[pulumi.Input[bool]]:
        """
        When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        """
        return pulumi.get(self, "remount_on_resume")

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


@pulumi.input_type
class _VirtualInstanceState:
    def __init__(__self__, *,
                 auto_suspend_seconds: Optional[pulumi.Input[int]] = None,
                 current_size: Optional[pulumi.Input[str]] = None,
                 default: Optional[pulumi.Input[bool]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 desired_size: Optional[pulumi.Input[str]] = None,
                 monitoring_enabled: Optional[pulumi.Input[bool]] = None,
                 mount_refresh_interval_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 remount_on_resume: Optional[pulumi.Input[bool]] = None,
                 rrn: Optional[pulumi.Input[str]] = None,
                 size: Optional[pulumi.Input[str]] = None,
                 state: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering VirtualInstance resources.
        :param pulumi.Input[int] auto_suspend_seconds: Number of seconds without queries after which the Virtual Instance is suspended.
        :param pulumi.Input[str] current_size: Current size of the virtual instance.
        :param pulumi.Input[bool] default: Is this Virtual Instance the default.
        :param pulumi.Input[str] description: Description of the virtual instance.
        :param pulumi.Input[str] desired_size: Desired size of the virtual instance.
        :param pulumi.Input[bool] monitoring_enabled: Is monitoring enabled for this Virtual Instance.
        :param pulumi.Input[int] mount_refresh_interval_seconds: Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        :param pulumi.Input[str] name: Name of the virtual instance.
        :param pulumi.Input[bool] remount_on_resume: When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        :param pulumi.Input[str] rrn: RRN of this Virtual Instance.
        :param pulumi.Input[str] size: Requested virtual instance size. Note that this field is called type in the API documentation.
        :param pulumi.Input[str] state: Virtual Instance state.
        """
        if auto_suspend_seconds is not None:
            pulumi.set(__self__, "auto_suspend_seconds", auto_suspend_seconds)
        if current_size is not None:
            pulumi.set(__self__, "current_size", current_size)
        if default is not None:
            pulumi.set(__self__, "default", default)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if desired_size is not None:
            pulumi.set(__self__, "desired_size", desired_size)
        if monitoring_enabled is not None:
            pulumi.set(__self__, "monitoring_enabled", monitoring_enabled)
        if mount_refresh_interval_seconds is not None:
            pulumi.set(__self__, "mount_refresh_interval_seconds", mount_refresh_interval_seconds)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if remount_on_resume is not None:
            pulumi.set(__self__, "remount_on_resume", remount_on_resume)
        if rrn is not None:
            pulumi.set(__self__, "rrn", rrn)
        if size is not None:
            pulumi.set(__self__, "size", size)
        if state is not None:
            pulumi.set(__self__, "state", state)

    @property
    @pulumi.getter(name="autoSuspendSeconds")
    def auto_suspend_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        Number of seconds without queries after which the Virtual Instance is suspended.
        """
        return pulumi.get(self, "auto_suspend_seconds")

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

    @property
    @pulumi.getter(name="currentSize")
    def current_size(self) -> Optional[pulumi.Input[str]]:
        """
        Current size of the virtual instance.
        """
        return pulumi.get(self, "current_size")

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

    @property
    @pulumi.getter
    def default(self) -> Optional[pulumi.Input[bool]]:
        """
        Is this Virtual Instance the default.
        """
        return pulumi.get(self, "default")

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

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Description of the virtual instance.
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="desiredSize")
    def desired_size(self) -> Optional[pulumi.Input[str]]:
        """
        Desired size of the virtual instance.
        """
        return pulumi.get(self, "desired_size")

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

    @property
    @pulumi.getter(name="monitoringEnabled")
    def monitoring_enabled(self) -> Optional[pulumi.Input[bool]]:
        """
        Is monitoring enabled for this Virtual Instance.
        """
        return pulumi.get(self, "monitoring_enabled")

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

    @property
    @pulumi.getter(name="mountRefreshIntervalSeconds")
    def mount_refresh_interval_seconds(self) -> Optional[pulumi.Input[int]]:
        """
        Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        """
        return pulumi.get(self, "mount_refresh_interval_seconds")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the virtual instance.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="remountOnResume")
    def remount_on_resume(self) -> Optional[pulumi.Input[bool]]:
        """
        When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        """
        return pulumi.get(self, "remount_on_resume")

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

    @property
    @pulumi.getter
    def rrn(self) -> Optional[pulumi.Input[str]]:
        """
        RRN of this Virtual Instance.
        """
        return pulumi.get(self, "rrn")

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

    @property
    @pulumi.getter
    def size(self) -> Optional[pulumi.Input[str]]:
        """
        Requested virtual instance size. Note that this field is called type in the API documentation.
        """
        return pulumi.get(self, "size")

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

    @property
    @pulumi.getter
    def state(self) -> Optional[pulumi.Input[str]]:
        """
        Virtual Instance state.
        """
        return pulumi.get(self, "state")

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


class VirtualInstance(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 auto_suspend_seconds: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 mount_refresh_interval_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 remount_on_resume: Optional[pulumi.Input[bool]] = None,
                 size: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Manages a Rockset Virtual Instance. To be able to create a new Virtual Instance,
        The main virtual instance must use a dedicated instance to create a secondary virtual instance,
        which must be SMALL or larger. To enable live mount, the secondary virtual instance must be MEDIUM or larger.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_rockset as rockset

        query = rockset.VirtualInstance("query",
            description="vi for executing query lambdas",
            size="MEDIUM",
            remount_on_resume=True)
        patch = rockset.CollectionMount("patch",
            virtual_instance_id=query.id,
            path="commons.data")
        ```

        ## Import

        ```sh
         $ pulumi import rockset:index/virtualInstance:VirtualInstance query 29e4a43c-fff4-4fe6-80e3-1ee57bc22e82
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] auto_suspend_seconds: Number of seconds without queries after which the Virtual Instance is suspended.
        :param pulumi.Input[str] description: Description of the virtual instance.
        :param pulumi.Input[int] mount_refresh_interval_seconds: Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        :param pulumi.Input[str] name: Name of the virtual instance.
        :param pulumi.Input[bool] remount_on_resume: When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        :param pulumi.Input[str] size: Requested virtual instance size. Note that this field is called type in the API documentation.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: VirtualInstanceArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a Rockset Virtual Instance. To be able to create a new Virtual Instance,
        The main virtual instance must use a dedicated instance to create a secondary virtual instance,
        which must be SMALL or larger. To enable live mount, the secondary virtual instance must be MEDIUM or larger.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_rockset as rockset

        query = rockset.VirtualInstance("query",
            description="vi for executing query lambdas",
            size="MEDIUM",
            remount_on_resume=True)
        patch = rockset.CollectionMount("patch",
            virtual_instance_id=query.id,
            path="commons.data")
        ```

        ## Import

        ```sh
         $ pulumi import rockset:index/virtualInstance:VirtualInstance query 29e4a43c-fff4-4fe6-80e3-1ee57bc22e82
        ```

        :param str resource_name: The name of the resource.
        :param VirtualInstanceArgs 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(VirtualInstanceArgs, 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,
                 auto_suspend_seconds: Optional[pulumi.Input[int]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 mount_refresh_interval_seconds: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 remount_on_resume: Optional[pulumi.Input[bool]] = None,
                 size: Optional[pulumi.Input[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__ = VirtualInstanceArgs.__new__(VirtualInstanceArgs)

            __props__.__dict__["auto_suspend_seconds"] = auto_suspend_seconds
            __props__.__dict__["description"] = description
            __props__.__dict__["mount_refresh_interval_seconds"] = mount_refresh_interval_seconds
            __props__.__dict__["name"] = name
            __props__.__dict__["remount_on_resume"] = remount_on_resume
            if size is None and not opts.urn:
                raise TypeError("Missing required property 'size'")
            __props__.__dict__["size"] = size
            __props__.__dict__["current_size"] = None
            __props__.__dict__["default"] = None
            __props__.__dict__["desired_size"] = None
            __props__.__dict__["monitoring_enabled"] = None
            __props__.__dict__["rrn"] = None
            __props__.__dict__["state"] = None
        super(VirtualInstance, __self__).__init__(
            'rockset:index/virtualInstance:VirtualInstance',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            auto_suspend_seconds: Optional[pulumi.Input[int]] = None,
            current_size: Optional[pulumi.Input[str]] = None,
            default: Optional[pulumi.Input[bool]] = None,
            description: Optional[pulumi.Input[str]] = None,
            desired_size: Optional[pulumi.Input[str]] = None,
            monitoring_enabled: Optional[pulumi.Input[bool]] = None,
            mount_refresh_interval_seconds: Optional[pulumi.Input[int]] = None,
            name: Optional[pulumi.Input[str]] = None,
            remount_on_resume: Optional[pulumi.Input[bool]] = None,
            rrn: Optional[pulumi.Input[str]] = None,
            size: Optional[pulumi.Input[str]] = None,
            state: Optional[pulumi.Input[str]] = None) -> 'VirtualInstance':
        """
        Get an existing VirtualInstance 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[int] auto_suspend_seconds: Number of seconds without queries after which the Virtual Instance is suspended.
        :param pulumi.Input[str] current_size: Current size of the virtual instance.
        :param pulumi.Input[bool] default: Is this Virtual Instance the default.
        :param pulumi.Input[str] description: Description of the virtual instance.
        :param pulumi.Input[str] desired_size: Desired size of the virtual instance.
        :param pulumi.Input[bool] monitoring_enabled: Is monitoring enabled for this Virtual Instance.
        :param pulumi.Input[int] mount_refresh_interval_seconds: Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        :param pulumi.Input[str] name: Name of the virtual instance.
        :param pulumi.Input[bool] remount_on_resume: When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        :param pulumi.Input[str] rrn: RRN of this Virtual Instance.
        :param pulumi.Input[str] size: Requested virtual instance size. Note that this field is called type in the API documentation.
        :param pulumi.Input[str] state: Virtual Instance state.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _VirtualInstanceState.__new__(_VirtualInstanceState)

        __props__.__dict__["auto_suspend_seconds"] = auto_suspend_seconds
        __props__.__dict__["current_size"] = current_size
        __props__.__dict__["default"] = default
        __props__.__dict__["description"] = description
        __props__.__dict__["desired_size"] = desired_size
        __props__.__dict__["monitoring_enabled"] = monitoring_enabled
        __props__.__dict__["mount_refresh_interval_seconds"] = mount_refresh_interval_seconds
        __props__.__dict__["name"] = name
        __props__.__dict__["remount_on_resume"] = remount_on_resume
        __props__.__dict__["rrn"] = rrn
        __props__.__dict__["size"] = size
        __props__.__dict__["state"] = state
        return VirtualInstance(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="autoSuspendSeconds")
    def auto_suspend_seconds(self) -> pulumi.Output[Optional[int]]:
        """
        Number of seconds without queries after which the Virtual Instance is suspended.
        """
        return pulumi.get(self, "auto_suspend_seconds")

    @property
    @pulumi.getter(name="currentSize")
    def current_size(self) -> pulumi.Output[str]:
        """
        Current size of the virtual instance.
        """
        return pulumi.get(self, "current_size")

    @property
    @pulumi.getter
    def default(self) -> pulumi.Output[bool]:
        """
        Is this Virtual Instance the default.
        """
        return pulumi.get(self, "default")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Description of the virtual instance.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="desiredSize")
    def desired_size(self) -> pulumi.Output[str]:
        """
        Desired size of the virtual instance.
        """
        return pulumi.get(self, "desired_size")

    @property
    @pulumi.getter(name="monitoringEnabled")
    def monitoring_enabled(self) -> pulumi.Output[bool]:
        """
        Is monitoring enabled for this Virtual Instance.
        """
        return pulumi.get(self, "monitoring_enabled")

    @property
    @pulumi.getter(name="mountRefreshIntervalSeconds")
    def mount_refresh_interval_seconds(self) -> pulumi.Output[Optional[int]]:
        """
        Number of seconds between data refreshes for mounts on this Virtual Instance. A value of 0 means continuous refresh and a value of null means never refresh.
        """
        return pulumi.get(self, "mount_refresh_interval_seconds")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Name of the virtual instance.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="remountOnResume")
    def remount_on_resume(self) -> pulumi.Output[Optional[bool]]:
        """
        When a Virtual Instance is resumed, remount all collections that were mounted when the Virtual Instance was suspended.
        """
        return pulumi.get(self, "remount_on_resume")

    @property
    @pulumi.getter
    def rrn(self) -> pulumi.Output[str]:
        """
        RRN of this Virtual Instance.
        """
        return pulumi.get(self, "rrn")

    @property
    @pulumi.getter
    def size(self) -> pulumi.Output[str]:
        """
        Requested virtual instance size. Note that this field is called type in the API documentation.
        """
        return pulumi.get(self, "size")

    @property
    @pulumi.getter
    def state(self) -> pulumi.Output[str]:
        """
        Virtual Instance state.
        """
        return pulumi.get(self, "state")

