1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. bastionhost
  5. getInstances
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.bastionhost.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

    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 since v1.63.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    export = async () => {
        const instance = await alicloud.bastionhost.getInstances({
            descriptionRegex: "^bastionhost",
        });
        return {
            instance: [instance].map(__item => __item.id),
        };
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    instance = alicloud.bastionhost.get_instances(description_regex="^bastionhost")
    pulumi.export("instance", [__item.id for __item in [instance]])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/bastionhost"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    instance, err := bastionhost.GetInstances(ctx, &bastionhost.GetInstancesArgs{
    DescriptionRegex: pulumi.StringRef("^bastionhost"),
    }, nil);
    if err != nil {
    return err
    }
    ctx.Export("instance", pulumi.StringArray(%!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ example.pp:5,11-25)))
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instance = AliCloud.BastionHost.GetInstances.Invoke(new()
        {
            DescriptionRegex = "^bastionhost",
        });
    
        return new Dictionary<string, object?>
        {
            ["instance"] = new[]
            {
                instance,
            }.Select(__item => __item.Id).ToList(),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.bastionhost.BastionhostFunctions;
    import com.pulumi.alicloud.bastionhost.inputs.GetInstancesArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var instance = BastionhostFunctions.getInstances(GetInstancesArgs.builder()
                .descriptionRegex("^bastionhost")
                .build());
    
            ctx.export("instance", instance.applyValue(getInstancesResult -> getInstancesResult).stream().map(element -> element.id()).collect(toList()));
        }
    }
    
    Coming soon!
    

    Using getInstances

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
    function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
    def get_instances(description_regex: Optional[str] = None,
                      ids: Optional[Sequence[str]] = None,
                      output_file: Optional[str] = None,
                      tags: Optional[Mapping[str, str]] = None,
                      opts: Optional[InvokeOptions] = None) -> GetInstancesResult
    def get_instances_output(description_regex: Optional[pulumi.Input[str]] = None,
                      ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
    func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
    func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

    > Note: This function is named GetInstances in the Go SDK.

    public static class GetInstances 
    {
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:bastionhost/getInstances:getInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DescriptionRegex string
    A regex string to filter results by the instance description.
    Ids List<string>
    Matched instance IDs to filter data source result.
    OutputFile string
    File name to persist data source output.
    Tags Dictionary<string, string>
    A map of tags assigned to the bastionhost instance.
    DescriptionRegex string
    A regex string to filter results by the instance description.
    Ids []string
    Matched instance IDs to filter data source result.
    OutputFile string
    File name to persist data source output.
    Tags map[string]string
    A map of tags assigned to the bastionhost instance.
    descriptionRegex String
    A regex string to filter results by the instance description.
    ids List<String>
    Matched instance IDs to filter data source result.
    outputFile String
    File name to persist data source output.
    tags Map<String,String>
    A map of tags assigned to the bastionhost instance.
    descriptionRegex string
    A regex string to filter results by the instance description.
    ids string[]
    Matched instance IDs to filter data source result.
    outputFile string
    File name to persist data source output.
    tags {[key: string]: string}
    A map of tags assigned to the bastionhost instance.
    description_regex str
    A regex string to filter results by the instance description.
    ids Sequence[str]
    Matched instance IDs to filter data source result.
    output_file str
    File name to persist data source output.
    tags Mapping[str, str]
    A map of tags assigned to the bastionhost instance.
    descriptionRegex String
    A regex string to filter results by the instance description.
    ids List<String>
    Matched instance IDs to filter data source result.
    outputFile String
    File name to persist data source output.
    tags Map<String>
    A map of tags assigned to the bastionhost instance.

    getInstances Result

    The following output properties are available:

    Descriptions List<string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Instances List<Pulumi.AliCloud.BastionHost.Outputs.GetInstancesInstance>
    A list of apis. Each element contains the following attributes:
    DescriptionRegex string
    OutputFile string
    Tags Dictionary<string, string>
    A map of tags assigned to the bastionhost instance.
    Descriptions []string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Instances []GetInstancesInstance
    A list of apis. Each element contains the following attributes:
    DescriptionRegex string
    OutputFile string
    Tags map[string]string
    A map of tags assigned to the bastionhost instance.
    descriptions List<String>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<GetInstancesInstance>
    A list of apis. Each element contains the following attributes:
    descriptionRegex String
    outputFile String
    tags Map<String,String>
    A map of tags assigned to the bastionhost instance.
    descriptions string[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    instances GetInstancesInstance[]
    A list of apis. Each element contains the following attributes:
    descriptionRegex string
    outputFile string
    tags {[key: string]: string}
    A map of tags assigned to the bastionhost instance.
    descriptions Sequence[str]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    instances Sequence[GetInstancesInstance]
    A list of apis. Each element contains the following attributes:
    description_regex str
    output_file str
    tags Mapping[str, str]
    A map of tags assigned to the bastionhost instance.
    descriptions List<String>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    instances List<Property Map>
    A list of apis. Each element contains the following attributes:
    descriptionRegex String
    outputFile String
    tags Map<String>
    A map of tags assigned to the bastionhost instance.

    Supporting Types

    GetInstancesInstance

    Bandwidth string
    The bandwidth of Cloud Bastionhost instance.
    Description string
    The instance's remark.
    Id string
    The instance's id.
    InstanceStatus string
    The instance's status.
    LicenseCode string
    The instance's license code.
    PrivateDomain string
    The instance's private domain name.
    PublicDomain string
    The instance's public domain name.
    PublicNetworkAccess bool
    The instance's public network access configuration.
    SecurityGroupIds List<string>
    The instance's security group configuration.
    Storage string
    The storage of Cloud Bastionhost instance in TB.
    Tags Dictionary<string, string>
    A map of tags assigned to the bastionhost instance.
    UserVswitchId string
    The instance's vSwitch ID.
    Bandwidth string
    The bandwidth of Cloud Bastionhost instance.
    Description string
    The instance's remark.
    Id string
    The instance's id.
    InstanceStatus string
    The instance's status.
    LicenseCode string
    The instance's license code.
    PrivateDomain string
    The instance's private domain name.
    PublicDomain string
    The instance's public domain name.
    PublicNetworkAccess bool
    The instance's public network access configuration.
    SecurityGroupIds []string
    The instance's security group configuration.
    Storage string
    The storage of Cloud Bastionhost instance in TB.
    Tags map[string]string
    A map of tags assigned to the bastionhost instance.
    UserVswitchId string
    The instance's vSwitch ID.
    bandwidth String
    The bandwidth of Cloud Bastionhost instance.
    description String
    The instance's remark.
    id String
    The instance's id.
    instanceStatus String
    The instance's status.
    licenseCode String
    The instance's license code.
    privateDomain String
    The instance's private domain name.
    publicDomain String
    The instance's public domain name.
    publicNetworkAccess Boolean
    The instance's public network access configuration.
    securityGroupIds List<String>
    The instance's security group configuration.
    storage String
    The storage of Cloud Bastionhost instance in TB.
    tags Map<String,String>
    A map of tags assigned to the bastionhost instance.
    userVswitchId String
    The instance's vSwitch ID.
    bandwidth string
    The bandwidth of Cloud Bastionhost instance.
    description string
    The instance's remark.
    id string
    The instance's id.
    instanceStatus string
    The instance's status.
    licenseCode string
    The instance's license code.
    privateDomain string
    The instance's private domain name.
    publicDomain string
    The instance's public domain name.
    publicNetworkAccess boolean
    The instance's public network access configuration.
    securityGroupIds string[]
    The instance's security group configuration.
    storage string
    The storage of Cloud Bastionhost instance in TB.
    tags {[key: string]: string}
    A map of tags assigned to the bastionhost instance.
    userVswitchId string
    The instance's vSwitch ID.
    bandwidth str
    The bandwidth of Cloud Bastionhost instance.
    description str
    The instance's remark.
    id str
    The instance's id.
    instance_status str
    The instance's status.
    license_code str
    The instance's license code.
    private_domain str
    The instance's private domain name.
    public_domain str
    The instance's public domain name.
    public_network_access bool
    The instance's public network access configuration.
    security_group_ids Sequence[str]
    The instance's security group configuration.
    storage str
    The storage of Cloud Bastionhost instance in TB.
    tags Mapping[str, str]
    A map of tags assigned to the bastionhost instance.
    user_vswitch_id str
    The instance's vSwitch ID.
    bandwidth String
    The bandwidth of Cloud Bastionhost instance.
    description String
    The instance's remark.
    id String
    The instance's id.
    instanceStatus String
    The instance's status.
    licenseCode String
    The instance's license code.
    privateDomain String
    The instance's private domain name.
    publicDomain String
    The instance's public domain name.
    publicNetworkAccess Boolean
    The instance's public network access configuration.
    securityGroupIds List<String>
    The instance's security group configuration.
    storage String
    The storage of Cloud Bastionhost instance in TB.
    tags Map<String>
    A map of tags assigned to the bastionhost instance.
    userVswitchId String
    The instance's vSwitch ID.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi