We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.compute.getBastionHost
Explore with Pulumi AI
Use this data source to access information about an existing Bastion Host.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.compute.getBastionHost({
    name: "existing-bastion",
    resourceGroupName: "existing-resources",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.compute.get_bastion_host(name="existing-bastion",
    resource_group_name="existing-resources")
pulumi.export("id", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := compute.LookupBastionHost(ctx, &compute.LookupBastionHostArgs{
			Name:              "existing-bastion",
			ResourceGroupName: "existing-resources",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.Compute.GetBastionHost.Invoke(new()
    {
        Name = "existing-bastion",
        ResourceGroupName = "existing-resources",
    });
    return new Dictionary<string, object?>
    {
        ["id"] = example.Apply(getBastionHostResult => getBastionHostResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetBastionHostArgs;
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 example = ComputeFunctions.getBastionHost(GetBastionHostArgs.builder()
            .name("existing-bastion")
            .resourceGroupName("existing-resources")
            .build());
        ctx.export("id", example.applyValue(getBastionHostResult -> getBastionHostResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:compute:getBastionHost
      arguments:
        name: existing-bastion
        resourceGroupName: existing-resources
outputs:
  id: ${example.id}
Using getBastionHost
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 getBastionHost(args: GetBastionHostArgs, opts?: InvokeOptions): Promise<GetBastionHostResult>
function getBastionHostOutput(args: GetBastionHostOutputArgs, opts?: InvokeOptions): Output<GetBastionHostResult>def get_bastion_host(name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetBastionHostResult
def get_bastion_host_output(name: Optional[pulumi.Input[str]] = None,
                     resource_group_name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetBastionHostResult]func LookupBastionHost(ctx *Context, args *LookupBastionHostArgs, opts ...InvokeOption) (*LookupBastionHostResult, error)
func LookupBastionHostOutput(ctx *Context, args *LookupBastionHostOutputArgs, opts ...InvokeOption) LookupBastionHostResultOutput> Note: This function is named LookupBastionHost in the Go SDK.
public static class GetBastionHost 
{
    public static Task<GetBastionHostResult> InvokeAsync(GetBastionHostArgs args, InvokeOptions? opts = null)
    public static Output<GetBastionHostResult> Invoke(GetBastionHostInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBastionHostResult> getBastionHost(GetBastionHostArgs args, InvokeOptions options)
public static Output<GetBastionHostResult> getBastionHost(GetBastionHostArgs args, InvokeOptions options)
fn::invoke:
  function: azure:compute/getBastionHost:getBastionHost
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Bastion Host.
- ResourceGroup stringName 
- The name of the Resource Group where the Bastion Host exists.
- Name string
- The name of the Bastion Host.
- ResourceGroup stringName 
- The name of the Resource Group where the Bastion Host exists.
- name String
- The name of the Bastion Host.
- resourceGroup StringName 
- The name of the Resource Group where the Bastion Host exists.
- name string
- The name of the Bastion Host.
- resourceGroup stringName 
- The name of the Resource Group where the Bastion Host exists.
- name str
- The name of the Bastion Host.
- resource_group_ strname 
- The name of the Resource Group where the Bastion Host exists.
- name String
- The name of the Bastion Host.
- resourceGroup StringName 
- The name of the Resource Group where the Bastion Host exists.
getBastionHost Result
The following output properties are available:
- CopyPaste boolEnabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- DnsName string
- The FQDN for the Bastion Host.
- FileCopy boolEnabled 
- Is File Copy feature enabled for the Bastion Host.
- Id string
- The provider-assigned unique ID for this managed resource.
- IpConfigurations List<GetBastion Host Ip Configuration> 
- A ip_configurationblock as defined below.
- IpConnect boolEnabled 
- Is IP Connect feature enabled for the Bastion Host.
- Location string
- The Azure Region where the Bastion Host exists.
- Name string
- The name of the IP configuration.
- ResourceGroup stringName 
- ScaleUnits int
- The number of scale units provisioned for the Bastion Host.
- SessionRecording boolEnabled 
- Is Session Recording feature enabled for the Bastion Host.
- bool
- Is Shareable Link feature enabled for the Bastion Host.
- Sku string
- The SKU of the Bastion Host.
- Dictionary<string, string>
- A mapping of tags assigned to the Bastion Host.
- TunnelingEnabled bool
- Is Tunneling feature enabled for the Bastion Host.
- Zones List<string>
- A list of Availability Zones in which this Bastion Host is located.
- CopyPaste boolEnabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- DnsName string
- The FQDN for the Bastion Host.
- FileCopy boolEnabled 
- Is File Copy feature enabled for the Bastion Host.
- Id string
- The provider-assigned unique ID for this managed resource.
- IpConfigurations []GetBastion Host Ip Configuration 
- A ip_configurationblock as defined below.
- IpConnect boolEnabled 
- Is IP Connect feature enabled for the Bastion Host.
- Location string
- The Azure Region where the Bastion Host exists.
- Name string
- The name of the IP configuration.
- ResourceGroup stringName 
- ScaleUnits int
- The number of scale units provisioned for the Bastion Host.
- SessionRecording boolEnabled 
- Is Session Recording feature enabled for the Bastion Host.
- bool
- Is Shareable Link feature enabled for the Bastion Host.
- Sku string
- The SKU of the Bastion Host.
- map[string]string
- A mapping of tags assigned to the Bastion Host.
- TunnelingEnabled bool
- Is Tunneling feature enabled for the Bastion Host.
- Zones []string
- A list of Availability Zones in which this Bastion Host is located.
- copyPaste BooleanEnabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- dnsName String
- The FQDN for the Bastion Host.
- fileCopy BooleanEnabled 
- Is File Copy feature enabled for the Bastion Host.
- id String
- The provider-assigned unique ID for this managed resource.
- ipConfigurations List<GetBastion Host Ip Configuration> 
- A ip_configurationblock as defined below.
- ipConnect BooleanEnabled 
- Is IP Connect feature enabled for the Bastion Host.
- location String
- The Azure Region where the Bastion Host exists.
- name String
- The name of the IP configuration.
- resourceGroup StringName 
- scaleUnits Integer
- The number of scale units provisioned for the Bastion Host.
- sessionRecording BooleanEnabled 
- Is Session Recording feature enabled for the Bastion Host.
- Boolean
- Is Shareable Link feature enabled for the Bastion Host.
- sku String
- The SKU of the Bastion Host.
- Map<String,String>
- A mapping of tags assigned to the Bastion Host.
- tunnelingEnabled Boolean
- Is Tunneling feature enabled for the Bastion Host.
- zones List<String>
- A list of Availability Zones in which this Bastion Host is located.
- copyPaste booleanEnabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- dnsName string
- The FQDN for the Bastion Host.
- fileCopy booleanEnabled 
- Is File Copy feature enabled for the Bastion Host.
- id string
- The provider-assigned unique ID for this managed resource.
- ipConfigurations GetBastion Host Ip Configuration[] 
- A ip_configurationblock as defined below.
- ipConnect booleanEnabled 
- Is IP Connect feature enabled for the Bastion Host.
- location string
- The Azure Region where the Bastion Host exists.
- name string
- The name of the IP configuration.
- resourceGroup stringName 
- scaleUnits number
- The number of scale units provisioned for the Bastion Host.
- sessionRecording booleanEnabled 
- Is Session Recording feature enabled for the Bastion Host.
- boolean
- Is Shareable Link feature enabled for the Bastion Host.
- sku string
- The SKU of the Bastion Host.
- {[key: string]: string}
- A mapping of tags assigned to the Bastion Host.
- tunnelingEnabled boolean
- Is Tunneling feature enabled for the Bastion Host.
- zones string[]
- A list of Availability Zones in which this Bastion Host is located.
- copy_paste_ boolenabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- dns_name str
- The FQDN for the Bastion Host.
- file_copy_ boolenabled 
- Is File Copy feature enabled for the Bastion Host.
- id str
- The provider-assigned unique ID for this managed resource.
- ip_configurations Sequence[GetBastion Host Ip Configuration] 
- A ip_configurationblock as defined below.
- ip_connect_ boolenabled 
- Is IP Connect feature enabled for the Bastion Host.
- location str
- The Azure Region where the Bastion Host exists.
- name str
- The name of the IP configuration.
- resource_group_ strname 
- scale_units int
- The number of scale units provisioned for the Bastion Host.
- session_recording_ boolenabled 
- Is Session Recording feature enabled for the Bastion Host.
- bool
- Is Shareable Link feature enabled for the Bastion Host.
- sku str
- The SKU of the Bastion Host.
- Mapping[str, str]
- A mapping of tags assigned to the Bastion Host.
- tunneling_enabled bool
- Is Tunneling feature enabled for the Bastion Host.
- zones Sequence[str]
- A list of Availability Zones in which this Bastion Host is located.
- copyPaste BooleanEnabled 
- Is Copy/Paste feature enabled for the Bastion Host.
- dnsName String
- The FQDN for the Bastion Host.
- fileCopy BooleanEnabled 
- Is File Copy feature enabled for the Bastion Host.
- id String
- The provider-assigned unique ID for this managed resource.
- ipConfigurations List<Property Map>
- A ip_configurationblock as defined below.
- ipConnect BooleanEnabled 
- Is IP Connect feature enabled for the Bastion Host.
- location String
- The Azure Region where the Bastion Host exists.
- name String
- The name of the IP configuration.
- resourceGroup StringName 
- scaleUnits Number
- The number of scale units provisioned for the Bastion Host.
- sessionRecording BooleanEnabled 
- Is Session Recording feature enabled for the Bastion Host.
- Boolean
- Is Shareable Link feature enabled for the Bastion Host.
- sku String
- The SKU of the Bastion Host.
- Map<String>
- A mapping of tags assigned to the Bastion Host.
- tunnelingEnabled Boolean
- Is Tunneling feature enabled for the Bastion Host.
- zones List<String>
- A list of Availability Zones in which this Bastion Host is located.
Supporting Types
GetBastionHostIpConfiguration    
- Name string
- The name of the Bastion Host.
- PublicIp stringAddress Id 
- Reference to a Public IP Address associated to this Bastion Host.
- SubnetId string
- Reference to the subnet in which this Bastion Host has been created.
- Name string
- The name of the Bastion Host.
- PublicIp stringAddress Id 
- Reference to a Public IP Address associated to this Bastion Host.
- SubnetId string
- Reference to the subnet in which this Bastion Host has been created.
- name String
- The name of the Bastion Host.
- publicIp StringAddress Id 
- Reference to a Public IP Address associated to this Bastion Host.
- subnetId String
- Reference to the subnet in which this Bastion Host has been created.
- name string
- The name of the Bastion Host.
- publicIp stringAddress Id 
- Reference to a Public IP Address associated to this Bastion Host.
- subnetId string
- Reference to the subnet in which this Bastion Host has been created.
- name str
- The name of the Bastion Host.
- public_ip_ straddress_ id 
- Reference to a Public IP Address associated to this Bastion Host.
- subnet_id str
- Reference to the subnet in which this Bastion Host has been created.
- name String
- The name of the Bastion Host.
- publicIp StringAddress Id 
- Reference to a Public IP Address associated to this Bastion Host.
- subnetId String
- Reference to the subnet in which this Bastion Host has been created.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.