// *** 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 * as pulumi from "@pulumi/pulumi";
import { input as inputs, output as outputs } from "../types";
import * as utilities from "../utilities";

/**
 * > **NOTE:** From the version 1.132.0, the data source has been renamed to `alicloud.bastionhost.getInstances`.
 *
 * This data source provides a list of cloud Bastionhost instances in an Alibaba Cloud account according to the specified filters.
 *
 * > **NOTE:** Available in 1.63.0+ .
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 *
 * const instanceInstances = pulumi.output(alicloud.bastionhost.getInstances({
 *     descriptionRegex: "^bastionhost",
 * }, { async: true }));
 *
 * export const instance = alicloud_bastionhost_instances_instance.map(v => v.id);
 * ```
 */
export function getInstances(args?: GetInstancesArgs, opts?: pulumi.InvokeOptions): Promise<GetInstancesResult> {
    args = args || {};
    if (!opts) {
        opts = {}
    }

    if (!opts.version) {
        opts.version = utilities.getVersion();
    }
    return pulumi.runtime.invoke("alicloud:bastionhost/getInstances:getInstances", {
        "descriptionRegex": args.descriptionRegex,
        "ids": args.ids,
        "outputFile": args.outputFile,
        "tags": args.tags,
    }, opts);
}

/**
 * A collection of arguments for invoking getInstances.
 */
export interface GetInstancesArgs {
    /**
     * A regex string to filter results by the instance description.
     */
    readonly descriptionRegex?: string;
    /**
     * Matched instance IDs to filter data source result.
     */
    readonly ids?: string[];
    /**
     * File name to persist data source output.
     */
    readonly outputFile?: string;
    /**
     * A map of tags assigned to the bastionhost instance. It must be in the format:
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as alicloud from "@pulumi/alicloud";
     *
     * const instance = pulumi.output(alicloud.bastionhost.getInstances({
     *     tags: {
     *         tagKey1: "tagValue1",
     *     },
     * }, { async: true }));
     * ```
     */
    readonly tags?: {[key: string]: any};
}

/**
 * A collection of values returned by getInstances.
 */
export interface GetInstancesResult {
    readonly descriptionRegex?: string;
    readonly descriptions: string[];
    /**
     * The provider-assigned unique ID for this managed resource.
     */
    readonly id: string;
    readonly ids: string[];
    /**
     * A list of apis. Each element contains the following attributes:
     */
    readonly instances: outputs.bastionhost.GetInstancesInstance[];
    readonly outputFile?: string;
    /**
     * A map of tags assigned to the bastionhost instance.
     */
    readonly tags?: {[key: string]: any};
}
