# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class GetAttachmentsResult:
    """
    A collection of values returned by getAttachments.
    """
    def __init__(__self__, id=None, instance_ids=None, load_balancer_id=None, output_file=None, slb_attachments=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
        if instance_ids and not isinstance(instance_ids, list):
            raise TypeError("Expected argument 'instance_ids' to be a list")
        __self__.instance_ids = instance_ids
        if load_balancer_id and not isinstance(load_balancer_id, str):
            raise TypeError("Expected argument 'load_balancer_id' to be a str")
        __self__.load_balancer_id = load_balancer_id
        if output_file and not isinstance(output_file, str):
            raise TypeError("Expected argument 'output_file' to be a str")
        __self__.output_file = output_file
        if slb_attachments and not isinstance(slb_attachments, list):
            raise TypeError("Expected argument 'slb_attachments' to be a list")
        __self__.slb_attachments = slb_attachments
        """
        A list of SLB attachments. Each element contains the following attributes:
        """
class AwaitableGetAttachmentsResult(GetAttachmentsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAttachmentsResult(
            id=self.id,
            instance_ids=self.instance_ids,
            load_balancer_id=self.load_balancer_id,
            output_file=self.output_file,
            slb_attachments=self.slb_attachments)

def get_attachments(instance_ids=None,load_balancer_id=None,output_file=None,opts=None):
    """
    This data source provides the server load balancer attachments of the current Alibaba Cloud user.

    > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/d/slb_attachments.html.markdown.


    :param list instance_ids: List of attached ECS instance IDs.
    :param str load_balancer_id: ID of the SLB with attachments.
    """
    __args__ = dict()


    __args__['instanceIds'] = instance_ids
    __args__['loadBalancerId'] = load_balancer_id
    __args__['outputFile'] = output_file
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('alicloud:slb/getAttachments:getAttachments', __args__, opts=opts).value

    return AwaitableGetAttachmentsResult(
        id=__ret__.get('id'),
        instance_ids=__ret__.get('instanceIds'),
        load_balancer_id=__ret__.get('loadBalancerId'),
        output_file=__ret__.get('outputFile'),
        slb_attachments=__ret__.get('slbAttachments'))
