# 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 MemberV1(pulumi.CustomResource):
    """
    Manages a V1 load balancer member resource within OpenStack.
    """
    def __init__(__self__, __name__, __opts__=None, address=None, admin_state_up=None, pool_id=None, port=None, region=None, tenant_id=None, weight=None):
        """Create a MemberV1 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 not address:
            raise TypeError('Missing required property address')
        elif not isinstance(address, basestring):
            raise TypeError('Expected property address to be a basestring')
        __self__.address = address
        """
        The IP address of the member. Changing this creates a
        new member.
        """
        __props__['address'] = address

        if admin_state_up and not isinstance(admin_state_up, bool):
            raise TypeError('Expected property admin_state_up to be a bool')
        __self__.admin_state_up = admin_state_up
        """
        The administrative state of the member.
        Acceptable values are 'true' and 'false'. Changing this value updates the
        state of the existing member.
        """
        __props__['adminStateUp'] = admin_state_up

        if not pool_id:
            raise TypeError('Missing required property pool_id')
        elif not isinstance(pool_id, basestring):
            raise TypeError('Expected property pool_id to be a basestring')
        __self__.pool_id = pool_id
        """
        The ID of the LB pool. Changing this creates a new
        member.
        """
        __props__['poolId'] = pool_id

        if not port:
            raise TypeError('Missing required property port')
        elif not isinstance(port, int):
            raise TypeError('Expected property port to be a int')
        __self__.port = port
        """
        An integer representing the port on which the member is
        hosted. Changing this creates a new member.
        """
        __props__['port'] = port

        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 an LB member. If omitted, the
        `region` argument of the provider is used. Changing this creates a new
        LB member.
        """
        __props__['region'] = region

        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 owner of the member. Required if admin wants to
        create a member for another tenant. Changing this creates a new member.
        """
        __props__['tenantId'] = tenant_id

        if weight and not isinstance(weight, int):
            raise TypeError('Expected property weight to be a int')
        __self__.weight = weight
        """
        The load balancing weight of the member. This is currently unable
        to be set through Terraform.
        """
        __props__['weight'] = weight

        super(MemberV1, __self__).__init__(
            'openstack:loadbalancer/memberV1:MemberV1',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'address' in outs:
            self.address = outs['address']
        if 'adminStateUp' in outs:
            self.admin_state_up = outs['adminStateUp']
        if 'poolId' in outs:
            self.pool_id = outs['poolId']
        if 'port' in outs:
            self.port = outs['port']
        if 'region' in outs:
            self.region = outs['region']
        if 'tenantId' in outs:
            self.tenant_id = outs['tenantId']
        if 'weight' in outs:
            self.weight = outs['weight']
