# 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 pulumi
import pulumi.runtime

class FloatingIp(pulumi.CustomResource):
    """
    Manages a V2 floating IP resource within OpenStack Neutron (networking)
    that can be used for load balancers.
    These are similar to Nova (compute) floating IP resources,
    but only compute floating IPs can be used with compute instances.
    """
    def __init__(__self__, __name__, __opts__=None, fixed_ip=None, pool=None, port_id=None, region=None, subnet_id=None, tenant_id=None, value_specs=None):
        """Create a FloatingIp resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if fixed_ip and not isinstance(fixed_ip, basestring):
            raise TypeError('Expected property fixed_ip to be a basestring')
        __self__.fixed_ip = fixed_ip
        """
        Fixed IP of the port to associate with this floating IP. Required if
        the port has multiple fixed IPs.
        """
        __props__['fixedIp'] = fixed_ip

        if not pool:
            raise TypeError('Missing required property pool')
        elif not isinstance(pool, basestring):
            raise TypeError('Expected property pool to be a basestring')
        __self__.pool = pool
        """
        The name of the pool from which to obtain the floating
        IP. Changing this creates a new floating IP.
        """
        __props__['pool'] = pool

        if port_id and not isinstance(port_id, basestring):
            raise TypeError('Expected property port_id to be a basestring')
        __self__.port_id = port_id
        """
        ID of an existing port with at least one IP address to
        associate with this floating IP.
        """
        __props__['portId'] = port_id

        if region and not isinstance(region, basestring):
            raise TypeError('Expected property region to be a basestring')
        __self__.region = region
        """
        The region in which to obtain the V2 Networking client.
        A Networking client is needed to create a floating IP that can be used with
        another networking resource, such as a load balancer. If omitted, the
        `region` argument of the provider is used. Changing this creates a new
        floating IP (which may or may not have a different address).
        """
        __props__['region'] = region

        if subnet_id and not isinstance(subnet_id, basestring):
            raise TypeError('Expected property subnet_id to be a basestring')
        __self__.subnet_id = subnet_id
        """
        The subnet ID of the floating IP pool. Specify this if
        the floating IP network has multiple subnets.
        """
        __props__['subnetId'] = subnet_id

        if tenant_id and not isinstance(tenant_id, basestring):
            raise TypeError('Expected property tenant_id to be a basestring')
        __self__.tenant_id = tenant_id
        """
        The target tenant ID in which to allocate the floating
        IP, if you specify this together with a port_id, make sure the target port
        belongs to the same tenant. Changing this creates a new floating IP (which
        may or may not have a different address)
        """
        __props__['tenantId'] = tenant_id

        if value_specs and not isinstance(value_specs, dict):
            raise TypeError('Expected property value_specs to be a dict')
        __self__.value_specs = value_specs
        """
        Map of additional options.
        """
        __props__['valueSpecs'] = value_specs

        __self__.address = pulumi.runtime.UNKNOWN
        """
        The actual floating IP address itself.
        """

        super(FloatingIp, __self__).__init__(
            'openstack:networking/floatingIp:FloatingIp',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'address' in outs:
            self.address = outs['address']
        if 'fixedIp' in outs:
            self.fixed_ip = outs['fixedIp']
        if 'pool' in outs:
            self.pool = outs['pool']
        if 'portId' in outs:
            self.port_id = outs['portId']
        if 'region' in outs:
            self.region = outs['region']
        if 'subnetId' in outs:
            self.subnet_id = outs['subnetId']
        if 'tenantId' in outs:
            self.tenant_id = outs['tenantId']
        if 'valueSpecs' in outs:
            self.value_specs = outs['valueSpecs']
