# 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 RouterInterfaceConnection(pulumi.CustomResource):
    interface_id: pulumi.Output[str]
    """
    One side router interface ID.
    """
    opposite_interface_id: pulumi.Output[str]
    """
    Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
    """
    opposite_interface_owner_id: pulumi.Output[str]
    opposite_router_id: pulumi.Output[str]
    """
    Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
    """
    opposite_router_type: pulumi.Output[str]
    """
    Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.
    """
    def __init__(__self__, resource_name, opts=None, interface_id=None, opposite_interface_id=None, opposite_interface_owner_id=None, opposite_router_id=None, opposite_router_type=None, __props__=None, __name__=None, __opts__=None):
        """
        Provides a VPC router interface connection resource to connect two router interfaces which are in two different VPCs.
        After that, all of the two router interfaces will be active.
        
        > **NOTE:** At present, Router interface does not support changing opposite router interface, the connection delete action is only deactivating it to inactive, not modifying the connection to empty.
        
        > **NOTE:** If you want to changing opposite router interface, you can delete router interface and re-build them.
        
        > **NOTE:** A integrated router interface connection tunnel requires both InitiatingSide and AcceptingSide configuring opposite router interface.
        
        > **NOTE:** Please remember to add a `depends_on` clause in the router interface connection from the InitiatingSide to the AcceptingSide, because the connection from the AcceptingSide to the InitiatingSide must be done first.
        
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] interface_id: One side router interface ID.
        :param pulumi.Input[str] opposite_interface_id: Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
        :param pulumi.Input[str] opposite_router_id: Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
        :param pulumi.Input[str] opposite_router_type: Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/router_interface_connection.html.markdown.
        """
        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 interface_id is None:
                raise TypeError("Missing required property 'interface_id'")
            __props__['interface_id'] = interface_id
            if opposite_interface_id is None:
                raise TypeError("Missing required property 'opposite_interface_id'")
            __props__['opposite_interface_id'] = opposite_interface_id
            __props__['opposite_interface_owner_id'] = opposite_interface_owner_id
            __props__['opposite_router_id'] = opposite_router_id
            __props__['opposite_router_type'] = opposite_router_type
        super(RouterInterfaceConnection, __self__).__init__(
            'alicloud:vpc/routerInterfaceConnection:RouterInterfaceConnection',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, interface_id=None, opposite_interface_id=None, opposite_interface_owner_id=None, opposite_router_id=None, opposite_router_type=None):
        """
        Get an existing RouterInterfaceConnection 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] interface_id: One side router interface ID.
        :param pulumi.Input[str] opposite_interface_id: Another side router interface ID. It must belong the specified "opposite_interface_owner_id" account.
        :param pulumi.Input[str] opposite_router_id: Another side router ID. It must belong the specified "opposite_interface_owner_id" account. It is valid when field "opposite_interface_owner_id" is specified.
        :param pulumi.Input[str] opposite_router_type: Another side router Type. Optional value: VRouter, VBR. It is valid when field "opposite_interface_owner_id" is specified.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/router_interface_connection.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["interface_id"] = interface_id
        __props__["opposite_interface_id"] = opposite_interface_id
        __props__["opposite_interface_owner_id"] = opposite_interface_owner_id
        __props__["opposite_router_id"] = opposite_router_id
        __props__["opposite_router_type"] = opposite_router_type
        return RouterInterfaceConnection(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

