# 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
from . import outputs
from ._inputs import *

__all__ = ['NestServiceInstanceArgs', 'NestServiceInstance']

@pulumi.input_type
class NestServiceInstanceArgs:
    def __init__(__self__, *,
                 service_id: pulumi.Input[str],
                 service_version: pulumi.Input[str],
                 commodity: Optional[pulumi.Input['NestServiceInstanceCommodityArgs']] = None,
                 enable_instance_ops: Optional[pulumi.Input[bool]] = None,
                 enable_user_prometheus: Optional[pulumi.Input[bool]] = None,
                 operation_metadata: Optional[pulumi.Input['NestServiceInstanceOperationMetadataArgs']] = None,
                 parameters: Optional[pulumi.Input[str]] = None,
                 payment_type: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_instance_name: Optional[pulumi.Input[str]] = None,
                 specification_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 template_name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a NestServiceInstance resource.
        :param pulumi.Input[str] service_id: The ID of the service.
        :param pulumi.Input[str] service_version: The version of the service.
        :param pulumi.Input['NestServiceInstanceCommodityArgs'] commodity: The order information of cloud market. See the following `Block commodity`.
        :param pulumi.Input[bool] enable_instance_ops: Whether the service instance has the O&M function. Default value: `false`. Valid values:
        :param pulumi.Input[bool] enable_user_prometheus: Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        :param pulumi.Input['NestServiceInstanceOperationMetadataArgs'] operation_metadata: The configuration of O&M. See the following `Block operation_metadata`.
        :param pulumi.Input[str] parameters: The parameters entered by the deployment service instance.
        :param pulumi.Input[str] payment_type: The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        :param pulumi.Input[str] resource_group_id: The ID of the resource group.
        :param pulumi.Input[str] service_instance_name: The name of the Service Instance.
        :param pulumi.Input[str] specification_name: The name of the specification.
        :param pulumi.Input[Mapping[str, Any]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[str] template_name: The name of the template.
        """
        pulumi.set(__self__, "service_id", service_id)
        pulumi.set(__self__, "service_version", service_version)
        if commodity is not None:
            pulumi.set(__self__, "commodity", commodity)
        if enable_instance_ops is not None:
            pulumi.set(__self__, "enable_instance_ops", enable_instance_ops)
        if enable_user_prometheus is not None:
            pulumi.set(__self__, "enable_user_prometheus", enable_user_prometheus)
        if operation_metadata is not None:
            pulumi.set(__self__, "operation_metadata", operation_metadata)
        if parameters is not None:
            pulumi.set(__self__, "parameters", parameters)
        if payment_type is not None:
            pulumi.set(__self__, "payment_type", payment_type)
        if resource_group_id is not None:
            pulumi.set(__self__, "resource_group_id", resource_group_id)
        if service_instance_name is not None:
            pulumi.set(__self__, "service_instance_name", service_instance_name)
        if specification_name is not None:
            pulumi.set(__self__, "specification_name", specification_name)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if template_name is not None:
            pulumi.set(__self__, "template_name", template_name)

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> pulumi.Input[str]:
        """
        The ID of the service.
        """
        return pulumi.get(self, "service_id")

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

    @property
    @pulumi.getter(name="serviceVersion")
    def service_version(self) -> pulumi.Input[str]:
        """
        The version of the service.
        """
        return pulumi.get(self, "service_version")

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

    @property
    @pulumi.getter
    def commodity(self) -> Optional[pulumi.Input['NestServiceInstanceCommodityArgs']]:
        """
        The order information of cloud market. See the following `Block commodity`.
        """
        return pulumi.get(self, "commodity")

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

    @property
    @pulumi.getter(name="enableInstanceOps")
    def enable_instance_ops(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the service instance has the O&M function. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_instance_ops")

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

    @property
    @pulumi.getter(name="enableUserPrometheus")
    def enable_user_prometheus(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_user_prometheus")

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

    @property
    @pulumi.getter(name="operationMetadata")
    def operation_metadata(self) -> Optional[pulumi.Input['NestServiceInstanceOperationMetadataArgs']]:
        """
        The configuration of O&M. See the following `Block operation_metadata`.
        """
        return pulumi.get(self, "operation_metadata")

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

    @property
    @pulumi.getter
    def parameters(self) -> Optional[pulumi.Input[str]]:
        """
        The parameters entered by the deployment service instance.
        """
        return pulumi.get(self, "parameters")

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

    @property
    @pulumi.getter(name="paymentType")
    def payment_type(self) -> Optional[pulumi.Input[str]]:
        """
        The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        """
        return pulumi.get(self, "payment_type")

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

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the resource group.
        """
        return pulumi.get(self, "resource_group_id")

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

    @property
    @pulumi.getter(name="serviceInstanceName")
    def service_instance_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the Service Instance.
        """
        return pulumi.get(self, "service_instance_name")

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

    @property
    @pulumi.getter(name="specificationName")
    def specification_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the specification.
        """
        return pulumi.get(self, "specification_name")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        A mapping of tags to assign to the resource.
        """
        return pulumi.get(self, "tags")

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

    @property
    @pulumi.getter(name="templateName")
    def template_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the template.
        """
        return pulumi.get(self, "template_name")

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


@pulumi.input_type
class _NestServiceInstanceState:
    def __init__(__self__, *,
                 commodity: Optional[pulumi.Input['NestServiceInstanceCommodityArgs']] = None,
                 enable_instance_ops: Optional[pulumi.Input[bool]] = None,
                 enable_user_prometheus: Optional[pulumi.Input[bool]] = None,
                 operation_metadata: Optional[pulumi.Input['NestServiceInstanceOperationMetadataArgs']] = None,
                 parameters: Optional[pulumi.Input[str]] = None,
                 payment_type: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_id: Optional[pulumi.Input[str]] = None,
                 service_instance_name: Optional[pulumi.Input[str]] = None,
                 service_version: Optional[pulumi.Input[str]] = None,
                 specification_name: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 template_name: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering NestServiceInstance resources.
        :param pulumi.Input['NestServiceInstanceCommodityArgs'] commodity: The order information of cloud market. See the following `Block commodity`.
        :param pulumi.Input[bool] enable_instance_ops: Whether the service instance has the O&M function. Default value: `false`. Valid values:
        :param pulumi.Input[bool] enable_user_prometheus: Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        :param pulumi.Input['NestServiceInstanceOperationMetadataArgs'] operation_metadata: The configuration of O&M. See the following `Block operation_metadata`.
        :param pulumi.Input[str] parameters: The parameters entered by the deployment service instance.
        :param pulumi.Input[str] payment_type: The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        :param pulumi.Input[str] resource_group_id: The ID of the resource group.
        :param pulumi.Input[str] service_id: The ID of the service.
        :param pulumi.Input[str] service_instance_name: The name of the Service Instance.
        :param pulumi.Input[str] service_version: The version of the service.
        :param pulumi.Input[str] specification_name: The name of the specification.
        :param pulumi.Input[str] status: The status of the Service Instance.
        :param pulumi.Input[Mapping[str, Any]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[str] template_name: The name of the template.
        """
        if commodity is not None:
            pulumi.set(__self__, "commodity", commodity)
        if enable_instance_ops is not None:
            pulumi.set(__self__, "enable_instance_ops", enable_instance_ops)
        if enable_user_prometheus is not None:
            pulumi.set(__self__, "enable_user_prometheus", enable_user_prometheus)
        if operation_metadata is not None:
            pulumi.set(__self__, "operation_metadata", operation_metadata)
        if parameters is not None:
            pulumi.set(__self__, "parameters", parameters)
        if payment_type is not None:
            pulumi.set(__self__, "payment_type", payment_type)
        if resource_group_id is not None:
            pulumi.set(__self__, "resource_group_id", resource_group_id)
        if service_id is not None:
            pulumi.set(__self__, "service_id", service_id)
        if service_instance_name is not None:
            pulumi.set(__self__, "service_instance_name", service_instance_name)
        if service_version is not None:
            pulumi.set(__self__, "service_version", service_version)
        if specification_name is not None:
            pulumi.set(__self__, "specification_name", specification_name)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if template_name is not None:
            pulumi.set(__self__, "template_name", template_name)

    @property
    @pulumi.getter
    def commodity(self) -> Optional[pulumi.Input['NestServiceInstanceCommodityArgs']]:
        """
        The order information of cloud market. See the following `Block commodity`.
        """
        return pulumi.get(self, "commodity")

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

    @property
    @pulumi.getter(name="enableInstanceOps")
    def enable_instance_ops(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether the service instance has the O&M function. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_instance_ops")

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

    @property
    @pulumi.getter(name="enableUserPrometheus")
    def enable_user_prometheus(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_user_prometheus")

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

    @property
    @pulumi.getter(name="operationMetadata")
    def operation_metadata(self) -> Optional[pulumi.Input['NestServiceInstanceOperationMetadataArgs']]:
        """
        The configuration of O&M. See the following `Block operation_metadata`.
        """
        return pulumi.get(self, "operation_metadata")

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

    @property
    @pulumi.getter
    def parameters(self) -> Optional[pulumi.Input[str]]:
        """
        The parameters entered by the deployment service instance.
        """
        return pulumi.get(self, "parameters")

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

    @property
    @pulumi.getter(name="paymentType")
    def payment_type(self) -> Optional[pulumi.Input[str]]:
        """
        The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        """
        return pulumi.get(self, "payment_type")

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

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the resource group.
        """
        return pulumi.get(self, "resource_group_id")

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

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the service.
        """
        return pulumi.get(self, "service_id")

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

    @property
    @pulumi.getter(name="serviceInstanceName")
    def service_instance_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the Service Instance.
        """
        return pulumi.get(self, "service_instance_name")

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

    @property
    @pulumi.getter(name="serviceVersion")
    def service_version(self) -> Optional[pulumi.Input[str]]:
        """
        The version of the service.
        """
        return pulumi.get(self, "service_version")

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

    @property
    @pulumi.getter(name="specificationName")
    def specification_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the specification.
        """
        return pulumi.get(self, "specification_name")

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

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[str]]:
        """
        The status of the Service Instance.
        """
        return pulumi.get(self, "status")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        A mapping of tags to assign to the resource.
        """
        return pulumi.get(self, "tags")

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

    @property
    @pulumi.getter(name="templateName")
    def template_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the template.
        """
        return pulumi.get(self, "template_name")

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


class NestServiceInstance(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 commodity: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceCommodityArgs']]] = None,
                 enable_instance_ops: Optional[pulumi.Input[bool]] = None,
                 enable_user_prometheus: Optional[pulumi.Input[bool]] = None,
                 operation_metadata: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceOperationMetadataArgs']]] = None,
                 parameters: Optional[pulumi.Input[str]] = None,
                 payment_type: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_id: Optional[pulumi.Input[str]] = None,
                 service_instance_name: Optional[pulumi.Input[str]] = None,
                 service_version: Optional[pulumi.Input[str]] = None,
                 specification_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 template_name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Provides a Compute Nest Service Instance resource.

        For information about Compute Nest Service Instance and how to use it, see [What is Service Instance](https://help.aliyun.com/document_detail/396194.html).

        > **NOTE:** Available in v1.205.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default_resource_groups = alicloud.resourcemanager.get_resource_groups()
        default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
            available_resource_creation="VSwitch")
        default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0].id,
            instance_type_family="ecs.sn1ne")
        default_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
            most_recent=True,
            owners="system")
        default_networks = alicloud.vpc.get_networks(name_regex="your_name_regex")
        default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
            zone_id=default_zones.zones[0].id)
        default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_networks.ids[0])
        default_instance = alicloud.ecs.Instance("defaultInstance",
            image_id=default_images.images[0].id,
            instance_type=default_instance_types.instance_types[0].id,
            security_groups=[__item.id for __item in [default_security_group]],
            internet_charge_type="PayByTraffic",
            internet_max_bandwidth_out=10,
            availability_zone=default_zones.zones[0].id,
            instance_charge_type="PostPaid",
            system_disk_category="cloud_efficiency",
            vswitch_id=default_switches.ids[0])
        default_nest_service_instance = alicloud.compute.NestServiceInstance("defaultNestServiceInstance",
            service_id="service-dd475e6e468348799f0f",
            service_version="1",
            service_instance_name=var["name"],
            resource_group_id=default_resource_groups.groups[0].id,
            payment_type="Permanent",
            operation_metadata=alicloud.compute.NestServiceInstanceOperationMetadataArgs(
                operation_start_time="1681281179000",
                operation_end_time="1681367579000",
                resources=default_instance.id.apply(lambda id: f"{{\\"Type\\":\\"ResourceIds\\",\\"ResourceIds\\":{{\\"ALIYUN::ECS::INSTANCE\\":[\\"{id}\\"]}},\\"RegionId\\":\\"cn-hangzhou\\"}}"),
            ),
            tags={
                "Created": "TF",
                "For": "ServiceInstance",
            })
        ```

        ## Import

        Compute Nest Service Instance can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:compute/nestServiceInstance:NestServiceInstance example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[pulumi.InputType['NestServiceInstanceCommodityArgs']] commodity: The order information of cloud market. See the following `Block commodity`.
        :param pulumi.Input[bool] enable_instance_ops: Whether the service instance has the O&M function. Default value: `false`. Valid values:
        :param pulumi.Input[bool] enable_user_prometheus: Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        :param pulumi.Input[pulumi.InputType['NestServiceInstanceOperationMetadataArgs']] operation_metadata: The configuration of O&M. See the following `Block operation_metadata`.
        :param pulumi.Input[str] parameters: The parameters entered by the deployment service instance.
        :param pulumi.Input[str] payment_type: The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        :param pulumi.Input[str] resource_group_id: The ID of the resource group.
        :param pulumi.Input[str] service_id: The ID of the service.
        :param pulumi.Input[str] service_instance_name: The name of the Service Instance.
        :param pulumi.Input[str] service_version: The version of the service.
        :param pulumi.Input[str] specification_name: The name of the specification.
        :param pulumi.Input[Mapping[str, Any]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[str] template_name: The name of the template.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: NestServiceInstanceArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a Compute Nest Service Instance resource.

        For information about Compute Nest Service Instance and how to use it, see [What is Service Instance](https://help.aliyun.com/document_detail/396194.html).

        > **NOTE:** Available in v1.205.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default_resource_groups = alicloud.resourcemanager.get_resource_groups()
        default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
            available_resource_creation="VSwitch")
        default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0].id,
            instance_type_family="ecs.sn1ne")
        default_images = alicloud.ecs.get_images(name_regex="^ubuntu_[0-9]+_[0-9]+_x64*",
            most_recent=True,
            owners="system")
        default_networks = alicloud.vpc.get_networks(name_regex="your_name_regex")
        default_switches = alicloud.vpc.get_switches(vpc_id=default_networks.ids[0],
            zone_id=default_zones.zones[0].id)
        default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_networks.ids[0])
        default_instance = alicloud.ecs.Instance("defaultInstance",
            image_id=default_images.images[0].id,
            instance_type=default_instance_types.instance_types[0].id,
            security_groups=[__item.id for __item in [default_security_group]],
            internet_charge_type="PayByTraffic",
            internet_max_bandwidth_out=10,
            availability_zone=default_zones.zones[0].id,
            instance_charge_type="PostPaid",
            system_disk_category="cloud_efficiency",
            vswitch_id=default_switches.ids[0])
        default_nest_service_instance = alicloud.compute.NestServiceInstance("defaultNestServiceInstance",
            service_id="service-dd475e6e468348799f0f",
            service_version="1",
            service_instance_name=var["name"],
            resource_group_id=default_resource_groups.groups[0].id,
            payment_type="Permanent",
            operation_metadata=alicloud.compute.NestServiceInstanceOperationMetadataArgs(
                operation_start_time="1681281179000",
                operation_end_time="1681367579000",
                resources=default_instance.id.apply(lambda id: f"{{\\"Type\\":\\"ResourceIds\\",\\"ResourceIds\\":{{\\"ALIYUN::ECS::INSTANCE\\":[\\"{id}\\"]}},\\"RegionId\\":\\"cn-hangzhou\\"}}"),
            ),
            tags={
                "Created": "TF",
                "For": "ServiceInstance",
            })
        ```

        ## Import

        Compute Nest Service Instance can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:compute/nestServiceInstance:NestServiceInstance example <id>
        ```

        :param str resource_name: The name of the resource.
        :param NestServiceInstanceArgs 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(NestServiceInstanceArgs, 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,
                 commodity: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceCommodityArgs']]] = None,
                 enable_instance_ops: Optional[pulumi.Input[bool]] = None,
                 enable_user_prometheus: Optional[pulumi.Input[bool]] = None,
                 operation_metadata: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceOperationMetadataArgs']]] = None,
                 parameters: Optional[pulumi.Input[str]] = None,
                 payment_type: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_id: Optional[pulumi.Input[str]] = None,
                 service_instance_name: Optional[pulumi.Input[str]] = None,
                 service_version: Optional[pulumi.Input[str]] = None,
                 specification_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 template_name: 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__ = NestServiceInstanceArgs.__new__(NestServiceInstanceArgs)

            __props__.__dict__["commodity"] = commodity
            __props__.__dict__["enable_instance_ops"] = enable_instance_ops
            __props__.__dict__["enable_user_prometheus"] = enable_user_prometheus
            __props__.__dict__["operation_metadata"] = operation_metadata
            __props__.__dict__["parameters"] = parameters
            __props__.__dict__["payment_type"] = payment_type
            __props__.__dict__["resource_group_id"] = resource_group_id
            if service_id is None and not opts.urn:
                raise TypeError("Missing required property 'service_id'")
            __props__.__dict__["service_id"] = service_id
            __props__.__dict__["service_instance_name"] = service_instance_name
            if service_version is None and not opts.urn:
                raise TypeError("Missing required property 'service_version'")
            __props__.__dict__["service_version"] = service_version
            __props__.__dict__["specification_name"] = specification_name
            __props__.__dict__["tags"] = tags
            __props__.__dict__["template_name"] = template_name
            __props__.__dict__["status"] = None
        super(NestServiceInstance, __self__).__init__(
            'alicloud:compute/nestServiceInstance:NestServiceInstance',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            commodity: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceCommodityArgs']]] = None,
            enable_instance_ops: Optional[pulumi.Input[bool]] = None,
            enable_user_prometheus: Optional[pulumi.Input[bool]] = None,
            operation_metadata: Optional[pulumi.Input[pulumi.InputType['NestServiceInstanceOperationMetadataArgs']]] = None,
            parameters: Optional[pulumi.Input[str]] = None,
            payment_type: Optional[pulumi.Input[str]] = None,
            resource_group_id: Optional[pulumi.Input[str]] = None,
            service_id: Optional[pulumi.Input[str]] = None,
            service_instance_name: Optional[pulumi.Input[str]] = None,
            service_version: Optional[pulumi.Input[str]] = None,
            specification_name: Optional[pulumi.Input[str]] = None,
            status: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            template_name: Optional[pulumi.Input[str]] = None) -> 'NestServiceInstance':
        """
        Get an existing NestServiceInstance 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[pulumi.InputType['NestServiceInstanceCommodityArgs']] commodity: The order information of cloud market. See the following `Block commodity`.
        :param pulumi.Input[bool] enable_instance_ops: Whether the service instance has the O&M function. Default value: `false`. Valid values:
        :param pulumi.Input[bool] enable_user_prometheus: Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        :param pulumi.Input[pulumi.InputType['NestServiceInstanceOperationMetadataArgs']] operation_metadata: The configuration of O&M. See the following `Block operation_metadata`.
        :param pulumi.Input[str] parameters: The parameters entered by the deployment service instance.
        :param pulumi.Input[str] payment_type: The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        :param pulumi.Input[str] resource_group_id: The ID of the resource group.
        :param pulumi.Input[str] service_id: The ID of the service.
        :param pulumi.Input[str] service_instance_name: The name of the Service Instance.
        :param pulumi.Input[str] service_version: The version of the service.
        :param pulumi.Input[str] specification_name: The name of the specification.
        :param pulumi.Input[str] status: The status of the Service Instance.
        :param pulumi.Input[Mapping[str, Any]] tags: A mapping of tags to assign to the resource.
        :param pulumi.Input[str] template_name: The name of the template.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _NestServiceInstanceState.__new__(_NestServiceInstanceState)

        __props__.__dict__["commodity"] = commodity
        __props__.__dict__["enable_instance_ops"] = enable_instance_ops
        __props__.__dict__["enable_user_prometheus"] = enable_user_prometheus
        __props__.__dict__["operation_metadata"] = operation_metadata
        __props__.__dict__["parameters"] = parameters
        __props__.__dict__["payment_type"] = payment_type
        __props__.__dict__["resource_group_id"] = resource_group_id
        __props__.__dict__["service_id"] = service_id
        __props__.__dict__["service_instance_name"] = service_instance_name
        __props__.__dict__["service_version"] = service_version
        __props__.__dict__["specification_name"] = specification_name
        __props__.__dict__["status"] = status
        __props__.__dict__["tags"] = tags
        __props__.__dict__["template_name"] = template_name
        return NestServiceInstance(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def commodity(self) -> pulumi.Output[Optional['outputs.NestServiceInstanceCommodity']]:
        """
        The order information of cloud market. See the following `Block commodity`.
        """
        return pulumi.get(self, "commodity")

    @property
    @pulumi.getter(name="enableInstanceOps")
    def enable_instance_ops(self) -> pulumi.Output[bool]:
        """
        Whether the service instance has the O&M function. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_instance_ops")

    @property
    @pulumi.getter(name="enableUserPrometheus")
    def enable_user_prometheus(self) -> pulumi.Output[bool]:
        """
        Whether Prometheus monitoring is enabled. Default value: `false`. Valid values:
        """
        return pulumi.get(self, "enable_user_prometheus")

    @property
    @pulumi.getter(name="operationMetadata")
    def operation_metadata(self) -> pulumi.Output['outputs.NestServiceInstanceOperationMetadata']:
        """
        The configuration of O&M. See the following `Block operation_metadata`.
        """
        return pulumi.get(self, "operation_metadata")

    @property
    @pulumi.getter
    def parameters(self) -> pulumi.Output[Optional[str]]:
        """
        The parameters entered by the deployment service instance.
        """
        return pulumi.get(self, "parameters")

    @property
    @pulumi.getter(name="paymentType")
    def payment_type(self) -> pulumi.Output[str]:
        """
        The type of payment. Valid values: `Permanent`, `Subscription`, `PayAsYouGo`, `CustomFixTime`.
        """
        return pulumi.get(self, "payment_type")

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> pulumi.Output[str]:
        """
        The ID of the resource group.
        """
        return pulumi.get(self, "resource_group_id")

    @property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> pulumi.Output[str]:
        """
        The ID of the service.
        """
        return pulumi.get(self, "service_id")

    @property
    @pulumi.getter(name="serviceInstanceName")
    def service_instance_name(self) -> pulumi.Output[str]:
        """
        The name of the Service Instance.
        """
        return pulumi.get(self, "service_instance_name")

    @property
    @pulumi.getter(name="serviceVersion")
    def service_version(self) -> pulumi.Output[str]:
        """
        The version of the service.
        """
        return pulumi.get(self, "service_version")

    @property
    @pulumi.getter(name="specificationName")
    def specification_name(self) -> pulumi.Output[Optional[str]]:
        """
        The name of the specification.
        """
        return pulumi.get(self, "specification_name")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[str]:
        """
        The status of the Service Instance.
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        """
        A mapping of tags to assign to the resource.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="templateName")
    def template_name(self) -> pulumi.Output[str]:
        """
        The name of the template.
        """
        return pulumi.get(self, "template_name")

