# 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 builtins
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs

__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__, creation_time=None, description=None, egress_permissions=None, id=None, ingress_permissions=None, project_name=None, security_group_id=None, security_group_name=None, service_managed=None, status=None, tags=None, type=None, vpc_id=None):
        if creation_time and not isinstance(creation_time, str):
            raise TypeError("Expected argument 'creation_time' to be a str")
        pulumi.set(__self__, "creation_time", creation_time)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if egress_permissions and not isinstance(egress_permissions, list):
            raise TypeError("Expected argument 'egress_permissions' to be a list")
        pulumi.set(__self__, "egress_permissions", egress_permissions)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ingress_permissions and not isinstance(ingress_permissions, list):
            raise TypeError("Expected argument 'ingress_permissions' to be a list")
        pulumi.set(__self__, "ingress_permissions", ingress_permissions)
        if project_name and not isinstance(project_name, str):
            raise TypeError("Expected argument 'project_name' to be a str")
        pulumi.set(__self__, "project_name", project_name)
        if security_group_id and not isinstance(security_group_id, str):
            raise TypeError("Expected argument 'security_group_id' to be a str")
        pulumi.set(__self__, "security_group_id", security_group_id)
        if security_group_name and not isinstance(security_group_name, str):
            raise TypeError("Expected argument 'security_group_name' to be a str")
        pulumi.set(__self__, "security_group_name", security_group_name)
        if service_managed and not isinstance(service_managed, bool):
            raise TypeError("Expected argument 'service_managed' to be a bool")
        pulumi.set(__self__, "service_managed", service_managed)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if vpc_id and not isinstance(vpc_id, str):
            raise TypeError("Expected argument 'vpc_id' to be a str")
        pulumi.set(__self__, "vpc_id", vpc_id)

    @property
    @pulumi.getter(name="creationTime")
    def creation_time(self) -> builtins.str:
        """
        安全组创建时间。
        """
        return pulumi.get(self, "creation_time")

    @property
    @pulumi.getter
    def description(self) -> builtins.str:
        """
        安全组的描述信息。长度限制为0~ 255个字符。需要以字母、中文或数字开头。可包含英文逗号（,）、点号（.）、下划线（_）、空格（ ）、等号（=）、短横线（-）、中文逗号（，）、中文句号（。）。不填默认空字符串。
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="egressPermissions")
    def egress_permissions(self) -> Sequence['outputs.GetSecurityGroupEgressPermissionResult']:
        """
        安全组出向规则描述信息。未改动的信息按照原信息返回，未填或者变动的内容视为修改，请按需填写。
        """
        return pulumi.get(self, "egress_permissions")

    @property
    @pulumi.getter
    def id(self) -> builtins.str:
        """
        Uniquely identifies the resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="ingressPermissions")
    def ingress_permissions(self) -> Sequence['outputs.GetSecurityGroupIngressPermissionResult']:
        """
        安全组入向规则描述信息。未改动的信息按照原信息返回，未填或者变动的内容视为修改，请按需填写。
        """
        return pulumi.get(self, "ingress_permissions")

    @property
    @pulumi.getter(name="projectName")
    def project_name(self) -> builtins.str:
        """
        安全组所属项目名称。不填默认项目为default。
        """
        return pulumi.get(self, "project_name")

    @property
    @pulumi.getter(name="securityGroupId")
    def security_group_id(self) -> builtins.str:
        """
        安全组ID。
        """
        return pulumi.get(self, "security_group_id")

    @property
    @pulumi.getter(name="securityGroupName")
    def security_group_name(self) -> builtins.str:
        """
        安全组的名称。长度限制为1 ~ 128个字符。需要以字母、中文或数字开头，可包含点号（.）、下划线（_）和短横线（-）。不填默认是安全组的ID。
        """
        return pulumi.get(self, "security_group_name")

    @property
    @pulumi.getter(name="serviceManaged")
    def service_managed(self) -> builtins.bool:
        """
        安全组是否为托管安全组。true为托管安全组，false为非托管安全组。
        """
        return pulumi.get(self, "service_managed")

    @property
    @pulumi.getter
    def status(self) -> builtins.str:
        """
        安全组状态。Available为可用，Creating为创建中。
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence['outputs.GetSecurityGroupTagResult']:
        """
        标签列表。
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def type(self) -> builtins.str:
        """
        安全组类型。1、default：默认安全组。2、normal：自定义安全组。3、VpnGW： VPN网关安全组。4、NatGW： Nat网关安全组。 5、cidr_only：CIDR-Only安全组。
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> builtins.str:
        """
        安全组所属的VPC ID。
        """
        return pulumi.get(self, "vpc_id")


class AwaitableGetSecurityGroupResult(GetSecurityGroupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetSecurityGroupResult(
            creation_time=self.creation_time,
            description=self.description,
            egress_permissions=self.egress_permissions,
            id=self.id,
            ingress_permissions=self.ingress_permissions,
            project_name=self.project_name,
            security_group_id=self.security_group_id,
            security_group_name=self.security_group_name,
            service_managed=self.service_managed,
            status=self.status,
            tags=self.tags,
            type=self.type,
            vpc_id=self.vpc_id)


def get_security_group(id: Optional[builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetSecurityGroupResult:
    """
    Data Source schema for Byteplus::VPC::SecurityGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('bytepluscc:vpc/getSecurityGroup:getSecurityGroup', __args__, opts=opts, typ=GetSecurityGroupResult).value

    return AwaitableGetSecurityGroupResult(
        creation_time=pulumi.get(__ret__, 'creation_time'),
        description=pulumi.get(__ret__, 'description'),
        egress_permissions=pulumi.get(__ret__, 'egress_permissions'),
        id=pulumi.get(__ret__, 'id'),
        ingress_permissions=pulumi.get(__ret__, 'ingress_permissions'),
        project_name=pulumi.get(__ret__, 'project_name'),
        security_group_id=pulumi.get(__ret__, 'security_group_id'),
        security_group_name=pulumi.get(__ret__, 'security_group_name'),
        service_managed=pulumi.get(__ret__, 'service_managed'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        type=pulumi.get(__ret__, 'type'),
        vpc_id=pulumi.get(__ret__, 'vpc_id'))
def get_security_group_output(id: Optional[pulumi.Input[builtins.str]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetSecurityGroupResult]:
    """
    Data Source schema for Byteplus::VPC::SecurityGroup


    :param builtins.str id: Uniquely identifies the resource.
    """
    __args__ = dict()
    __args__['id'] = id
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('bytepluscc:vpc/getSecurityGroup:getSecurityGroup', __args__, opts=opts, typ=GetSecurityGroupResult)
    return __ret__.apply(lambda __response__: GetSecurityGroupResult(
        creation_time=pulumi.get(__response__, 'creation_time'),
        description=pulumi.get(__response__, 'description'),
        egress_permissions=pulumi.get(__response__, 'egress_permissions'),
        id=pulumi.get(__response__, 'id'),
        ingress_permissions=pulumi.get(__response__, 'ingress_permissions'),
        project_name=pulumi.get(__response__, 'project_name'),
        security_group_id=pulumi.get(__response__, 'security_group_id'),
        security_group_name=pulumi.get(__response__, 'security_group_name'),
        service_managed=pulumi.get(__response__, 'service_managed'),
        status=pulumi.get(__response__, 'status'),
        tags=pulumi.get(__response__, 'tags'),
        type=pulumi.get(__response__, 'type'),
        vpc_id=pulumi.get(__response__, 'vpc_id')))
