# 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 Connection(pulumi.CustomResource):
    customer_gateway_id: pulumi.Output[str]
    """
    The ID of the customer gateway.
    """
    effect_immediately: pulumi.Output[bool]
    """
    Whether to delete a successfully negotiated IPsec tunnel and initiate a negotiation again. Valid value:true,false.
    """
    ike_configs: pulumi.Output[list]
    """
    The configurations of phase-one negotiation.

      * `ikeAuthAlg` (`str`) - The authentication algorithm of phase-one negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
      * `ikeEncAlg` (`str`) - The encryption algorithm of phase-one negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default Valid value: aes
      * `ikeLifetime` (`float`) - The SA lifecycle as the result of phase-one negotiation. The valid value of n is [0, 86400], the unit is second and the default value is 86400.
      * `ikeLocalId` (`str`) - The identification of the VPN gateway.
      * `ikeMode` (`str`) - The negotiation mode of IKE V1. Valid value: main (main mode) | aggressive (aggressive mode). Default value: main
      * `ikePfs` (`str`) - The Diffie-Hellman key exchange algorithm used by phase-one negotiation. Valid value: group1 | group2 | group5 | group14 | group24. Default value: group2
      * `ikeRemoteId` (`str`) - The identification of the customer gateway.
      * `ikeVersion` (`str`) - The version of the IKE protocol. Valid value: ikev1 | ikev2. Default value: ikev1
      * `psk` (`str`) - Used for authentication between the IPsec VPN gateway and the customer gateway.
    """
    ipsec_configs: pulumi.Output[list]
    """
    The configurations of phase-two negotiation.

      * `ipsecAuthAlg` (`str`) - The authentication algorithm of phase-two negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
      * `ipsecEncAlg` (`str`) - The encryption algorithm of phase-two negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default value: aes
      * `ipsecLifetime` (`float`) - The SA lifecycle as the result of phase-two negotiation. The valid value is [0, 86400], the unit is second and the default value is 86400.
      * `ipsecPfs` (`str`) - The Diffie-Hellman key exchange algorithm used by phase-two negotiation. Valid value: group1 | group2 | group5 | group14 | group24| disabled. Default value: group2
    """
    local_subnets: pulumi.Output[list]
    """
    The CIDR block of the VPC to be connected with the local data center. This parameter is used for phase-two negotiation.
    """
    name: pulumi.Output[str]
    """
    The name of the IPsec connection.
    """
    remote_subnets: pulumi.Output[list]
    """
    The CIDR block of the local data center. This parameter is used for phase-two negotiation.
    """
    status: pulumi.Output[str]
    """
    The status of VPN connection.
    """
    vpn_gateway_id: pulumi.Output[str]
    """
    The ID of the VPN gateway.
    """
    def __init__(__self__, resource_name, opts=None, customer_gateway_id=None, effect_immediately=None, ike_configs=None, ipsec_configs=None, local_subnets=None, name=None, remote_subnets=None, vpn_gateway_id=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] ike_configs: The configurations of phase-one negotiation.
        :param pulumi.Input[list] ipsec_configs: The configurations of phase-two negotiation.
        :param pulumi.Input[list] 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] 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.

        The **ike_configs** object supports the following:

          * `ikeAuthAlg` (`pulumi.Input[str]`) - The authentication algorithm of phase-one negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
          * `ikeEncAlg` (`pulumi.Input[str]`) - The encryption algorithm of phase-one negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default Valid value: aes
          * `ikeLifetime` (`pulumi.Input[float]`) - The SA lifecycle as the result of phase-one negotiation. The valid value of n is [0, 86400], the unit is second and the default value is 86400.
          * `ikeLocalId` (`pulumi.Input[str]`) - The identification of the VPN gateway.
          * `ikeMode` (`pulumi.Input[str]`) - The negotiation mode of IKE V1. Valid value: main (main mode) | aggressive (aggressive mode). Default value: main
          * `ikePfs` (`pulumi.Input[str]`) - The Diffie-Hellman key exchange algorithm used by phase-one negotiation. Valid value: group1 | group2 | group5 | group14 | group24. Default value: group2
          * `ikeRemoteId` (`pulumi.Input[str]`) - The identification of the customer gateway.
          * `ikeVersion` (`pulumi.Input[str]`) - The version of the IKE protocol. Valid value: ikev1 | ikev2. Default value: ikev1
          * `psk` (`pulumi.Input[str]`) - Used for authentication between the IPsec VPN gateway and the customer gateway.

        The **ipsec_configs** object supports the following:

          * `ipsecAuthAlg` (`pulumi.Input[str]`) - The authentication algorithm of phase-two negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
          * `ipsecEncAlg` (`pulumi.Input[str]`) - The encryption algorithm of phase-two negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default value: aes
          * `ipsecLifetime` (`pulumi.Input[float]`) - The SA lifecycle as the result of phase-two negotiation. The valid value is [0, 86400], the unit is second and the default value is 86400.
          * `ipsecPfs` (`pulumi.Input[str]`) - The Diffie-Hellman key exchange algorithm used by phase-two negotiation. Valid value: group1 | group2 | group5 | group14 | group24| disabled. Default value: group2
        """
        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, id, opts=None, customer_gateway_id=None, effect_immediately=None, ike_configs=None, ipsec_configs=None, local_subnets=None, name=None, remote_subnets=None, status=None, vpn_gateway_id=None):
        """
        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 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] ike_configs: The configurations of phase-one negotiation.
        :param pulumi.Input[list] ipsec_configs: The configurations of phase-two negotiation.
        :param pulumi.Input[list] 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] 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.

        The **ike_configs** object supports the following:

          * `ikeAuthAlg` (`pulumi.Input[str]`) - The authentication algorithm of phase-one negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
          * `ikeEncAlg` (`pulumi.Input[str]`) - The encryption algorithm of phase-one negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default Valid value: aes
          * `ikeLifetime` (`pulumi.Input[float]`) - The SA lifecycle as the result of phase-one negotiation. The valid value of n is [0, 86400], the unit is second and the default value is 86400.
          * `ikeLocalId` (`pulumi.Input[str]`) - The identification of the VPN gateway.
          * `ikeMode` (`pulumi.Input[str]`) - The negotiation mode of IKE V1. Valid value: main (main mode) | aggressive (aggressive mode). Default value: main
          * `ikePfs` (`pulumi.Input[str]`) - The Diffie-Hellman key exchange algorithm used by phase-one negotiation. Valid value: group1 | group2 | group5 | group14 | group24. Default value: group2
          * `ikeRemoteId` (`pulumi.Input[str]`) - The identification of the customer gateway.
          * `ikeVersion` (`pulumi.Input[str]`) - The version of the IKE protocol. Valid value: ikev1 | ikev2. Default value: ikev1
          * `psk` (`pulumi.Input[str]`) - Used for authentication between the IPsec VPN gateway and the customer gateway.

        The **ipsec_configs** object supports the following:

          * `ipsecAuthAlg` (`pulumi.Input[str]`) - The authentication algorithm of phase-two negotiation. Valid value: md5 | sha1 | sha256 | sha384 | sha512 |. Default value: sha1
          * `ipsecEncAlg` (`pulumi.Input[str]`) - The encryption algorithm of phase-two negotiation. Valid value: aes | aes192 | aes256 | des | 3des. Default value: aes
          * `ipsecLifetime` (`pulumi.Input[float]`) - The SA lifecycle as the result of phase-two negotiation. The valid value is [0, 86400], the unit is second and the default value is 86400.
          * `ipsecPfs` (`pulumi.Input[str]`) - The Diffie-Hellman key exchange algorithm used by phase-two negotiation. Valid value: group1 | group2 | group5 | group14 | group24| disabled. Default value: group2
        """
        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__)
    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

