# 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__ = [
    'GetSecurityGroupResult',
    'AwaitableGetSecurityGroupResult',
    'get_security_group',
    'get_security_group_output',
]

@pulumi.output_type
class GetSecurityGroupResult:
    """
    A collection of values returned by getSecurityGroup.
    """
    def __init__(__self__, created_at=None, description=None, external_id=None, external_region_id=None, filter=None, id=None, links=None, name=None, organization_id=None, owner=None, rules=None, updated_at=None):
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if external_id and not isinstance(external_id, str):
            raise TypeError("Expected argument 'external_id' to be a str")
        pulumi.set(__self__, "external_id", external_id)
        if external_region_id and not isinstance(external_region_id, str):
            raise TypeError("Expected argument 'external_region_id' to be a str")
        pulumi.set(__self__, "external_region_id", external_region_id)
        if filter and not isinstance(filter, str):
            raise TypeError("Expected argument 'filter' to be a str")
        pulumi.set(__self__, "filter", filter)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if links and not isinstance(links, list):
            raise TypeError("Expected argument 'links' to be a list")
        pulumi.set(__self__, "links", links)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if organization_id and not isinstance(organization_id, str):
            raise TypeError("Expected argument 'organization_id' to be a str")
        pulumi.set(__self__, "organization_id", organization_id)
        if owner and not isinstance(owner, str):
            raise TypeError("Expected argument 'owner' to be a str")
        pulumi.set(__self__, "owner", owner)
        if rules and not isinstance(rules, list):
            raise TypeError("Expected argument 'rules' to be a list")
        pulumi.set(__self__, "rules", rules)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        """
        Date when the entity was created. The date is in ISO 6801 and UTC.
        """
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        A human-friendly description of the security groups.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="externalId")
    def external_id(self) -> str:
        """
        External entity Id on the provider side.
        """
        return pulumi.get(self, "external_id")

    @property
    @pulumi.getter(name="externalRegionId")
    def external_region_id(self) -> str:
        """
        The id of the region for which this entity is defined.
        """
        return pulumi.get(self, "external_region_id")

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

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        ID of the security group.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def links(self) -> Sequence['outputs.GetSecurityGroupLinkResult']:
        """
        HATEOAS of the entity
        """
        return pulumi.get(self, "links")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        Name of the security group.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="organizationId")
    def organization_id(self) -> str:
        """
        ID of organization that entity belongs to.
        """
        return pulumi.get(self, "organization_id")

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

    @property
    @pulumi.getter
    def rules(self) -> Optional[Sequence['outputs.GetSecurityGroupRuleResult']]:
        """
        List of security rules.
        """
        return pulumi.get(self, "rules")

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> str:
        """
        Date when the entity was last updated. The date is ISO 8601 and UTC.
        """
        return pulumi.get(self, "updated_at")


class AwaitableGetSecurityGroupResult(GetSecurityGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSecurityGroupResult(
            created_at=self.created_at,
            description=self.description,
            external_id=self.external_id,
            external_region_id=self.external_region_id,
            filter=self.filter,
            id=self.id,
            links=self.links,
            name=self.name,
            organization_id=self.organization_id,
            owner=self.owner,
            rules=self.rules,
            updated_at=self.updated_at)


def get_security_group(filter: Optional[str] = None,
                       rules: Optional[Sequence[pulumi.InputType['GetSecurityGroupRuleArgs']]] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSecurityGroupResult:
    """
    ## Example Usage
    ### S
    This is an example of how to lookup security groups.

    **Security groups by filter query:**

    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.securitygroup.get_security_group(filter=f"name eq '{var['name']}'")
    ```

    A Security group supports the following arguments:


    :param str filter: Search criteria to narrow down the Security groups.
    :param Sequence[pulumi.InputType['GetSecurityGroupRuleArgs']] rules: List of security rules.
    """
    __args__ = dict()
    __args__['filter'] = filter
    __args__['rules'] = rules
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('vra:securitygroup/getSecurityGroup:getSecurityGroup', __args__, opts=opts, typ=GetSecurityGroupResult).value

    return AwaitableGetSecurityGroupResult(
        created_at=__ret__.created_at,
        description=__ret__.description,
        external_id=__ret__.external_id,
        external_region_id=__ret__.external_region_id,
        filter=__ret__.filter,
        id=__ret__.id,
        links=__ret__.links,
        name=__ret__.name,
        organization_id=__ret__.organization_id,
        owner=__ret__.owner,
        rules=__ret__.rules,
        updated_at=__ret__.updated_at)


@_utilities.lift_output_func(get_security_group)
def get_security_group_output(filter: Optional[pulumi.Input[str]] = None,
                              rules: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetSecurityGroupRuleArgs']]]]] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetSecurityGroupResult]:
    """
    ## Example Usage
    ### S
    This is an example of how to lookup security groups.

    **Security groups by filter query:**

    ```python
    import pulumi
    import pulumi_vra as vra

    this = vra.securitygroup.get_security_group(filter=f"name eq '{var['name']}'")
    ```

    A Security group supports the following arguments:


    :param str filter: Search criteria to narrow down the Security groups.
    :param Sequence[pulumi.InputType['GetSecurityGroupRuleArgs']] rules: List of security rules.
    """
    ...
