# 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__ = ['GatewayEndpointArgs', 'GatewayEndpoint']

@pulumi.input_type
class GatewayEndpointArgs:
    def __init__(__self__, *,
                 service_name: pulumi.Input[str],
                 vpc_id: pulumi.Input[str],
                 gateway_endpoint_descrption: Optional[pulumi.Input[str]] = None,
                 gateway_endpoint_name: Optional[pulumi.Input[str]] = None,
                 policy_document: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None):
        """
        The set of arguments for constructing a GatewayEndpoint resource.
        :param pulumi.Input[str] service_name: The name of endpoint service.
        :param pulumi.Input[str] vpc_id: The ID of the VPC.
        :param pulumi.Input[str] gateway_endpoint_descrption: The description of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_name: The name of the gateway endpoint.
        :param pulumi.Input[str] policy_document: Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        :param pulumi.Input[str] resource_group_id: The ID of the resource group to which the instance belongs.
        :param pulumi.Input[Mapping[str, Any]] tags: The tags of the resource.
        """
        pulumi.set(__self__, "service_name", service_name)
        pulumi.set(__self__, "vpc_id", vpc_id)
        if gateway_endpoint_descrption is not None:
            pulumi.set(__self__, "gateway_endpoint_descrption", gateway_endpoint_descrption)
        if gateway_endpoint_name is not None:
            pulumi.set(__self__, "gateway_endpoint_name", gateway_endpoint_name)
        if policy_document is not None:
            pulumi.set(__self__, "policy_document", policy_document)
        if resource_group_id is not None:
            pulumi.set(__self__, "resource_group_id", resource_group_id)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Input[str]:
        """
        The name of endpoint service.
        """
        return pulumi.get(self, "service_name")

    @service_name.setter
    def service_name(self, value: pulumi.Input[str]):
        pulumi.set(self, "service_name", value)

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> pulumi.Input[str]:
        """
        The ID of the VPC.
        """
        return pulumi.get(self, "vpc_id")

    @vpc_id.setter
    def vpc_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "vpc_id", value)

    @property
    @pulumi.getter(name="gatewayEndpointDescrption")
    def gateway_endpoint_descrption(self) -> Optional[pulumi.Input[str]]:
        """
        The description of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_descrption")

    @gateway_endpoint_descrption.setter
    def gateway_endpoint_descrption(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "gateway_endpoint_descrption", value)

    @property
    @pulumi.getter(name="gatewayEndpointName")
    def gateway_endpoint_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_name")

    @gateway_endpoint_name.setter
    def gateway_endpoint_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "gateway_endpoint_name", value)

    @property
    @pulumi.getter(name="policyDocument")
    def policy_document(self) -> Optional[pulumi.Input[str]]:
        """
        Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        """
        return pulumi.get(self, "policy_document")

    @policy_document.setter
    def policy_document(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "policy_document", value)

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the resource group to which the instance belongs.
        """
        return pulumi.get(self, "resource_group_id")

    @resource_group_id.setter
    def resource_group_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "resource_group_id", value)

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        The tags of the resource.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "tags", value)


@pulumi.input_type
class _GatewayEndpointState:
    def __init__(__self__, *,
                 create_time: Optional[pulumi.Input[str]] = None,
                 gateway_endpoint_descrption: Optional[pulumi.Input[str]] = None,
                 gateway_endpoint_name: Optional[pulumi.Input[str]] = None,
                 policy_document: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 status: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 vpc_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering GatewayEndpoint resources.
        :param pulumi.Input[str] create_time: The creation time of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_descrption: The description of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_name: The name of the gateway endpoint.
        :param pulumi.Input[str] policy_document: Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        :param pulumi.Input[str] resource_group_id: The ID of the resource group to which the instance belongs.
        :param pulumi.Input[str] service_name: The name of endpoint service.
        :param pulumi.Input[str] status: The status of VPC gateway endpoint.
        :param pulumi.Input[Mapping[str, Any]] tags: The tags of the resource.
        :param pulumi.Input[str] vpc_id: The ID of the VPC.
        """
        if create_time is not None:
            pulumi.set(__self__, "create_time", create_time)
        if gateway_endpoint_descrption is not None:
            pulumi.set(__self__, "gateway_endpoint_descrption", gateway_endpoint_descrption)
        if gateway_endpoint_name is not None:
            pulumi.set(__self__, "gateway_endpoint_name", gateway_endpoint_name)
        if policy_document is not None:
            pulumi.set(__self__, "policy_document", policy_document)
        if resource_group_id is not None:
            pulumi.set(__self__, "resource_group_id", resource_group_id)
        if service_name is not None:
            pulumi.set(__self__, "service_name", service_name)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if vpc_id is not None:
            pulumi.set(__self__, "vpc_id", vpc_id)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> Optional[pulumi.Input[str]]:
        """
        The creation time of the gateway endpoint.
        """
        return pulumi.get(self, "create_time")

    @create_time.setter
    def create_time(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "create_time", value)

    @property
    @pulumi.getter(name="gatewayEndpointDescrption")
    def gateway_endpoint_descrption(self) -> Optional[pulumi.Input[str]]:
        """
        The description of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_descrption")

    @gateway_endpoint_descrption.setter
    def gateway_endpoint_descrption(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "gateway_endpoint_descrption", value)

    @property
    @pulumi.getter(name="gatewayEndpointName")
    def gateway_endpoint_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_name")

    @gateway_endpoint_name.setter
    def gateway_endpoint_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "gateway_endpoint_name", value)

    @property
    @pulumi.getter(name="policyDocument")
    def policy_document(self) -> Optional[pulumi.Input[str]]:
        """
        Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        """
        return pulumi.get(self, "policy_document")

    @policy_document.setter
    def policy_document(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "policy_document", value)

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the resource group to which the instance belongs.
        """
        return pulumi.get(self, "resource_group_id")

    @resource_group_id.setter
    def resource_group_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "resource_group_id", value)

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

    @service_name.setter
    def service_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "service_name", value)

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input[str]]:
        """
        The status of VPC gateway endpoint.
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Mapping[str, Any]]]:
        """
        The tags of the resource.
        """
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Mapping[str, Any]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the VPC.
        """
        return pulumi.get(self, "vpc_id")

    @vpc_id.setter
    def vpc_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "vpc_id", value)


class GatewayEndpoint(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 gateway_endpoint_descrption: Optional[pulumi.Input[str]] = None,
                 gateway_endpoint_name: Optional[pulumi.Input[str]] = None,
                 policy_document: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 vpc_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Provides a VPC Gateway Endpoint resource. VPC gateway endpoint.

        For information about VPC Gateway Endpoint and how to use it, see [What is Gateway Endpoint](https://www.alibabacloud.com/help/en/virtual-private-cloud/latest/gateway-endpoint).

        > **NOTE:** Available since v1.208.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        domain = config.get("domain")
        if domain is None:
            domain = "com.aliyun.cn-hangzhou.oss"
        default_vpc = alicloud.vpc.Network("defaultVpc", description="tf-example")
        default_rg = alicloud.resourcemanager.ResourceGroup("defaultRg",
            display_name="tf-example-497",
            resource_group_name=name)
        default = alicloud.vpc.GatewayEndpoint("default",
            gateway_endpoint_descrption="test-gateway-endpoint",
            gateway_endpoint_name=name,
            vpc_id=default_vpc.id,
            resource_group_id=default_rg.id,
            service_name=domain,
            policy_document="{ \\"Version\\" : \\"1\\", \\"Statement\\" : [ { \\"Effect\\" : \\"Allow\\", \\"Resource\\" : [ \\"*\\" ], \\"Action\\" : [ \\"*\\" ], \\"Principal\\" : [ \\"*\\" ] } ] }")
        ```

        ## Import

        VPC Gateway Endpoint can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:vpc/gatewayEndpoint:GatewayEndpoint example <id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] gateway_endpoint_descrption: The description of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_name: The name of the gateway endpoint.
        :param pulumi.Input[str] policy_document: Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        :param pulumi.Input[str] resource_group_id: The ID of the resource group to which the instance belongs.
        :param pulumi.Input[str] service_name: The name of endpoint service.
        :param pulumi.Input[Mapping[str, Any]] tags: The tags of the resource.
        :param pulumi.Input[str] vpc_id: The ID of the VPC.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GatewayEndpointArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a VPC Gateway Endpoint resource. VPC gateway endpoint.

        For information about VPC Gateway Endpoint and how to use it, see [What is Gateway Endpoint](https://www.alibabacloud.com/help/en/virtual-private-cloud/latest/gateway-endpoint).

        > **NOTE:** Available since v1.208.0.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        config = pulumi.Config()
        name = config.get("name")
        if name is None:
            name = "terraform-example"
        domain = config.get("domain")
        if domain is None:
            domain = "com.aliyun.cn-hangzhou.oss"
        default_vpc = alicloud.vpc.Network("defaultVpc", description="tf-example")
        default_rg = alicloud.resourcemanager.ResourceGroup("defaultRg",
            display_name="tf-example-497",
            resource_group_name=name)
        default = alicloud.vpc.GatewayEndpoint("default",
            gateway_endpoint_descrption="test-gateway-endpoint",
            gateway_endpoint_name=name,
            vpc_id=default_vpc.id,
            resource_group_id=default_rg.id,
            service_name=domain,
            policy_document="{ \\"Version\\" : \\"1\\", \\"Statement\\" : [ { \\"Effect\\" : \\"Allow\\", \\"Resource\\" : [ \\"*\\" ], \\"Action\\" : [ \\"*\\" ], \\"Principal\\" : [ \\"*\\" ] } ] }")
        ```

        ## Import

        VPC Gateway Endpoint can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:vpc/gatewayEndpoint:GatewayEndpoint example <id>
        ```

        :param str resource_name: The name of the resource.
        :param GatewayEndpointArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(GatewayEndpointArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 gateway_endpoint_descrption: Optional[pulumi.Input[str]] = None,
                 gateway_endpoint_name: Optional[pulumi.Input[str]] = None,
                 policy_document: Optional[pulumi.Input[str]] = None,
                 resource_group_id: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 vpc_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = GatewayEndpointArgs.__new__(GatewayEndpointArgs)

            __props__.__dict__["gateway_endpoint_descrption"] = gateway_endpoint_descrption
            __props__.__dict__["gateway_endpoint_name"] = gateway_endpoint_name
            __props__.__dict__["policy_document"] = policy_document
            __props__.__dict__["resource_group_id"] = resource_group_id
            if service_name is None and not opts.urn:
                raise TypeError("Missing required property 'service_name'")
            __props__.__dict__["service_name"] = service_name
            __props__.__dict__["tags"] = tags
            if vpc_id is None and not opts.urn:
                raise TypeError("Missing required property 'vpc_id'")
            __props__.__dict__["vpc_id"] = vpc_id
            __props__.__dict__["create_time"] = None
            __props__.__dict__["status"] = None
        super(GatewayEndpoint, __self__).__init__(
            'alicloud:vpc/gatewayEndpoint:GatewayEndpoint',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            create_time: Optional[pulumi.Input[str]] = None,
            gateway_endpoint_descrption: Optional[pulumi.Input[str]] = None,
            gateway_endpoint_name: Optional[pulumi.Input[str]] = None,
            policy_document: Optional[pulumi.Input[str]] = None,
            resource_group_id: Optional[pulumi.Input[str]] = None,
            service_name: Optional[pulumi.Input[str]] = None,
            status: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            vpc_id: Optional[pulumi.Input[str]] = None) -> 'GatewayEndpoint':
        """
        Get an existing GatewayEndpoint resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] create_time: The creation time of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_descrption: The description of the gateway endpoint.
        :param pulumi.Input[str] gateway_endpoint_name: The name of the gateway endpoint.
        :param pulumi.Input[str] policy_document: Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        :param pulumi.Input[str] resource_group_id: The ID of the resource group to which the instance belongs.
        :param pulumi.Input[str] service_name: The name of endpoint service.
        :param pulumi.Input[str] status: The status of VPC gateway endpoint.
        :param pulumi.Input[Mapping[str, Any]] tags: The tags of the resource.
        :param pulumi.Input[str] vpc_id: The ID of the VPC.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GatewayEndpointState.__new__(_GatewayEndpointState)

        __props__.__dict__["create_time"] = create_time
        __props__.__dict__["gateway_endpoint_descrption"] = gateway_endpoint_descrption
        __props__.__dict__["gateway_endpoint_name"] = gateway_endpoint_name
        __props__.__dict__["policy_document"] = policy_document
        __props__.__dict__["resource_group_id"] = resource_group_id
        __props__.__dict__["service_name"] = service_name
        __props__.__dict__["status"] = status
        __props__.__dict__["tags"] = tags
        __props__.__dict__["vpc_id"] = vpc_id
        return GatewayEndpoint(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="createTime")
    def create_time(self) -> pulumi.Output[str]:
        """
        The creation time of the gateway endpoint.
        """
        return pulumi.get(self, "create_time")

    @property
    @pulumi.getter(name="gatewayEndpointDescrption")
    def gateway_endpoint_descrption(self) -> pulumi.Output[Optional[str]]:
        """
        The description of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_descrption")

    @property
    @pulumi.getter(name="gatewayEndpointName")
    def gateway_endpoint_name(self) -> pulumi.Output[Optional[str]]:
        """
        The name of the gateway endpoint.
        """
        return pulumi.get(self, "gateway_endpoint_name")

    @property
    @pulumi.getter(name="policyDocument")
    def policy_document(self) -> pulumi.Output[Optional[str]]:
        """
        Access control policies for cloud services. This parameter is required when the cloud service is oss. For details about the syntax and structure of access policies, see [syntax and structure of permission Policies](https://help.aliyun.com/document_detail/93739.html).
        """
        return pulumi.get(self, "policy_document")

    @property
    @pulumi.getter(name="resourceGroupId")
    def resource_group_id(self) -> pulumi.Output[str]:
        """
        The ID of the resource group to which the instance belongs.
        """
        return pulumi.get(self, "resource_group_id")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Output[str]:
        """
        The name of endpoint service.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output[str]:
        """
        The status of VPC gateway endpoint.
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        """
        The tags of the resource.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter(name="vpcId")
    def vpc_id(self) -> pulumi.Output[str]:
        """
        The ID of the VPC.
        """
        return pulumi.get(self, "vpc_id")

