# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['Connection']


class Connection(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 customer_gateway_id: Optional[pulumi.Input[str]] = None,
                 effect_immediately: Optional[pulumi.Input[bool]] = None,
                 ike_configs: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIkeConfigArgs']]]]] = None,
                 ipsec_configs: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIpsecConfigArgs']]]]] = None,
                 local_subnets: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 remote_subnets: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
                 vpn_gateway_id: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Create a Connection resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] customer_gateway_id: The ID of the customer gateway.
        :param pulumi.Input[bool] effect_immediately: Whether to delete a successfully negotiated IPsec tunnel and initiate a negotiation again. Valid value:true,false.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIkeConfigArgs']]]] ike_configs: The configurations of phase-one negotiation.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIpsecConfigArgs']]]] ipsec_configs: The configurations of phase-two negotiation.
        :param pulumi.Input[List[pulumi.Input[str]]] local_subnets: The CIDR block of the VPC to be connected with the local data center. This parameter is used for phase-two negotiation.
        :param pulumi.Input[str] name: The name of the IPsec connection.
        :param pulumi.Input[List[pulumi.Input[str]]] remote_subnets: The CIDR block of the local data center. This parameter is used for phase-two negotiation.
        :param pulumi.Input[str] vpn_gateway_id: The ID of the VPN gateway.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        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__ = dict()

            if customer_gateway_id is None:
                raise TypeError("Missing required property 'customer_gateway_id'")
            __props__['customer_gateway_id'] = customer_gateway_id
            __props__['effect_immediately'] = effect_immediately
            __props__['ike_configs'] = ike_configs
            __props__['ipsec_configs'] = ipsec_configs
            if local_subnets is None:
                raise TypeError("Missing required property 'local_subnets'")
            __props__['local_subnets'] = local_subnets
            __props__['name'] = name
            if remote_subnets is None:
                raise TypeError("Missing required property 'remote_subnets'")
            __props__['remote_subnets'] = remote_subnets
            if vpn_gateway_id is None:
                raise TypeError("Missing required property 'vpn_gateway_id'")
            __props__['vpn_gateway_id'] = vpn_gateway_id
            __props__['status'] = None
        super(Connection, __self__).__init__(
            'alicloud:vpn/connection:Connection',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            customer_gateway_id: Optional[pulumi.Input[str]] = None,
            effect_immediately: Optional[pulumi.Input[bool]] = None,
            ike_configs: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIkeConfigArgs']]]]] = None,
            ipsec_configs: Optional[pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIpsecConfigArgs']]]]] = None,
            local_subnets: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            name: Optional[pulumi.Input[str]] = None,
            remote_subnets: Optional[pulumi.Input[List[pulumi.Input[str]]]] = None,
            status: Optional[pulumi.Input[str]] = None,
            vpn_gateway_id: Optional[pulumi.Input[str]] = None) -> 'Connection':
        """
        Get an existing Connection 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] customer_gateway_id: The ID of the customer gateway.
        :param pulumi.Input[bool] effect_immediately: Whether to delete a successfully negotiated IPsec tunnel and initiate a negotiation again. Valid value:true,false.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIkeConfigArgs']]]] ike_configs: The configurations of phase-one negotiation.
        :param pulumi.Input[List[pulumi.Input[pulumi.InputType['ConnectionIpsecConfigArgs']]]] ipsec_configs: The configurations of phase-two negotiation.
        :param pulumi.Input[List[pulumi.Input[str]]] local_subnets: The CIDR block of the VPC to be connected with the local data center. This parameter is used for phase-two negotiation.
        :param pulumi.Input[str] name: The name of the IPsec connection.
        :param pulumi.Input[List[pulumi.Input[str]]] remote_subnets: The CIDR block of the local data center. This parameter is used for phase-two negotiation.
        :param pulumi.Input[str] status: The status of VPN connection.
        :param pulumi.Input[str] vpn_gateway_id: The ID of the VPN gateway.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["customer_gateway_id"] = customer_gateway_id
        __props__["effect_immediately"] = effect_immediately
        __props__["ike_configs"] = ike_configs
        __props__["ipsec_configs"] = ipsec_configs
        __props__["local_subnets"] = local_subnets
        __props__["name"] = name
        __props__["remote_subnets"] = remote_subnets
        __props__["status"] = status
        __props__["vpn_gateway_id"] = vpn_gateway_id
        return Connection(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="customerGatewayId")
    def customer_gateway_id(self) -> pulumi.Output[str]:
        """
        The ID of the customer gateway.
        """
        return pulumi.get(self, "customer_gateway_id")

    @property
    @pulumi.getter(name="effectImmediately")
    def effect_immediately(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether to delete a successfully negotiated IPsec tunnel and initiate a negotiation again. Valid value:true,false.
        """
        return pulumi.get(self, "effect_immediately")

    @property
    @pulumi.getter(name="ikeConfigs")
    def ike_configs(self) -> pulumi.Output[List['outputs.ConnectionIkeConfig']]:
        """
        The configurations of phase-one negotiation.
        """
        return pulumi.get(self, "ike_configs")

    @property
    @pulumi.getter(name="ipsecConfigs")
    def ipsec_configs(self) -> pulumi.Output[List['outputs.ConnectionIpsecConfig']]:
        """
        The configurations of phase-two negotiation.
        """
        return pulumi.get(self, "ipsec_configs")

    @property
    @pulumi.getter(name="localSubnets")
    def local_subnets(self) -> pulumi.Output[List[str]]:
        """
        The CIDR block of the VPC to be connected with the local data center. This parameter is used for phase-two negotiation.
        """
        return pulumi.get(self, "local_subnets")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name of the IPsec connection.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="remoteSubnets")
    def remote_subnets(self) -> pulumi.Output[List[str]]:
        """
        The CIDR block of the local data center. This parameter is used for phase-two negotiation.
        """
        return pulumi.get(self, "remote_subnets")

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

    @property
    @pulumi.getter(name="vpnGatewayId")
    def vpn_gateway_id(self) -> pulumi.Output[str]:
        """
        The ID of the VPN gateway.
        """
        return pulumi.get(self, "vpn_gateway_id")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

