# 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__ = ['GrantRuleToCenArgs', 'GrantRuleToCen']

@pulumi.input_type
class GrantRuleToCenArgs:
    def __init__(__self__, *,
                 cen_id: pulumi.Input[str],
                 cen_owner_id: pulumi.Input[int],
                 instance_id: pulumi.Input[str]):
        """
        The set of arguments for constructing a GrantRuleToCen resource.
        :param pulumi.Input[str] cen_id: The ID of the CEN instance to which you want to grant permissions.
        :param pulumi.Input[int] cen_owner_id: The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        :param pulumi.Input[str] instance_id: The ID of the VBR.
        """
        pulumi.set(__self__, "cen_id", cen_id)
        pulumi.set(__self__, "cen_owner_id", cen_owner_id)
        pulumi.set(__self__, "instance_id", instance_id)

    @property
    @pulumi.getter(name="cenId")
    def cen_id(self) -> pulumi.Input[str]:
        """
        The ID of the CEN instance to which you want to grant permissions.
        """
        return pulumi.get(self, "cen_id")

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

    @property
    @pulumi.getter(name="cenOwnerId")
    def cen_owner_id(self) -> pulumi.Input[int]:
        """
        The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        """
        return pulumi.get(self, "cen_owner_id")

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

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

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


@pulumi.input_type
class _GrantRuleToCenState:
    def __init__(__self__, *,
                 cen_id: Optional[pulumi.Input[str]] = None,
                 cen_owner_id: Optional[pulumi.Input[int]] = None,
                 instance_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering GrantRuleToCen resources.
        :param pulumi.Input[str] cen_id: The ID of the CEN instance to which you want to grant permissions.
        :param pulumi.Input[int] cen_owner_id: The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        :param pulumi.Input[str] instance_id: The ID of the VBR.
        """
        if cen_id is not None:
            pulumi.set(__self__, "cen_id", cen_id)
        if cen_owner_id is not None:
            pulumi.set(__self__, "cen_owner_id", cen_owner_id)
        if instance_id is not None:
            pulumi.set(__self__, "instance_id", instance_id)

    @property
    @pulumi.getter(name="cenId")
    def cen_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the CEN instance to which you want to grant permissions.
        """
        return pulumi.get(self, "cen_id")

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

    @property
    @pulumi.getter(name="cenOwnerId")
    def cen_owner_id(self) -> Optional[pulumi.Input[int]]:
        """
        The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        """
        return pulumi.get(self, "cen_owner_id")

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

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

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


class GrantRuleToCen(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cen_id: Optional[pulumi.Input[str]] = None,
                 cen_owner_id: Optional[pulumi.Input[int]] = None,
                 instance_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Provides a Express Connect Grant Rule To Cen resource.

        For information about Express Connect Grant Rule To Cen and how to use it, see [What is Grant Rule To Cen](https://www.alibabacloud.com/help/en/virtual-private-cloud/latest/grantinstancetocen).

        > **NOTE:** Available in v1.196.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default_account = alicloud.get_account()
        default_physical_connections = alicloud.expressconnect.get_physical_connections()
        default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name="tf-example")
        default_virtual_border_router = alicloud.expressconnect.VirtualBorderRouter("defaultVirtualBorderRouter",
            local_gateway_ip="10.0.0.1",
            peer_gateway_ip="10.0.0.2",
            peering_subnet_mask="255.255.255.252",
            physical_connection_id=default_physical_connections.connections[0].id,
            vlan_id=1,
            min_rx_interval=1000,
            min_tx_interval=1000,
            detect_multiplier=10)
        default_grant_rule_to_cen = alicloud.expressconnect.GrantRuleToCen("defaultGrantRuleToCen",
            cen_id=default_instance.id,
            cen_owner_id=default_account.id,
            instance_id=default_virtual_border_router.id)
        ```

        ## Import

        Express Connect Grant Rule To Cen can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:expressconnect/grantRuleToCen:GrantRuleToCen example <cen_id>:<cen_owner_id>:<instance_id>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] cen_id: The ID of the CEN instance to which you want to grant permissions.
        :param pulumi.Input[int] cen_owner_id: The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        :param pulumi.Input[str] instance_id: The ID of the VBR.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GrantRuleToCenArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Provides a Express Connect Grant Rule To Cen resource.

        For information about Express Connect Grant Rule To Cen and how to use it, see [What is Grant Rule To Cen](https://www.alibabacloud.com/help/en/virtual-private-cloud/latest/grantinstancetocen).

        > **NOTE:** Available in v1.196.0+.

        ## Example Usage

        Basic Usage

        ```python
        import pulumi
        import pulumi_alicloud as alicloud

        default_account = alicloud.get_account()
        default_physical_connections = alicloud.expressconnect.get_physical_connections()
        default_instance = alicloud.cen.Instance("defaultInstance", cen_instance_name="tf-example")
        default_virtual_border_router = alicloud.expressconnect.VirtualBorderRouter("defaultVirtualBorderRouter",
            local_gateway_ip="10.0.0.1",
            peer_gateway_ip="10.0.0.2",
            peering_subnet_mask="255.255.255.252",
            physical_connection_id=default_physical_connections.connections[0].id,
            vlan_id=1,
            min_rx_interval=1000,
            min_tx_interval=1000,
            detect_multiplier=10)
        default_grant_rule_to_cen = alicloud.expressconnect.GrantRuleToCen("defaultGrantRuleToCen",
            cen_id=default_instance.id,
            cen_owner_id=default_account.id,
            instance_id=default_virtual_border_router.id)
        ```

        ## Import

        Express Connect Grant Rule To Cen can be imported using the id, e.g.

        ```sh
         $ pulumi import alicloud:expressconnect/grantRuleToCen:GrantRuleToCen example <cen_id>:<cen_owner_id>:<instance_id>
        ```

        :param str resource_name: The name of the resource.
        :param GrantRuleToCenArgs 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(GrantRuleToCenArgs, 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,
                 cen_id: Optional[pulumi.Input[str]] = None,
                 cen_owner_id: Optional[pulumi.Input[int]] = None,
                 instance_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__ = GrantRuleToCenArgs.__new__(GrantRuleToCenArgs)

            if cen_id is None and not opts.urn:
                raise TypeError("Missing required property 'cen_id'")
            __props__.__dict__["cen_id"] = cen_id
            if cen_owner_id is None and not opts.urn:
                raise TypeError("Missing required property 'cen_owner_id'")
            __props__.__dict__["cen_owner_id"] = cen_owner_id
            if instance_id is None and not opts.urn:
                raise TypeError("Missing required property 'instance_id'")
            __props__.__dict__["instance_id"] = instance_id
        super(GrantRuleToCen, __self__).__init__(
            'alicloud:expressconnect/grantRuleToCen:GrantRuleToCen',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            cen_id: Optional[pulumi.Input[str]] = None,
            cen_owner_id: Optional[pulumi.Input[int]] = None,
            instance_id: Optional[pulumi.Input[str]] = None) -> 'GrantRuleToCen':
        """
        Get an existing GrantRuleToCen 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] cen_id: The ID of the CEN instance to which you want to grant permissions.
        :param pulumi.Input[int] cen_owner_id: The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        :param pulumi.Input[str] instance_id: The ID of the VBR.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GrantRuleToCenState.__new__(_GrantRuleToCenState)

        __props__.__dict__["cen_id"] = cen_id
        __props__.__dict__["cen_owner_id"] = cen_owner_id
        __props__.__dict__["instance_id"] = instance_id
        return GrantRuleToCen(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="cenId")
    def cen_id(self) -> pulumi.Output[str]:
        """
        The ID of the CEN instance to which you want to grant permissions.
        """
        return pulumi.get(self, "cen_id")

    @property
    @pulumi.getter(name="cenOwnerId")
    def cen_owner_id(self) -> pulumi.Output[int]:
        """
        The user ID (UID) of the Alibaba Cloud account to which the CEN instance belongs.
        """
        return pulumi.get(self, "cen_owner_id")

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

