# 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 builtins
import copy
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

__all__ = ['InstancePluginArgs', 'InstancePlugin']

@pulumi.input_type
class InstancePluginArgs:
    def __init__(__self__, *,
                 instance_id: pulumi.Input[builtins.str],
                 plugin_name: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a InstancePlugin resource.
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] plugin_name: 插件名称。
        """
        pulumi.set(__self__, "instance_id", instance_id)
        if plugin_name is not None:
            pulumi.set(__self__, "plugin_name", plugin_name)

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> pulumi.Input[builtins.str]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

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

    @property
    @pulumi.getter(name="pluginName")
    def plugin_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        插件名称。
        """
        return pulumi.get(self, "plugin_name")

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


@pulumi.input_type
class _InstancePluginState:
    def __init__(__self__, *,
                 description: Optional[pulumi.Input[builtins.str]] = None,
                 disable_prompt: Optional[pulumi.Input[builtins.str]] = None,
                 enable_prompt: Optional[pulumi.Input[builtins.str]] = None,
                 enabled: Optional[pulumi.Input[builtins.bool]] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 need_reboot_on_change: Optional[pulumi.Input[builtins.bool]] = None,
                 plugin_name: Optional[pulumi.Input[builtins.str]] = None,
                 port: Optional[pulumi.Input[builtins.int]] = None,
                 version: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering InstancePlugin resources.
        :param pulumi.Input[builtins.str] description: 插件描述。
        :param pulumi.Input[builtins.str] disable_prompt: 关闭此插件的注意事项说明。
        :param pulumi.Input[builtins.str] enable_prompt: 开启此插件的注意事项说明。
        :param pulumi.Input[builtins.bool] enabled: 是否已开启插件。true：插件已开启。false：插件已关闭。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.bool] need_reboot_on_change: 开启或关闭插件是否会引发 RabbitMQ 实例重启。true：会重启实例。false：不会重启实例。
        :param pulumi.Input[builtins.str] plugin_name: 插件名称。
        :param pulumi.Input[builtins.int] port: 插件监听的端口。
        :param pulumi.Input[builtins.str] version: 插件版本。
        """
        if description is not None:
            pulumi.set(__self__, "description", description)
        if disable_prompt is not None:
            pulumi.set(__self__, "disable_prompt", disable_prompt)
        if enable_prompt is not None:
            pulumi.set(__self__, "enable_prompt", enable_prompt)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)
        if need_reboot_on_change is not None:
            pulumi.set(__self__, "need_reboot_on_change", need_reboot_on_change)
        if plugin_name is not None:
            pulumi.set(__self__, "plugin_name", plugin_name)
        if port is not None:
            pulumi.set(__self__, "port", port)
        if version is not None:
            pulumi.set(__self__, "version", version)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        插件描述。
        """
        return pulumi.get(self, "description")

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

    @property
    @pulumi.getter(name="disablePrompt")
    def disable_prompt(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        关闭此插件的注意事项说明。
        """
        return pulumi.get(self, "disable_prompt")

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

    @property
    @pulumi.getter(name="enablePrompt")
    def enable_prompt(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        开启此插件的注意事项说明。
        """
        return pulumi.get(self, "enable_prompt")

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

    @property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        是否已开启插件。true：插件已开启。false：插件已关闭。
        """
        return pulumi.get(self, "enabled")

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

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

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

    @property
    @pulumi.getter(name="needRebootOnChange")
    def need_reboot_on_change(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        开启或关闭插件是否会引发 RabbitMQ 实例重启。true：会重启实例。false：不会重启实例。
        """
        return pulumi.get(self, "need_reboot_on_change")

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

    @property
    @pulumi.getter(name="pluginName")
    def plugin_name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        插件名称。
        """
        return pulumi.get(self, "plugin_name")

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

    @property
    @pulumi.getter
    def port(self) -> Optional[pulumi.Input[builtins.int]]:
        """
        插件监听的端口。
        """
        return pulumi.get(self, "port")

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

    @property
    @pulumi.getter
    def version(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        插件版本。
        """
        return pulumi.get(self, "version")

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


@pulumi.type_token("bytepluscc:rabbitmq/instancePlugin:InstancePlugin")
class InstancePlugin(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 plugin_name: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        在消息队列 RabbitMQ版控制台中创建实例之后，实例插件默认为关闭状态，您可以手动为实例开启/关闭插件。开启/关闭部分插件会导致集群滚动重启，建议避开业务运行时段执行该操作。集群滚动重启时会造成未持久化的消息丢失，也会出现短暂的连接不稳定现象，例如连接断开，断开后会根据客户端配置决定是否自动重连。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        instanceplugin_demo = bytepluscc.rabbitmq.InstancePlugin("instancepluginDemo",
            instance_id="rbtmq-db26b7****",
            plugin_name="ccapi-test")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:rabbitmq/instancePlugin:InstancePlugin example "instance_id|plugin_name"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.str] plugin_name: 插件名称。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: InstancePluginArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        在消息队列 RabbitMQ版控制台中创建实例之后，实例插件默认为关闭状态，您可以手动为实例开启/关闭插件。开启/关闭部分插件会导致集群滚动重启，建议避开业务运行时段执行该操作。集群滚动重启时会造成未持久化的消息丢失，也会出现短暂的连接不稳定现象，例如连接断开，断开后会根据客户端配置决定是否自动重连。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        instanceplugin_demo = bytepluscc.rabbitmq.InstancePlugin("instancepluginDemo",
            instance_id="rbtmq-db26b7****",
            plugin_name="ccapi-test")
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:rabbitmq/instancePlugin:InstancePlugin example "instance_id|plugin_name"
        ```

        :param str resource_name: The name of the resource.
        :param InstancePluginArgs 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(InstancePluginArgs, 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,
                 instance_id: Optional[pulumi.Input[builtins.str]] = None,
                 plugin_name: 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__ = InstancePluginArgs.__new__(InstancePluginArgs)

            if instance_id is None and not opts.urn:
                raise TypeError("Missing required property 'instance_id'")
            __props__.__dict__["instance_id"] = instance_id
            __props__.__dict__["plugin_name"] = plugin_name
            __props__.__dict__["description"] = None
            __props__.__dict__["disable_prompt"] = None
            __props__.__dict__["enable_prompt"] = None
            __props__.__dict__["enabled"] = None
            __props__.__dict__["need_reboot_on_change"] = None
            __props__.__dict__["port"] = None
            __props__.__dict__["version"] = None
        super(InstancePlugin, __self__).__init__(
            'bytepluscc:rabbitmq/instancePlugin:InstancePlugin',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            description: Optional[pulumi.Input[builtins.str]] = None,
            disable_prompt: Optional[pulumi.Input[builtins.str]] = None,
            enable_prompt: Optional[pulumi.Input[builtins.str]] = None,
            enabled: Optional[pulumi.Input[builtins.bool]] = None,
            instance_id: Optional[pulumi.Input[builtins.str]] = None,
            need_reboot_on_change: Optional[pulumi.Input[builtins.bool]] = None,
            plugin_name: Optional[pulumi.Input[builtins.str]] = None,
            port: Optional[pulumi.Input[builtins.int]] = None,
            version: Optional[pulumi.Input[builtins.str]] = None) -> 'InstancePlugin':
        """
        Get an existing InstancePlugin 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] description: 插件描述。
        :param pulumi.Input[builtins.str] disable_prompt: 关闭此插件的注意事项说明。
        :param pulumi.Input[builtins.str] enable_prompt: 开启此插件的注意事项说明。
        :param pulumi.Input[builtins.bool] enabled: 是否已开启插件。true：插件已开启。false：插件已关闭。
        :param pulumi.Input[builtins.str] instance_id: 实例 ID。
        :param pulumi.Input[builtins.bool] need_reboot_on_change: 开启或关闭插件是否会引发 RabbitMQ 实例重启。true：会重启实例。false：不会重启实例。
        :param pulumi.Input[builtins.str] plugin_name: 插件名称。
        :param pulumi.Input[builtins.int] port: 插件监听的端口。
        :param pulumi.Input[builtins.str] version: 插件版本。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _InstancePluginState.__new__(_InstancePluginState)

        __props__.__dict__["description"] = description
        __props__.__dict__["disable_prompt"] = disable_prompt
        __props__.__dict__["enable_prompt"] = enable_prompt
        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["instance_id"] = instance_id
        __props__.__dict__["need_reboot_on_change"] = need_reboot_on_change
        __props__.__dict__["plugin_name"] = plugin_name
        __props__.__dict__["port"] = port
        __props__.__dict__["version"] = version
        return InstancePlugin(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[builtins.str]:
        """
        插件描述。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="disablePrompt")
    def disable_prompt(self) -> pulumi.Output[builtins.str]:
        """
        关闭此插件的注意事项说明。
        """
        return pulumi.get(self, "disable_prompt")

    @property
    @pulumi.getter(name="enablePrompt")
    def enable_prompt(self) -> pulumi.Output[builtins.str]:
        """
        开启此插件的注意事项说明。
        """
        return pulumi.get(self, "enable_prompt")

    @property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[builtins.bool]:
        """
        是否已开启插件。true：插件已开启。false：插件已关闭。
        """
        return pulumi.get(self, "enabled")

    @property
    @pulumi.getter(name="instanceId")
    def instance_id(self) -> pulumi.Output[builtins.str]:
        """
        实例 ID。
        """
        return pulumi.get(self, "instance_id")

    @property
    @pulumi.getter(name="needRebootOnChange")
    def need_reboot_on_change(self) -> pulumi.Output[builtins.bool]:
        """
        开启或关闭插件是否会引发 RabbitMQ 实例重启。true：会重启实例。false：不会重启实例。
        """
        return pulumi.get(self, "need_reboot_on_change")

    @property
    @pulumi.getter(name="pluginName")
    def plugin_name(self) -> pulumi.Output[builtins.str]:
        """
        插件名称。
        """
        return pulumi.get(self, "plugin_name")

    @property
    @pulumi.getter
    def port(self) -> pulumi.Output[builtins.int]:
        """
        插件监听的端口。
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter
    def version(self) -> pulumi.Output[builtins.str]:
        """
        插件版本。
        """
        return pulumi.get(self, "version")

