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

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

__all__ = [
    'GetServiceComponentResult',
    'AwaitableGetServiceComponentResult',
    'get_service_component',
    'get_service_component_output',
]

@pulumi.output_type
class GetServiceComponentResult:
    """
    A collection of values returned by getServiceComponent.
    """
    def __init__(__self__, component=None, host=None, id=None, kafka_authentication_method=None, port=None, project=None, route=None, service_name=None, ssl=None, usage=None):
        if component and not isinstance(component, str):
            raise TypeError("Expected argument 'component' to be a str")
        pulumi.set(__self__, "component", component)
        if host and not isinstance(host, str):
            raise TypeError("Expected argument 'host' to be a str")
        pulumi.set(__self__, "host", host)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if kafka_authentication_method and not isinstance(kafka_authentication_method, str):
            raise TypeError("Expected argument 'kafka_authentication_method' to be a str")
        pulumi.set(__self__, "kafka_authentication_method", kafka_authentication_method)
        if port and not isinstance(port, int):
            raise TypeError("Expected argument 'port' to be a int")
        pulumi.set(__self__, "port", port)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if route and not isinstance(route, str):
            raise TypeError("Expected argument 'route' to be a str")
        pulumi.set(__self__, "route", route)
        if service_name and not isinstance(service_name, str):
            raise TypeError("Expected argument 'service_name' to be a str")
        pulumi.set(__self__, "service_name", service_name)
        if ssl and not isinstance(ssl, bool):
            raise TypeError("Expected argument 'ssl' to be a bool")
        pulumi.set(__self__, "ssl", ssl)
        if usage and not isinstance(usage, str):
            raise TypeError("Expected argument 'usage' to be a str")
        pulumi.set(__self__, "usage", usage)

    @property
    @pulumi.getter
    def component(self) -> str:
        """
        Service component name
        """
        return pulumi.get(self, "component")

    @property
    @pulumi.getter
    def host(self) -> str:
        """
        DNS name for connecting to the service component
        """
        return pulumi.get(self, "host")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="kafkaAuthenticationMethod")
    def kafka_authentication_method(self) -> Optional[str]:
        """
        Kafka authentication method. This is a value specific to the 'kafka' service component
        """
        return pulumi.get(self, "kafka_authentication_method")

    @property
    @pulumi.getter
    def port(self) -> int:
        """
        Port number for connecting to the service component
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter
    def project(self) -> str:
        """
        Project name
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter
    def route(self) -> Optional[str]:
        """
        Network access route
        """
        return pulumi.get(self, "route")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> Optional[str]:
        """
        Service name
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def ssl(self) -> Optional[bool]:
        """
        Whether the endpoint is encrypted or accepts plaintext. By default endpoints are always encrypted and this property is only included for service components that may disable encryption
        """
        return pulumi.get(self, "ssl")

    @property
    @pulumi.getter
    def usage(self) -> Optional[str]:
        """
        DNS usage name
        """
        return pulumi.get(self, "usage")


class AwaitableGetServiceComponentResult(GetServiceComponentResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetServiceComponentResult(
            component=self.component,
            host=self.host,
            id=self.id,
            kafka_authentication_method=self.kafka_authentication_method,
            port=self.port,
            project=self.project,
            route=self.route,
            service_name=self.service_name,
            ssl=self.ssl,
            usage=self.usage)


def get_service_component(component: Optional[str] = None,
                          kafka_authentication_method: Optional[str] = None,
                          project: Optional[str] = None,
                          route: Optional[str] = None,
                          service_name: Optional[str] = None,
                          ssl: Optional[bool] = None,
                          usage: Optional[str] = None,
                          opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetServiceComponentResult:
    """
    The Service Component data source provides information about the existing Aiven service Component.

    Service components can be defined to get the connection info for specific service. Services may support multiple different access routes (VPC peering and public access), have additional components or support various authentication methods. Each of these may be represented by different DNS name or TCP port and the specific component to match can be selected by specifying appropriate filters as shown below.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    sc1 = aiven.get_service_component(project=project1["project"],
        service_name=service1["serviceName"],
        component="kafka",
        route="dynamic",
        kafka_authentication_method="certificate")
    ```


    :param str component: Service component name
    :param str kafka_authentication_method: Kafka authentication method. This is a value specific to the 'kafka' service component
    :param str project: Project name
    :param str route: Network access route
    :param str service_name: Service name
    :param bool ssl: Whether the endpoint is encrypted or accepts plaintext. By default endpoints are always encrypted and this property is only included for service components that may disable encryption
    :param str usage: DNS usage name
    """
    __args__ = dict()
    __args__['component'] = component
    __args__['kafkaAuthenticationMethod'] = kafka_authentication_method
    __args__['project'] = project
    __args__['route'] = route
    __args__['serviceName'] = service_name
    __args__['ssl'] = ssl
    __args__['usage'] = usage
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('aiven:index/getServiceComponent:getServiceComponent', __args__, opts=opts, typ=GetServiceComponentResult).value

    return AwaitableGetServiceComponentResult(
        component=pulumi.get(__ret__, 'component'),
        host=pulumi.get(__ret__, 'host'),
        id=pulumi.get(__ret__, 'id'),
        kafka_authentication_method=pulumi.get(__ret__, 'kafka_authentication_method'),
        port=pulumi.get(__ret__, 'port'),
        project=pulumi.get(__ret__, 'project'),
        route=pulumi.get(__ret__, 'route'),
        service_name=pulumi.get(__ret__, 'service_name'),
        ssl=pulumi.get(__ret__, 'ssl'),
        usage=pulumi.get(__ret__, 'usage'))


@_utilities.lift_output_func(get_service_component)
def get_service_component_output(component: Optional[pulumi.Input[str]] = None,
                                 kafka_authentication_method: Optional[pulumi.Input[Optional[str]]] = None,
                                 project: Optional[pulumi.Input[str]] = None,
                                 route: Optional[pulumi.Input[Optional[str]]] = None,
                                 service_name: Optional[pulumi.Input[Optional[str]]] = None,
                                 ssl: Optional[pulumi.Input[Optional[bool]]] = None,
                                 usage: Optional[pulumi.Input[Optional[str]]] = None,
                                 opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetServiceComponentResult]:
    """
    The Service Component data source provides information about the existing Aiven service Component.

    Service components can be defined to get the connection info for specific service. Services may support multiple different access routes (VPC peering and public access), have additional components or support various authentication methods. Each of these may be represented by different DNS name or TCP port and the specific component to match can be selected by specifying appropriate filters as shown below.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_aiven as aiven

    sc1 = aiven.get_service_component(project=project1["project"],
        service_name=service1["serviceName"],
        component="kafka",
        route="dynamic",
        kafka_authentication_method="certificate")
    ```


    :param str component: Service component name
    :param str kafka_authentication_method: Kafka authentication method. This is a value specific to the 'kafka' service component
    :param str project: Project name
    :param str route: Network access route
    :param str service_name: Service name
    :param bool ssl: Whether the endpoint is encrypted or accepts plaintext. By default endpoints are always encrypted and this property is only included for service components that may disable encryption
    :param str usage: DNS usage name
    """
    ...
