# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** 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__ = [
    'CidrhostResult',
    'AwaitableCidrhostResult',
    'cidrhost',
    'cidrhost_output',
]

@pulumi.output_type
class CidrhostResult:
    def __init__(__self__, result=None):
        if result and not isinstance(result, str):
            raise TypeError("Expected argument 'result' to be a str")
        pulumi.set(__self__, "result", result)

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


class AwaitableCidrhostResult(CidrhostResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return CidrhostResult(
            result=self.result)


def cidrhost(host: Optional[int] = None,
             input: Optional[str] = None,
             opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableCidrhostResult:
    """
    Takes an IP address range in CIDR notation as input
    and creates an IP address with the given host number.
    If given host number is negative, the count starts from the end of the range.
    For example, cidrhost("10.0.0.0/8", 2) returns 10.0.0.2 and cidrhost("10.0.0.0/8", -2) returns 10.255.255.254.
    """
    __args__ = dict()
    __args__['host'] = host
    __args__['input'] = input
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('std:index:cidrhost', __args__, opts=opts, typ=CidrhostResult).value

    return AwaitableCidrhostResult(
        result=pulumi.get(__ret__, 'result'))


@_utilities.lift_output_func(cidrhost)
def cidrhost_output(host: Optional[pulumi.Input[int]] = None,
                    input: Optional[pulumi.Input[str]] = None,
                    opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[CidrhostResult]:
    """
    Takes an IP address range in CIDR notation as input
    and creates an IP address with the given host number.
    If given host number is negative, the count starts from the end of the range.
    For example, cidrhost("10.0.0.0/8", 2) returns 10.0.0.2 and cidrhost("10.0.0.0/8", -2) returns 10.255.255.254.
    """
    ...
