We recommend using Azure Native.
Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi
azure.compute.getDedicatedHost
Explore with Pulumi AI
Use this data source to access information about an existing Dedicated Host.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.compute.getDedicatedHost({
name: "example-host",
dedicatedHostGroupName: "example-host-group",
resourceGroupName: "example-resources",
});
export const dedicatedHostId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.compute.get_dedicated_host(name="example-host",
dedicated_host_group_name="example-host-group",
resource_group_name="example-resources")
pulumi.export("dedicatedHostId", 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.LookupDedicatedHost(ctx, &compute.LookupDedicatedHostArgs{
Name: "example-host",
DedicatedHostGroupName: "example-host-group",
ResourceGroupName: "example-resources",
}, nil)
if err != nil {
return err
}
ctx.Export("dedicatedHostId", 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.GetDedicatedHost.Invoke(new()
{
Name = "example-host",
DedicatedHostGroupName = "example-host-group",
ResourceGroupName = "example-resources",
});
return new Dictionary<string, object?>
{
["dedicatedHostId"] = example.Apply(getDedicatedHostResult => getDedicatedHostResult.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.GetDedicatedHostArgs;
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.getDedicatedHost(GetDedicatedHostArgs.builder()
.name("example-host")
.dedicatedHostGroupName("example-host-group")
.resourceGroupName("example-resources")
.build());
ctx.export("dedicatedHostId", example.applyValue(getDedicatedHostResult -> getDedicatedHostResult.id()));
}
}
variables:
example:
fn::invoke:
Function: azure:compute:getDedicatedHost
Arguments:
name: example-host
dedicatedHostGroupName: example-host-group
resourceGroupName: example-resources
outputs:
dedicatedHostId: ${example.id}
Using getDedicatedHost
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 getDedicatedHost(args: GetDedicatedHostArgs, opts?: InvokeOptions): Promise<GetDedicatedHostResult>
function getDedicatedHostOutput(args: GetDedicatedHostOutputArgs, opts?: InvokeOptions): Output<GetDedicatedHostResult>
def get_dedicated_host(dedicated_host_group_name: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDedicatedHostResult
def get_dedicated_host_output(dedicated_host_group_name: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDedicatedHostResult]
func LookupDedicatedHost(ctx *Context, args *LookupDedicatedHostArgs, opts ...InvokeOption) (*LookupDedicatedHostResult, error)
func LookupDedicatedHostOutput(ctx *Context, args *LookupDedicatedHostOutputArgs, opts ...InvokeOption) LookupDedicatedHostResultOutput
> Note: This function is named LookupDedicatedHost
in the Go SDK.
public static class GetDedicatedHost
{
public static Task<GetDedicatedHostResult> InvokeAsync(GetDedicatedHostArgs args, InvokeOptions? opts = null)
public static Output<GetDedicatedHostResult> Invoke(GetDedicatedHostInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDedicatedHostResult> getDedicatedHost(GetDedicatedHostArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: azure:compute/getDedicatedHost:getDedicatedHost
arguments:
# arguments dictionary
The following arguments are supported:
- Dedicated
Host stringGroup Name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- Name string
- Specifies the name of the Dedicated Host.
- Resource
Group stringName - Specifies the name of the resource group the Dedicated Host is located in.
- Dedicated
Host stringGroup Name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- Name string
- Specifies the name of the Dedicated Host.
- Resource
Group stringName - Specifies the name of the resource group the Dedicated Host is located in.
- dedicated
Host StringGroup Name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- name String
- Specifies the name of the Dedicated Host.
- resource
Group StringName - Specifies the name of the resource group the Dedicated Host is located in.
- dedicated
Host stringGroup Name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- name string
- Specifies the name of the Dedicated Host.
- resource
Group stringName - Specifies the name of the resource group the Dedicated Host is located in.
- dedicated_
host_ strgroup_ name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- name str
- Specifies the name of the Dedicated Host.
- resource_
group_ strname - Specifies the name of the resource group the Dedicated Host is located in.
- dedicated
Host StringGroup Name - Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
- name String
- Specifies the name of the Dedicated Host.
- resource
Group StringName - Specifies the name of the resource group the Dedicated Host is located in.
getDedicatedHost Result
The following output properties are available:
- Dedicated
Host stringGroup Name - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location where the Dedicated Host exists.
- Name string
- Resource
Group stringName - Dictionary<string, string>
- A mapping of tags assigned to the Dedicated Host.
- Dedicated
Host stringGroup Name - Id string
- The provider-assigned unique ID for this managed resource.
- Location string
- The location where the Dedicated Host exists.
- Name string
- Resource
Group stringName - map[string]string
- A mapping of tags assigned to the Dedicated Host.
- dedicated
Host StringGroup Name - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location where the Dedicated Host exists.
- name String
- resource
Group StringName - Map<String,String>
- A mapping of tags assigned to the Dedicated Host.
- dedicated
Host stringGroup Name - id string
- The provider-assigned unique ID for this managed resource.
- location string
- The location where the Dedicated Host exists.
- name string
- resource
Group stringName - {[key: string]: string}
- A mapping of tags assigned to the Dedicated Host.
- dedicated_
host_ strgroup_ name - id str
- The provider-assigned unique ID for this managed resource.
- location str
- The location where the Dedicated Host exists.
- name str
- resource_
group_ strname - Mapping[str, str]
- A mapping of tags assigned to the Dedicated Host.
- dedicated
Host StringGroup Name - id String
- The provider-assigned unique ID for this managed resource.
- location String
- The location where the Dedicated Host exists.
- name String
- resource
Group StringName - Map<String>
- A mapping of tags assigned to the Dedicated Host.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.