# 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__ = ['LoadBalancerInternetArgs', 'LoadBalancerInternet']

@pulumi.input_type
class LoadBalancerInternetArgs:
    def __init__(__self__, *,
                 app_id: pulumi.Input[str],
                 internets: pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]],
                 internet_slb_id: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a LoadBalancerInternet resource.
        :param pulumi.Input[str] app_id: The target application ID that needs to be bound to the SLB.
        :param pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]] internets: The bound private network SLB. See the following `Block internet`.
        :param pulumi.Input[str] internet_slb_id: The internet SLB ID.
        """
        pulumi.set(__self__, "app_id", app_id)
        pulumi.set(__self__, "internets", internets)
        if internet_slb_id is not None:
            pulumi.set(__self__, "internet_slb_id", internet_slb_id)

    @property
    @pulumi.getter(name="appId")
    def app_id(self) -> pulumi.Input[str]:
        """
        The target application ID that needs to be bound to the SLB.
        """
        return pulumi.get(self, "app_id")

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

    @property
    @pulumi.getter
    def internets(self) -> pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]]:
        """
        The bound private network SLB. See the following `Block internet`.
        """
        return pulumi.get(self, "internets")

    @internets.setter
    def internets(self, value: pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]]):
        pulumi.set(self, "internets", value)

    @property
    @pulumi.getter(name="internetSlbId")
    def internet_slb_id(self) -> Optional[pulumi.Input[str]]:
        """
        The internet SLB ID.
        """
        return pulumi.get(self, "internet_slb_id")

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


@pulumi.input_type
class _LoadBalancerInternetState:
    def __init__(__self__, *,
                 app_id: Optional[pulumi.Input[str]] = None,
                 internet_ip: Optional[pulumi.Input[str]] = None,
                 internet_slb_id: Optional[pulumi.Input[str]] = None,
                 internets: Optional[pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]]] = None):
        """
        Input properties used for looking up and filtering LoadBalancerInternet resources.
        :param pulumi.Input[str] app_id: The target application ID that needs to be bound to the SLB.
        :param pulumi.Input[str] internet_ip: Use designated public network SLBs that have been purchased to support non-shared instances.
        :param pulumi.Input[str] internet_slb_id: The internet SLB ID.
        :param pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]] internets: The bound private network SLB. See the following `Block internet`.
        """
        if app_id is not None:
            pulumi.set(__self__, "app_id", app_id)
        if internet_ip is not None:
            pulumi.set(__self__, "internet_ip", internet_ip)
        if internet_slb_id is not None:
            pulumi.set(__self__, "internet_slb_id", internet_slb_id)
        if internets is not None:
            pulumi.set(__self__, "internets", internets)

    @property
    @pulumi.getter(name="appId")
    def app_id(self) -> Optional[pulumi.Input[str]]:
        """
        The target application ID that needs to be bound to the SLB.
        """
        return pulumi.get(self, "app_id")

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

    @property
    @pulumi.getter(name="internetIp")
    def internet_ip(self) -> Optional[pulumi.Input[str]]:
        """
        Use designated public network SLBs that have been purchased to support non-shared instances.
        """
        return pulumi.get(self, "internet_ip")

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

    @property
    @pulumi.getter(name="internetSlbId")
    def internet_slb_id(self) -> Optional[pulumi.Input[str]]:
        """
        The internet SLB ID.
        """
        return pulumi.get(self, "internet_slb_id")

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

    @property
    @pulumi.getter
    def internets(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LoadBalancerInternetInternetArgs']]]]:
        """
        The bound private network SLB. See the following `Block internet`.
        """
        return pulumi.get(self, "internets")

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


class LoadBalancerInternet(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 app_id: Optional[pulumi.Input[str]] = None,
                 internet_slb_id: Optional[pulumi.Input[str]] = None,
                 internets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerInternetInternetArgs']]]]] = None,
                 __props__=None):
        """
        Provides an Alicloud Serverless App Engine (SAE) Application Load Balancer Attachment resource.

        For information about Serverless App Engine (SAE) Load Balancer Internet Attachment and how to use it, see [sae.LoadBalancerInternet](https://help.aliyun.com/document_detail/126360.html).

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

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        example = alicloud.sae.LoadBalancerInternet("example",
            app_id="your_application_id",
            internets=[alicloud.sae.LoadBalancerInternetInternetArgs(
                port=80,
                protocol="TCP",
                target_port=8080,
            )],
            internet_slb_id="your_internet_slb_id")
        ```

        ## Import

        The resource can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:sae/loadBalancerInternet:LoadBalancerInternet example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] app_id: The target application ID that needs to be bound to the SLB.
        :param pulumi.Input[str] internet_slb_id: The internet SLB ID.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerInternetInternetArgs']]]] internets: The bound private network SLB. See the following `Block internet`.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: LoadBalancerInternetArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides an Alicloud Serverless App Engine (SAE) Application Load Balancer Attachment resource.

        For information about Serverless App Engine (SAE) Load Balancer Internet Attachment and how to use it, see [sae.LoadBalancerInternet](https://help.aliyun.com/document_detail/126360.html).

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

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        example = alicloud.sae.LoadBalancerInternet("example",
            app_id="your_application_id",
            internets=[alicloud.sae.LoadBalancerInternetInternetArgs(
                port=80,
                protocol="TCP",
                target_port=8080,
            )],
            internet_slb_id="your_internet_slb_id")
        ```

        ## Import

        The resource can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:sae/loadBalancerInternet:LoadBalancerInternet example <id>
        ```

        :param str resource_name: The name of the resource.
        :param LoadBalancerInternetArgs 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(LoadBalancerInternetArgs, 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,
                 app_id: Optional[pulumi.Input[str]] = None,
                 internet_slb_id: Optional[pulumi.Input[str]] = None,
                 internets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerInternetInternetArgs']]]]] = 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__ = LoadBalancerInternetArgs.__new__(LoadBalancerInternetArgs)

            if app_id is None and not opts.urn:
                raise TypeError("Missing required property 'app_id'")
            __props__.__dict__["app_id"] = app_id
            __props__.__dict__["internet_slb_id"] = internet_slb_id
            if internets is None and not opts.urn:
                raise TypeError("Missing required property 'internets'")
            __props__.__dict__["internets"] = internets
            __props__.__dict__["internet_ip"] = None
        super(LoadBalancerInternet, __self__).__init__(
            'alicloud:sae/loadBalancerInternet:LoadBalancerInternet',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            app_id: Optional[pulumi.Input[str]] = None,
            internet_ip: Optional[pulumi.Input[str]] = None,
            internet_slb_id: Optional[pulumi.Input[str]] = None,
            internets: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerInternetInternetArgs']]]]] = None) -> 'LoadBalancerInternet':
        """
        Get an existing LoadBalancerInternet 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[str] app_id: The target application ID that needs to be bound to the SLB.
        :param pulumi.Input[str] internet_ip: Use designated public network SLBs that have been purchased to support non-shared instances.
        :param pulumi.Input[str] internet_slb_id: The internet SLB ID.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['LoadBalancerInternetInternetArgs']]]] internets: The bound private network SLB. See the following `Block internet`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _LoadBalancerInternetState.__new__(_LoadBalancerInternetState)

        __props__.__dict__["app_id"] = app_id
        __props__.__dict__["internet_ip"] = internet_ip
        __props__.__dict__["internet_slb_id"] = internet_slb_id
        __props__.__dict__["internets"] = internets
        return LoadBalancerInternet(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="appId")
    def app_id(self) -> pulumi.Output[str]:
        """
        The target application ID that needs to be bound to the SLB.
        """
        return pulumi.get(self, "app_id")

    @property
    @pulumi.getter(name="internetIp")
    def internet_ip(self) -> pulumi.Output[str]:
        """
        Use designated public network SLBs that have been purchased to support non-shared instances.
        """
        return pulumi.get(self, "internet_ip")

    @property
    @pulumi.getter(name="internetSlbId")
    def internet_slb_id(self) -> pulumi.Output[Optional[str]]:
        """
        The internet SLB ID.
        """
        return pulumi.get(self, "internet_slb_id")

    @property
    @pulumi.getter
    def internets(self) -> pulumi.Output[Sequence['outputs.LoadBalancerInternetInternet']]:
        """
        The bound private network SLB. See the following `Block internet`.
        """
        return pulumi.get(self, "internets")

