# 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

__all__ = [
    'GetAppResult',
    'AwaitableGetAppResult',
    'get_app',
    'get_app_output',
]

@pulumi.output_type
class GetAppResult:
    """
    A collection of values returned by getApp.
    """
    def __init__(__self__, container_app_environment_id=None, custom_domain_verification_id=None, daprs=None, id=None, identities=None, ingresses=None, latest_revision_fqdn=None, latest_revision_name=None, location=None, name=None, outbound_ip_addresses=None, registries=None, resource_group_name=None, revision_mode=None, secrets=None, tags=None, templates=None, workload_profile_name=None):
        if container_app_environment_id and not isinstance(container_app_environment_id, str):
            raise TypeError("Expected argument 'container_app_environment_id' to be a str")
        pulumi.set(__self__, "container_app_environment_id", container_app_environment_id)
        if custom_domain_verification_id and not isinstance(custom_domain_verification_id, str):
            raise TypeError("Expected argument 'custom_domain_verification_id' to be a str")
        pulumi.set(__self__, "custom_domain_verification_id", custom_domain_verification_id)
        if daprs and not isinstance(daprs, list):
            raise TypeError("Expected argument 'daprs' to be a list")
        pulumi.set(__self__, "daprs", daprs)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if identities and not isinstance(identities, list):
            raise TypeError("Expected argument 'identities' to be a list")
        pulumi.set(__self__, "identities", identities)
        if ingresses and not isinstance(ingresses, list):
            raise TypeError("Expected argument 'ingresses' to be a list")
        pulumi.set(__self__, "ingresses", ingresses)
        if latest_revision_fqdn and not isinstance(latest_revision_fqdn, str):
            raise TypeError("Expected argument 'latest_revision_fqdn' to be a str")
        pulumi.set(__self__, "latest_revision_fqdn", latest_revision_fqdn)
        if latest_revision_name and not isinstance(latest_revision_name, str):
            raise TypeError("Expected argument 'latest_revision_name' to be a str")
        pulumi.set(__self__, "latest_revision_name", latest_revision_name)
        if location and not isinstance(location, str):
            raise TypeError("Expected argument 'location' to be a str")
        pulumi.set(__self__, "location", location)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if outbound_ip_addresses and not isinstance(outbound_ip_addresses, list):
            raise TypeError("Expected argument 'outbound_ip_addresses' to be a list")
        pulumi.set(__self__, "outbound_ip_addresses", outbound_ip_addresses)
        if registries and not isinstance(registries, list):
            raise TypeError("Expected argument 'registries' to be a list")
        pulumi.set(__self__, "registries", registries)
        if resource_group_name and not isinstance(resource_group_name, str):
            raise TypeError("Expected argument 'resource_group_name' to be a str")
        pulumi.set(__self__, "resource_group_name", resource_group_name)
        if revision_mode and not isinstance(revision_mode, str):
            raise TypeError("Expected argument 'revision_mode' to be a str")
        pulumi.set(__self__, "revision_mode", revision_mode)
        if secrets and not isinstance(secrets, list):
            raise TypeError("Expected argument 'secrets' to be a list")
        pulumi.set(__self__, "secrets", secrets)
        if tags and not isinstance(tags, dict):
            raise TypeError("Expected argument 'tags' to be a dict")
        pulumi.set(__self__, "tags", tags)
        if templates and not isinstance(templates, list):
            raise TypeError("Expected argument 'templates' to be a list")
        pulumi.set(__self__, "templates", templates)
        if workload_profile_name and not isinstance(workload_profile_name, str):
            raise TypeError("Expected argument 'workload_profile_name' to be a str")
        pulumi.set(__self__, "workload_profile_name", workload_profile_name)

    @property
    @pulumi.getter(name="containerAppEnvironmentId")
    def container_app_environment_id(self) -> str:
        """
        The ID of the Container App Environment this Container App is linked to.
        """
        return pulumi.get(self, "container_app_environment_id")

    @property
    @pulumi.getter(name="customDomainVerificationId")
    def custom_domain_verification_id(self) -> str:
        return pulumi.get(self, "custom_domain_verification_id")

    @property
    @pulumi.getter
    def daprs(self) -> Sequence['outputs.GetAppDaprResult']:
        """
        A `dapr` block as detailed below.
        """
        return pulumi.get(self, "daprs")

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

    @property
    @pulumi.getter
    def identities(self) -> Sequence['outputs.GetAppIdentityResult']:
        """
        Resource ID for the User Assigned Managed identity to use when pulling from the Container Registry.
        """
        return pulumi.get(self, "identities")

    @property
    @pulumi.getter
    def ingresses(self) -> Sequence['outputs.GetAppIngressResult']:
        """
        An `ingress` block as detailed below.
        """
        return pulumi.get(self, "ingresses")

    @property
    @pulumi.getter(name="latestRevisionFqdn")
    def latest_revision_fqdn(self) -> str:
        return pulumi.get(self, "latest_revision_fqdn")

    @property
    @pulumi.getter(name="latestRevisionName")
    def latest_revision_name(self) -> str:
        return pulumi.get(self, "latest_revision_name")

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

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The hostname of the Certificate. Must be the CN or a named SAN in the certificate.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="outboundIpAddresses")
    def outbound_ip_addresses(self) -> Sequence[str]:
        return pulumi.get(self, "outbound_ip_addresses")

    @property
    @pulumi.getter
    def registries(self) -> Sequence['outputs.GetAppRegistryResult']:
        """
        A `registry` block as detailed below.
        """
        return pulumi.get(self, "registries")

    @property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> str:
        return pulumi.get(self, "resource_group_name")

    @property
    @pulumi.getter(name="revisionMode")
    def revision_mode(self) -> str:
        """
        The revision mode of the Container App.
        """
        return pulumi.get(self, "revision_mode")

    @property
    @pulumi.getter
    def secrets(self) -> Sequence['outputs.GetAppSecretResult']:
        """
        One or more `secret` block as detailed below.
        """
        return pulumi.get(self, "secrets")

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

    @property
    @pulumi.getter
    def templates(self) -> Sequence['outputs.GetAppTemplateResult']:
        """
        A `template` block as detailed below.
        """
        return pulumi.get(self, "templates")

    @property
    @pulumi.getter(name="workloadProfileName")
    def workload_profile_name(self) -> str:
        """
        The name of the Workload Profile in the Container App Environment in which this Container App is running.
        """
        return pulumi.get(self, "workload_profile_name")


class AwaitableGetAppResult(GetAppResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAppResult(
            container_app_environment_id=self.container_app_environment_id,
            custom_domain_verification_id=self.custom_domain_verification_id,
            daprs=self.daprs,
            id=self.id,
            identities=self.identities,
            ingresses=self.ingresses,
            latest_revision_fqdn=self.latest_revision_fqdn,
            latest_revision_name=self.latest_revision_name,
            location=self.location,
            name=self.name,
            outbound_ip_addresses=self.outbound_ip_addresses,
            registries=self.registries,
            resource_group_name=self.resource_group_name,
            revision_mode=self.revision_mode,
            secrets=self.secrets,
            tags=self.tags,
            templates=self.templates,
            workload_profile_name=self.workload_profile_name)


def get_app(name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAppResult:
    """
    Use this data source to access information about an existing Container App.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.containerapp.get_app(name="example-app",
        resource_group_name="example-resources")
    ```


    :param str name: The name of the Container App.
    :param str resource_group_name: The name of the Resource Group where this Container App exists.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['resourceGroupName'] = resource_group_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure:containerapp/getApp:getApp', __args__, opts=opts, typ=GetAppResult).value

    return AwaitableGetAppResult(
        container_app_environment_id=pulumi.get(__ret__, 'container_app_environment_id'),
        custom_domain_verification_id=pulumi.get(__ret__, 'custom_domain_verification_id'),
        daprs=pulumi.get(__ret__, 'daprs'),
        id=pulumi.get(__ret__, 'id'),
        identities=pulumi.get(__ret__, 'identities'),
        ingresses=pulumi.get(__ret__, 'ingresses'),
        latest_revision_fqdn=pulumi.get(__ret__, 'latest_revision_fqdn'),
        latest_revision_name=pulumi.get(__ret__, 'latest_revision_name'),
        location=pulumi.get(__ret__, 'location'),
        name=pulumi.get(__ret__, 'name'),
        outbound_ip_addresses=pulumi.get(__ret__, 'outbound_ip_addresses'),
        registries=pulumi.get(__ret__, 'registries'),
        resource_group_name=pulumi.get(__ret__, 'resource_group_name'),
        revision_mode=pulumi.get(__ret__, 'revision_mode'),
        secrets=pulumi.get(__ret__, 'secrets'),
        tags=pulumi.get(__ret__, 'tags'),
        templates=pulumi.get(__ret__, 'templates'),
        workload_profile_name=pulumi.get(__ret__, 'workload_profile_name'))


@_utilities.lift_output_func(get_app)
def get_app_output(name: Optional[pulumi.Input[str]] = None,
                   resource_group_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAppResult]:
    """
    Use this data source to access information about an existing Container App.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.containerapp.get_app(name="example-app",
        resource_group_name="example-resources")
    ```


    :param str name: The name of the Container App.
    :param str resource_group_name: The name of the Resource Group where this Container App exists.
    """
    ...
