# 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 sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = [
    'GetVpcPublicGatewayDhcpReservationResult',
    'AwaitableGetVpcPublicGatewayDhcpReservationResult',
    'get_vpc_public_gateway_dhcp_reservation',
    'get_vpc_public_gateway_dhcp_reservation_output',
]

@pulumi.output_type
class GetVpcPublicGatewayDhcpReservationResult:
    """
    A collection of values returned by getVpcPublicGatewayDhcpReservation.
    """
    def __init__(__self__, created_at=None, gateway_network_id=None, hostname=None, id=None, ip_address=None, mac_address=None, reservation_id=None, type=None, updated_at=None, wait_for_dhcp=None, zone=None):
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if gateway_network_id and not isinstance(gateway_network_id, str):
            raise TypeError("Expected argument 'gateway_network_id' to be a str")
        pulumi.set(__self__, "gateway_network_id", gateway_network_id)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ip_address and not isinstance(ip_address, str):
            raise TypeError("Expected argument 'ip_address' to be a str")
        pulumi.set(__self__, "ip_address", ip_address)
        if mac_address and not isinstance(mac_address, str):
            raise TypeError("Expected argument 'mac_address' to be a str")
        pulumi.set(__self__, "mac_address", mac_address)
        if reservation_id and not isinstance(reservation_id, str):
            raise TypeError("Expected argument 'reservation_id' to be a str")
        pulumi.set(__self__, "reservation_id", reservation_id)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if updated_at and not isinstance(updated_at, str):
            raise TypeError("Expected argument 'updated_at' to be a str")
        pulumi.set(__self__, "updated_at", updated_at)
        if wait_for_dhcp and not isinstance(wait_for_dhcp, bool):
            raise TypeError("Expected argument 'wait_for_dhcp' to be a bool")
        pulumi.set(__self__, "wait_for_dhcp", wait_for_dhcp)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="gatewayNetworkId")
    def gateway_network_id(self) -> Optional[str]:
        return pulumi.get(self, "gateway_network_id")

    @property
    @pulumi.getter
    def hostname(self) -> str:
        return pulumi.get(self, "hostname")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="ipAddress")
    def ip_address(self) -> str:
        return pulumi.get(self, "ip_address")

    @property
    @pulumi.getter(name="macAddress")
    def mac_address(self) -> Optional[str]:
        return pulumi.get(self, "mac_address")

    @property
    @pulumi.getter(name="reservationId")
    def reservation_id(self) -> Optional[str]:
        return pulumi.get(self, "reservation_id")

    @property
    @pulumi.getter
    def type(self) -> str:
        return pulumi.get(self, "type")

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> str:
        return pulumi.get(self, "updated_at")

    @property
    @pulumi.getter(name="waitForDhcp")
    def wait_for_dhcp(self) -> Optional[bool]:
        return pulumi.get(self, "wait_for_dhcp")

    @property
    @pulumi.getter
    def zone(self) -> Optional[str]:
        return pulumi.get(self, "zone")


class AwaitableGetVpcPublicGatewayDhcpReservationResult(GetVpcPublicGatewayDhcpReservationResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetVpcPublicGatewayDhcpReservationResult(
            created_at=self.created_at,
            gateway_network_id=self.gateway_network_id,
            hostname=self.hostname,
            id=self.id,
            ip_address=self.ip_address,
            mac_address=self.mac_address,
            reservation_id=self.reservation_id,
            type=self.type,
            updated_at=self.updated_at,
            wait_for_dhcp=self.wait_for_dhcp,
            zone=self.zone)


def get_vpc_public_gateway_dhcp_reservation(gateway_network_id: Optional[str] = None,
                                            mac_address: Optional[str] = None,
                                            reservation_id: Optional[str] = None,
                                            wait_for_dhcp: Optional[bool] = None,
                                            zone: Optional[str] = None,
                                            opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVpcPublicGatewayDhcpReservationResult:
    """
    Gets information about a DHCP entry. For further information, please see the
    API [documentation](https://www.scaleway.com/en/developers/api/public-gateway/#path-dhcp-entries-list-dhcp-entries)/

    ## Example Dynamic

    ```python
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway

    main = scaleway.VpcPrivateNetwork("main")
    main_instance_server = scaleway.InstanceServer("main",
        image="ubuntu_jammy",
        type="DEV1-S",
        zone="fr-par-1")
    main_instance_private_nic = scaleway.InstancePrivateNic("main",
        server_id=main_instance_server.id,
        private_network_id=main.id)
    main_vpc_public_gateway_ip = scaleway.VpcPublicGatewayIp("main")
    main_vpc_public_gateway_dhcp = scaleway.VpcPublicGatewayDhcp("main", subnet="192.168.1.0/24")
    main_vpc_public_gateway = scaleway.VpcPublicGateway("main",
        name="foobar",
        type="VPC-GW-S",
        ip_id=main_vpc_public_gateway_ip.id)
    main_vpc_gateway_network = scaleway.VpcGatewayNetwork("main",
        gateway_id=main_vpc_public_gateway.id,
        private_network_id=main.id,
        dhcp_id=main_vpc_public_gateway_dhcp.id,
        cleanup_dhcp=True,
        enable_masquerade=True)
    ## Retrieve the dynamic entries generated by mac address & gateway network
    by_mac_address_and_gw_network = scaleway.get_vpc_public_gateway_dhcp_reservation_output(mac_address=main_instance_private_nic.mac_address,
        gateway_network_id=main_vpc_gateway_network.id)
    ```

    ## Example Static and PAT Rule

    ```python
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway

    main = scaleway.VpcPrivateNetwork("main")
    main_instance_security_group = scaleway.InstanceSecurityGroup("main",
        inbound_default_policy="drop",
        outbound_default_policy="accept",
        inbound_rules=[{
            "action": "accept",
            "port": 22,
        }])
    main_instance_server = scaleway.InstanceServer("main",
        image="ubuntu_jammy",
        type="DEV1-S",
        zone="fr-par-1",
        security_group_id=main_instance_security_group.id)
    main_instance_private_nic = scaleway.InstancePrivateNic("main",
        server_id=main_instance_server.id,
        private_network_id=main.id)
    main_vpc_public_gateway_ip = scaleway.VpcPublicGatewayIp("main")
    main_vpc_public_gateway_dhcp = scaleway.VpcPublicGatewayDhcp("main", subnet="192.168.1.0/24")
    main_vpc_public_gateway = scaleway.VpcPublicGateway("main",
        name="foobar",
        type="VPC-GW-S",
        ip_id=main_vpc_public_gateway_ip.id)
    main_vpc_gateway_network = scaleway.VpcGatewayNetwork("main",
        gateway_id=main_vpc_public_gateway.id,
        private_network_id=main.id,
        dhcp_id=main_vpc_public_gateway_dhcp.id,
        cleanup_dhcp=True,
        enable_masquerade=True)
    main_vpc_public_gateway_dhcp_reservation = scaleway.VpcPublicGatewayDhcpReservation("main",
        gateway_network_id=main_vpc_gateway_network.id,
        mac_address=main_instance_private_nic.mac_address,
        ip_address="192.168.1.4")
    ### VPC PAT RULE
    main_vpc_public_gateway_pat_rule = scaleway.VpcPublicGatewayPatRule("main",
        gateway_id=main_vpc_public_gateway.id,
        private_ip=main_vpc_public_gateway_dhcp_reservation.ip_address,
        private_port=22,
        public_port=2222,
        protocol="tcp")
    by_id = scaleway.get_vpc_public_gateway_dhcp_reservation_output(reservation_id=main_vpc_public_gateway_dhcp_reservation.id)
    ```


    :param str gateway_network_id: The ID of the owning GatewayNetwork.
           
           > Only one of `reservation_id` or `mac_address` with `gateway_network_id` should be specified.
    :param str mac_address: The MAC address of the reservation to retrieve.
    :param str reservation_id: The ID of the reservation (DHCP entry) to retrieve.
    :param bool wait_for_dhcp: Whether to wait for `mac_address` to exist in DHCP.
    :param str zone: `zone`). The zone in which the reservation exists.
    """
    __args__ = dict()
    __args__['gatewayNetworkId'] = gateway_network_id
    __args__['macAddress'] = mac_address
    __args__['reservationId'] = reservation_id
    __args__['waitForDhcp'] = wait_for_dhcp
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('scaleway:index/getVpcPublicGatewayDhcpReservation:getVpcPublicGatewayDhcpReservation', __args__, opts=opts, typ=GetVpcPublicGatewayDhcpReservationResult).value

    return AwaitableGetVpcPublicGatewayDhcpReservationResult(
        created_at=pulumi.get(__ret__, 'created_at'),
        gateway_network_id=pulumi.get(__ret__, 'gateway_network_id'),
        hostname=pulumi.get(__ret__, 'hostname'),
        id=pulumi.get(__ret__, 'id'),
        ip_address=pulumi.get(__ret__, 'ip_address'),
        mac_address=pulumi.get(__ret__, 'mac_address'),
        reservation_id=pulumi.get(__ret__, 'reservation_id'),
        type=pulumi.get(__ret__, 'type'),
        updated_at=pulumi.get(__ret__, 'updated_at'),
        wait_for_dhcp=pulumi.get(__ret__, 'wait_for_dhcp'),
        zone=pulumi.get(__ret__, 'zone'))
def get_vpc_public_gateway_dhcp_reservation_output(gateway_network_id: Optional[pulumi.Input[Optional[str]]] = None,
                                                   mac_address: Optional[pulumi.Input[Optional[str]]] = None,
                                                   reservation_id: Optional[pulumi.Input[Optional[str]]] = None,
                                                   wait_for_dhcp: Optional[pulumi.Input[Optional[bool]]] = None,
                                                   zone: Optional[pulumi.Input[Optional[str]]] = None,
                                                   opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetVpcPublicGatewayDhcpReservationResult]:
    """
    Gets information about a DHCP entry. For further information, please see the
    API [documentation](https://www.scaleway.com/en/developers/api/public-gateway/#path-dhcp-entries-list-dhcp-entries)/

    ## Example Dynamic

    ```python
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway

    main = scaleway.VpcPrivateNetwork("main")
    main_instance_server = scaleway.InstanceServer("main",
        image="ubuntu_jammy",
        type="DEV1-S",
        zone="fr-par-1")
    main_instance_private_nic = scaleway.InstancePrivateNic("main",
        server_id=main_instance_server.id,
        private_network_id=main.id)
    main_vpc_public_gateway_ip = scaleway.VpcPublicGatewayIp("main")
    main_vpc_public_gateway_dhcp = scaleway.VpcPublicGatewayDhcp("main", subnet="192.168.1.0/24")
    main_vpc_public_gateway = scaleway.VpcPublicGateway("main",
        name="foobar",
        type="VPC-GW-S",
        ip_id=main_vpc_public_gateway_ip.id)
    main_vpc_gateway_network = scaleway.VpcGatewayNetwork("main",
        gateway_id=main_vpc_public_gateway.id,
        private_network_id=main.id,
        dhcp_id=main_vpc_public_gateway_dhcp.id,
        cleanup_dhcp=True,
        enable_masquerade=True)
    ## Retrieve the dynamic entries generated by mac address & gateway network
    by_mac_address_and_gw_network = scaleway.get_vpc_public_gateway_dhcp_reservation_output(mac_address=main_instance_private_nic.mac_address,
        gateway_network_id=main_vpc_gateway_network.id)
    ```

    ## Example Static and PAT Rule

    ```python
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway

    main = scaleway.VpcPrivateNetwork("main")
    main_instance_security_group = scaleway.InstanceSecurityGroup("main",
        inbound_default_policy="drop",
        outbound_default_policy="accept",
        inbound_rules=[{
            "action": "accept",
            "port": 22,
        }])
    main_instance_server = scaleway.InstanceServer("main",
        image="ubuntu_jammy",
        type="DEV1-S",
        zone="fr-par-1",
        security_group_id=main_instance_security_group.id)
    main_instance_private_nic = scaleway.InstancePrivateNic("main",
        server_id=main_instance_server.id,
        private_network_id=main.id)
    main_vpc_public_gateway_ip = scaleway.VpcPublicGatewayIp("main")
    main_vpc_public_gateway_dhcp = scaleway.VpcPublicGatewayDhcp("main", subnet="192.168.1.0/24")
    main_vpc_public_gateway = scaleway.VpcPublicGateway("main",
        name="foobar",
        type="VPC-GW-S",
        ip_id=main_vpc_public_gateway_ip.id)
    main_vpc_gateway_network = scaleway.VpcGatewayNetwork("main",
        gateway_id=main_vpc_public_gateway.id,
        private_network_id=main.id,
        dhcp_id=main_vpc_public_gateway_dhcp.id,
        cleanup_dhcp=True,
        enable_masquerade=True)
    main_vpc_public_gateway_dhcp_reservation = scaleway.VpcPublicGatewayDhcpReservation("main",
        gateway_network_id=main_vpc_gateway_network.id,
        mac_address=main_instance_private_nic.mac_address,
        ip_address="192.168.1.4")
    ### VPC PAT RULE
    main_vpc_public_gateway_pat_rule = scaleway.VpcPublicGatewayPatRule("main",
        gateway_id=main_vpc_public_gateway.id,
        private_ip=main_vpc_public_gateway_dhcp_reservation.ip_address,
        private_port=22,
        public_port=2222,
        protocol="tcp")
    by_id = scaleway.get_vpc_public_gateway_dhcp_reservation_output(reservation_id=main_vpc_public_gateway_dhcp_reservation.id)
    ```


    :param str gateway_network_id: The ID of the owning GatewayNetwork.
           
           > Only one of `reservation_id` or `mac_address` with `gateway_network_id` should be specified.
    :param str mac_address: The MAC address of the reservation to retrieve.
    :param str reservation_id: The ID of the reservation (DHCP entry) to retrieve.
    :param bool wait_for_dhcp: Whether to wait for `mac_address` to exist in DHCP.
    :param str zone: `zone`). The zone in which the reservation exists.
    """
    __args__ = dict()
    __args__['gatewayNetworkId'] = gateway_network_id
    __args__['macAddress'] = mac_address
    __args__['reservationId'] = reservation_id
    __args__['waitForDhcp'] = wait_for_dhcp
    __args__['zone'] = zone
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('scaleway:index/getVpcPublicGatewayDhcpReservation:getVpcPublicGatewayDhcpReservation', __args__, opts=opts, typ=GetVpcPublicGatewayDhcpReservationResult)
    return __ret__.apply(lambda __response__: GetVpcPublicGatewayDhcpReservationResult(
        created_at=pulumi.get(__response__, 'created_at'),
        gateway_network_id=pulumi.get(__response__, 'gateway_network_id'),
        hostname=pulumi.get(__response__, 'hostname'),
        id=pulumi.get(__response__, 'id'),
        ip_address=pulumi.get(__response__, 'ip_address'),
        mac_address=pulumi.get(__response__, 'mac_address'),
        reservation_id=pulumi.get(__response__, 'reservation_id'),
        type=pulumi.get(__response__, 'type'),
        updated_at=pulumi.get(__response__, 'updated_at'),
        wait_for_dhcp=pulumi.get(__response__, 'wait_for_dhcp'),
        zone=pulumi.get(__response__, 'zone')))
