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

__all__ = ['UpstreamArgs', 'Upstream']

@pulumi.input_type
class UpstreamArgs:
    def __init__(__self__, *,
                 gateway_id: pulumi.Input[builtins.str],
                 name: pulumi.Input[builtins.str],
                 source_type: pulumi.Input[builtins.str],
                 upstream_spec: pulumi.Input['UpstreamUpstreamSpecArgs'],
                 circuit_breaking_settings: Optional[pulumi.Input['UpstreamCircuitBreakingSettingsArgs']] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 load_balancer_settings: Optional[pulumi.Input['UpstreamLoadBalancerSettingsArgs']] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 tls_settings: Optional[pulumi.Input['UpstreamTlsSettingsArgs']] = None):
        """
        The set of arguments for constructing a Upstream resource.
        :param pulumi.Input[builtins.str] gateway_id: 网关实例ID。
        :param pulumi.Input[builtins.str] name: Upstream名称。
        :param pulumi.Input[builtins.str] source_type: Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        :param pulumi.Input['UpstreamUpstreamSpecArgs'] upstream_spec: Upstream配置。
        :param pulumi.Input['UpstreamCircuitBreakingSettingsArgs'] circuit_breaking_settings: 服务熔断配置。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input['UpstreamLoadBalancerSettingsArgs'] load_balancer_settings: 负载均衡配置。
        :param pulumi.Input[builtins.str] protocol: 协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        :param pulumi.Input['UpstreamTlsSettingsArgs'] tls_settings: TLS配置。
        """
        pulumi.set(__self__, "gateway_id", gateway_id)
        pulumi.set(__self__, "name", name)
        pulumi.set(__self__, "source_type", source_type)
        pulumi.set(__self__, "upstream_spec", upstream_spec)
        if circuit_breaking_settings is not None:
            pulumi.set(__self__, "circuit_breaking_settings", circuit_breaking_settings)
        if comments is not None:
            pulumi.set(__self__, "comments", comments)
        if load_balancer_settings is not None:
            pulumi.set(__self__, "load_balancer_settings", load_balancer_settings)
        if protocol is not None:
            pulumi.set(__self__, "protocol", protocol)
        if tls_settings is not None:
            pulumi.set(__self__, "tls_settings", tls_settings)

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

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

    @property
    @pulumi.getter
    def name(self) -> pulumi.Input[builtins.str]:
        """
        Upstream名称。
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="sourceType")
    def source_type(self) -> pulumi.Input[builtins.str]:
        """
        Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        """
        return pulumi.get(self, "source_type")

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

    @property
    @pulumi.getter(name="upstreamSpec")
    def upstream_spec(self) -> pulumi.Input['UpstreamUpstreamSpecArgs']:
        """
        Upstream配置。
        """
        return pulumi.get(self, "upstream_spec")

    @upstream_spec.setter
    def upstream_spec(self, value: pulumi.Input['UpstreamUpstreamSpecArgs']):
        pulumi.set(self, "upstream_spec", value)

    @property
    @pulumi.getter(name="circuitBreakingSettings")
    def circuit_breaking_settings(self) -> Optional[pulumi.Input['UpstreamCircuitBreakingSettingsArgs']]:
        """
        服务熔断配置。
        """
        return pulumi.get(self, "circuit_breaking_settings")

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

    @property
    @pulumi.getter
    def comments(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

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

    @property
    @pulumi.getter(name="loadBalancerSettings")
    def load_balancer_settings(self) -> Optional[pulumi.Input['UpstreamLoadBalancerSettingsArgs']]:
        """
        负载均衡配置。
        """
        return pulumi.get(self, "load_balancer_settings")

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

    @property
    @pulumi.getter
    def protocol(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        """
        return pulumi.get(self, "protocol")

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

    @property
    @pulumi.getter(name="tlsSettings")
    def tls_settings(self) -> Optional[pulumi.Input['UpstreamTlsSettingsArgs']]:
        """
        TLS配置。
        """
        return pulumi.get(self, "tls_settings")

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


@pulumi.input_type
class _UpstreamState:
    def __init__(__self__, *,
                 backend_targets: Optional[pulumi.Input[Sequence[pulumi.Input['UpstreamBackendTargetArgs']]]] = None,
                 circuit_breaking_settings: Optional[pulumi.Input['UpstreamCircuitBreakingSettingsArgs']] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 load_balancer_settings: Optional[pulumi.Input['UpstreamLoadBalancerSettingsArgs']] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_type: Optional[pulumi.Input[builtins.str]] = None,
                 tls_settings: Optional[pulumi.Input['UpstreamTlsSettingsArgs']] = None,
                 updated_time: Optional[pulumi.Input[builtins.str]] = None,
                 upstream_id: Optional[pulumi.Input[builtins.str]] = None,
                 upstream_spec: Optional[pulumi.Input['UpstreamUpstreamSpecArgs']] = None,
                 version_details: Optional[pulumi.Input[Sequence[pulumi.Input['UpstreamVersionDetailArgs']]]] = None):
        """
        Input properties used for looking up and filtering Upstream resources.
        :param pulumi.Input['UpstreamCircuitBreakingSettingsArgs'] circuit_breaking_settings: 服务熔断配置。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] created_time: Upstream创建时间。
        :param pulumi.Input[builtins.str] gateway_id: 网关实例ID。
        :param pulumi.Input['UpstreamLoadBalancerSettingsArgs'] load_balancer_settings: 负载均衡配置。
        :param pulumi.Input[builtins.str] name: Upstream名称。
        :param pulumi.Input[builtins.str] protocol: 协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        :param pulumi.Input[builtins.str] source_type: Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        :param pulumi.Input['UpstreamTlsSettingsArgs'] tls_settings: TLS配置。
        :param pulumi.Input[builtins.str] updated_time: Upstream更新时间。
        :param pulumi.Input[builtins.str] upstream_id: Upstream ID。
        :param pulumi.Input['UpstreamUpstreamSpecArgs'] upstream_spec: Upstream配置。
        """
        if backend_targets is not None:
            pulumi.set(__self__, "backend_targets", backend_targets)
        if circuit_breaking_settings is not None:
            pulumi.set(__self__, "circuit_breaking_settings", circuit_breaking_settings)
        if comments is not None:
            pulumi.set(__self__, "comments", comments)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if gateway_id is not None:
            pulumi.set(__self__, "gateway_id", gateway_id)
        if load_balancer_settings is not None:
            pulumi.set(__self__, "load_balancer_settings", load_balancer_settings)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if protocol is not None:
            pulumi.set(__self__, "protocol", protocol)
        if source_type is not None:
            pulumi.set(__self__, "source_type", source_type)
        if tls_settings is not None:
            pulumi.set(__self__, "tls_settings", tls_settings)
        if updated_time is not None:
            pulumi.set(__self__, "updated_time", updated_time)
        if upstream_id is not None:
            pulumi.set(__self__, "upstream_id", upstream_id)
        if upstream_spec is not None:
            pulumi.set(__self__, "upstream_spec", upstream_spec)
        if version_details is not None:
            pulumi.set(__self__, "version_details", version_details)

    @property
    @pulumi.getter(name="backendTargets")
    def backend_targets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['UpstreamBackendTargetArgs']]]]:
        return pulumi.get(self, "backend_targets")

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

    @property
    @pulumi.getter(name="circuitBreakingSettings")
    def circuit_breaking_settings(self) -> Optional[pulumi.Input['UpstreamCircuitBreakingSettingsArgs']]:
        """
        服务熔断配置。
        """
        return pulumi.get(self, "circuit_breaking_settings")

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

    @property
    @pulumi.getter
    def comments(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

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

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Upstream创建时间。
        """
        return pulumi.get(self, "created_time")

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

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

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

    @property
    @pulumi.getter(name="loadBalancerSettings")
    def load_balancer_settings(self) -> Optional[pulumi.Input['UpstreamLoadBalancerSettingsArgs']]:
        """
        负载均衡配置。
        """
        return pulumi.get(self, "load_balancer_settings")

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

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

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

    @property
    @pulumi.getter
    def protocol(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        """
        return pulumi.get(self, "protocol")

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

    @property
    @pulumi.getter(name="sourceType")
    def source_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        """
        return pulumi.get(self, "source_type")

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

    @property
    @pulumi.getter(name="tlsSettings")
    def tls_settings(self) -> Optional[pulumi.Input['UpstreamTlsSettingsArgs']]:
        """
        TLS配置。
        """
        return pulumi.get(self, "tls_settings")

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

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Upstream更新时间。
        """
        return pulumi.get(self, "updated_time")

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

    @property
    @pulumi.getter(name="upstreamId")
    def upstream_id(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        Upstream ID。
        """
        return pulumi.get(self, "upstream_id")

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

    @property
    @pulumi.getter(name="upstreamSpec")
    def upstream_spec(self) -> Optional[pulumi.Input['UpstreamUpstreamSpecArgs']]:
        """
        Upstream配置。
        """
        return pulumi.get(self, "upstream_spec")

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

    @property
    @pulumi.getter(name="versionDetails")
    def version_details(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['UpstreamVersionDetailArgs']]]]:
        return pulumi.get(self, "version_details")

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


@pulumi.type_token("bytepluscc:apig/upstream:Upstream")
class Upstream(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 circuit_breaking_settings: Optional[pulumi.Input[Union['UpstreamCircuitBreakingSettingsArgs', 'UpstreamCircuitBreakingSettingsArgsDict']]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 load_balancer_settings: Optional[pulumi.Input[Union['UpstreamLoadBalancerSettingsArgs', 'UpstreamLoadBalancerSettingsArgsDict']]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_type: Optional[pulumi.Input[builtins.str]] = None,
                 tls_settings: Optional[pulumi.Input[Union['UpstreamTlsSettingsArgs', 'UpstreamTlsSettingsArgsDict']]] = None,
                 upstream_spec: Optional[pulumi.Input[Union['UpstreamUpstreamSpecArgs', 'UpstreamUpstreamSpecArgsDict']]] = None,
                 __props__=None):
        """
        Upstream 是对 API 网关实例后端的抽象。您可以将具有相同功能的后端应用抽象为一个 Upstream，实现路由和后端应用解耦，更灵活地支持后端应用的灰度发布、多版本管理等场景。本文为您介绍 Upstream 的概念及作用。

        ## Import

        ```sh
        $ pulumi import bytepluscc:apig/upstream:Upstream example "upstream_id"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['UpstreamCircuitBreakingSettingsArgs', 'UpstreamCircuitBreakingSettingsArgsDict']] circuit_breaking_settings: 服务熔断配置。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] gateway_id: 网关实例ID。
        :param pulumi.Input[Union['UpstreamLoadBalancerSettingsArgs', 'UpstreamLoadBalancerSettingsArgsDict']] load_balancer_settings: 负载均衡配置。
        :param pulumi.Input[builtins.str] name: Upstream名称。
        :param pulumi.Input[builtins.str] protocol: 协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        :param pulumi.Input[builtins.str] source_type: Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        :param pulumi.Input[Union['UpstreamTlsSettingsArgs', 'UpstreamTlsSettingsArgsDict']] tls_settings: TLS配置。
        :param pulumi.Input[Union['UpstreamUpstreamSpecArgs', 'UpstreamUpstreamSpecArgsDict']] upstream_spec: Upstream配置。
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: UpstreamArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Upstream 是对 API 网关实例后端的抽象。您可以将具有相同功能的后端应用抽象为一个 Upstream，实现路由和后端应用解耦，更灵活地支持后端应用的灰度发布、多版本管理等场景。本文为您介绍 Upstream 的概念及作用。

        ## Import

        ```sh
        $ pulumi import bytepluscc:apig/upstream:Upstream example "upstream_id"
        ```

        :param str resource_name: The name of the resource.
        :param UpstreamArgs 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(UpstreamArgs, 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,
                 circuit_breaking_settings: Optional[pulumi.Input[Union['UpstreamCircuitBreakingSettingsArgs', 'UpstreamCircuitBreakingSettingsArgsDict']]] = None,
                 comments: Optional[pulumi.Input[builtins.str]] = None,
                 gateway_id: Optional[pulumi.Input[builtins.str]] = None,
                 load_balancer_settings: Optional[pulumi.Input[Union['UpstreamLoadBalancerSettingsArgs', 'UpstreamLoadBalancerSettingsArgsDict']]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 protocol: Optional[pulumi.Input[builtins.str]] = None,
                 source_type: Optional[pulumi.Input[builtins.str]] = None,
                 tls_settings: Optional[pulumi.Input[Union['UpstreamTlsSettingsArgs', 'UpstreamTlsSettingsArgsDict']]] = None,
                 upstream_spec: Optional[pulumi.Input[Union['UpstreamUpstreamSpecArgs', 'UpstreamUpstreamSpecArgsDict']]] = 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__ = UpstreamArgs.__new__(UpstreamArgs)

            __props__.__dict__["circuit_breaking_settings"] = circuit_breaking_settings
            __props__.__dict__["comments"] = comments
            if gateway_id is None and not opts.urn:
                raise TypeError("Missing required property 'gateway_id'")
            __props__.__dict__["gateway_id"] = gateway_id
            __props__.__dict__["load_balancer_settings"] = load_balancer_settings
            if name is None and not opts.urn:
                raise TypeError("Missing required property 'name'")
            __props__.__dict__["name"] = name
            __props__.__dict__["protocol"] = protocol
            if source_type is None and not opts.urn:
                raise TypeError("Missing required property 'source_type'")
            __props__.__dict__["source_type"] = source_type
            __props__.__dict__["tls_settings"] = tls_settings
            if upstream_spec is None and not opts.urn:
                raise TypeError("Missing required property 'upstream_spec'")
            __props__.__dict__["upstream_spec"] = upstream_spec
            __props__.__dict__["backend_targets"] = None
            __props__.__dict__["created_time"] = None
            __props__.__dict__["updated_time"] = None
            __props__.__dict__["upstream_id"] = None
            __props__.__dict__["version_details"] = None
        super(Upstream, __self__).__init__(
            'bytepluscc:apig/upstream:Upstream',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            backend_targets: Optional[pulumi.Input[Sequence[pulumi.Input[Union['UpstreamBackendTargetArgs', 'UpstreamBackendTargetArgsDict']]]]] = None,
            circuit_breaking_settings: Optional[pulumi.Input[Union['UpstreamCircuitBreakingSettingsArgs', 'UpstreamCircuitBreakingSettingsArgsDict']]] = None,
            comments: Optional[pulumi.Input[builtins.str]] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            gateway_id: Optional[pulumi.Input[builtins.str]] = None,
            load_balancer_settings: Optional[pulumi.Input[Union['UpstreamLoadBalancerSettingsArgs', 'UpstreamLoadBalancerSettingsArgsDict']]] = None,
            name: Optional[pulumi.Input[builtins.str]] = None,
            protocol: Optional[pulumi.Input[builtins.str]] = None,
            source_type: Optional[pulumi.Input[builtins.str]] = None,
            tls_settings: Optional[pulumi.Input[Union['UpstreamTlsSettingsArgs', 'UpstreamTlsSettingsArgsDict']]] = None,
            updated_time: Optional[pulumi.Input[builtins.str]] = None,
            upstream_id: Optional[pulumi.Input[builtins.str]] = None,
            upstream_spec: Optional[pulumi.Input[Union['UpstreamUpstreamSpecArgs', 'UpstreamUpstreamSpecArgsDict']]] = None,
            version_details: Optional[pulumi.Input[Sequence[pulumi.Input[Union['UpstreamVersionDetailArgs', 'UpstreamVersionDetailArgsDict']]]]] = None) -> 'Upstream':
        """
        Get an existing Upstream 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[Union['UpstreamCircuitBreakingSettingsArgs', 'UpstreamCircuitBreakingSettingsArgsDict']] circuit_breaking_settings: 服务熔断配置。
        :param pulumi.Input[builtins.str] comments: 备注。
        :param pulumi.Input[builtins.str] created_time: Upstream创建时间。
        :param pulumi.Input[builtins.str] gateway_id: 网关实例ID。
        :param pulumi.Input[Union['UpstreamLoadBalancerSettingsArgs', 'UpstreamLoadBalancerSettingsArgsDict']] load_balancer_settings: 负载均衡配置。
        :param pulumi.Input[builtins.str] name: Upstream名称。
        :param pulumi.Input[builtins.str] protocol: 协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        :param pulumi.Input[builtins.str] source_type: Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        :param pulumi.Input[Union['UpstreamTlsSettingsArgs', 'UpstreamTlsSettingsArgsDict']] tls_settings: TLS配置。
        :param pulumi.Input[builtins.str] updated_time: Upstream更新时间。
        :param pulumi.Input[builtins.str] upstream_id: Upstream ID。
        :param pulumi.Input[Union['UpstreamUpstreamSpecArgs', 'UpstreamUpstreamSpecArgsDict']] upstream_spec: Upstream配置。
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _UpstreamState.__new__(_UpstreamState)

        __props__.__dict__["backend_targets"] = backend_targets
        __props__.__dict__["circuit_breaking_settings"] = circuit_breaking_settings
        __props__.__dict__["comments"] = comments
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["gateway_id"] = gateway_id
        __props__.__dict__["load_balancer_settings"] = load_balancer_settings
        __props__.__dict__["name"] = name
        __props__.__dict__["protocol"] = protocol
        __props__.__dict__["source_type"] = source_type
        __props__.__dict__["tls_settings"] = tls_settings
        __props__.__dict__["updated_time"] = updated_time
        __props__.__dict__["upstream_id"] = upstream_id
        __props__.__dict__["upstream_spec"] = upstream_spec
        __props__.__dict__["version_details"] = version_details
        return Upstream(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="backendTargets")
    def backend_targets(self) -> pulumi.Output[Sequence['outputs.UpstreamBackendTarget']]:
        return pulumi.get(self, "backend_targets")

    @property
    @pulumi.getter(name="circuitBreakingSettings")
    def circuit_breaking_settings(self) -> pulumi.Output['outputs.UpstreamCircuitBreakingSettings']:
        """
        服务熔断配置。
        """
        return pulumi.get(self, "circuit_breaking_settings")

    @property
    @pulumi.getter
    def comments(self) -> pulumi.Output[builtins.str]:
        """
        备注。
        """
        return pulumi.get(self, "comments")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        Upstream创建时间。
        """
        return pulumi.get(self, "created_time")

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

    @property
    @pulumi.getter(name="loadBalancerSettings")
    def load_balancer_settings(self) -> pulumi.Output['outputs.UpstreamLoadBalancerSettings']:
        """
        负载均衡配置。
        """
        return pulumi.get(self, "load_balancer_settings")

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

    @property
    @pulumi.getter
    def protocol(self) -> pulumi.Output[builtins.str]:
        """
        协议，取值：HTTP：HTTP/1.1。HTTP2：HTTP/2。GRPC：GRPC。
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter(name="sourceType")
    def source_type(self) -> pulumi.Output[builtins.str]:
        """
        Upstream来源类型，取值：VeFaas：函数服务。ECS：云服务器。K8S：容器服务。Nacos：注册中心。AIProvider：AI模型代理。
        """
        return pulumi.get(self, "source_type")

    @property
    @pulumi.getter(name="tlsSettings")
    def tls_settings(self) -> pulumi.Output['outputs.UpstreamTlsSettings']:
        """
        TLS配置。
        """
        return pulumi.get(self, "tls_settings")

    @property
    @pulumi.getter(name="updatedTime")
    def updated_time(self) -> pulumi.Output[builtins.str]:
        """
        Upstream更新时间。
        """
        return pulumi.get(self, "updated_time")

    @property
    @pulumi.getter(name="upstreamId")
    def upstream_id(self) -> pulumi.Output[builtins.str]:
        """
        Upstream ID。
        """
        return pulumi.get(self, "upstream_id")

    @property
    @pulumi.getter(name="upstreamSpec")
    def upstream_spec(self) -> pulumi.Output['outputs.UpstreamUpstreamSpec']:
        """
        Upstream配置。
        """
        return pulumi.get(self, "upstream_spec")

    @property
    @pulumi.getter(name="versionDetails")
    def version_details(self) -> pulumi.Output[Sequence['outputs.UpstreamVersionDetail']]:
        return pulumi.get(self, "version_details")

