# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetSecGroupResult:
    """
    A collection of values returned by getSecGroup.
    """
    def __init__(__self__, all_tags=None, description=None, id=None, name=None, region=None, secgroup_id=None, tags=None, tenant_id=None):
        if all_tags and not isinstance(all_tags, list):
            raise TypeError("Expected argument 'all_tags' to be a list")
        __self__.all_tags = all_tags
        """
        The set of string tags applied on the security group.
        """
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        __self__.description = description
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        __self__.name = name
        """
        See Argument Reference above.
        * `description`- See Argument Reference above.
        """
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        __self__.region = region
        """
        See Argument Reference above.
        """
        if secgroup_id and not isinstance(secgroup_id, str):
            raise TypeError("Expected argument 'secgroup_id' to be a str")
        __self__.secgroup_id = secgroup_id
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        __self__.tags = tags
        if tenant_id and not isinstance(tenant_id, str):
            raise TypeError("Expected argument 'tenant_id' to be a str")
        __self__.tenant_id = tenant_id
class AwaitableGetSecGroupResult(GetSecGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSecGroupResult(
            all_tags=self.all_tags,
            description=self.description,
            id=self.id,
            name=self.name,
            region=self.region,
            secgroup_id=self.secgroup_id,
            tags=self.tags,
            tenant_id=self.tenant_id)

def get_sec_group(description=None,name=None,region=None,secgroup_id=None,tags=None,tenant_id=None,opts=None):
    """
    Use this data source to get the ID of an available OpenStack security group.




    :param str description: Human-readable description the the subnet.
    :param str name: The name of the security group.
    :param str region: The region in which to obtain the V2 Neutron client.
           A Neutron client is needed to retrieve security groups ids. If omitted, the
           `region` argument of the provider is used.
    :param str secgroup_id: The ID of the security group.
    :param list tags: The list of security group tags to filter.
    :param str tenant_id: The owner of the security group.
    """
    __args__ = dict()


    __args__['description'] = description
    __args__['name'] = name
    __args__['region'] = region
    __args__['secgroupId'] = secgroup_id
    __args__['tags'] = tags
    __args__['tenantId'] = tenant_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('openstack:networking/getSecGroup:getSecGroup', __args__, opts=opts).value

    return AwaitableGetSecGroupResult(
        all_tags=__ret__.get('allTags'),
        description=__ret__.get('description'),
        id=__ret__.get('id'),
        name=__ret__.get('name'),
        region=__ret__.get('region'),
        secgroup_id=__ret__.get('secgroupId'),
        tags=__ret__.get('tags'),
        tenant_id=__ret__.get('tenantId'))
