get Dedicated Host
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);
Content copied to clipboard
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)
Content copied to clipboard
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),
};
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:compute:getDedicatedHost
arguments:
name: example-host
dedicatedHostGroupName: example-host-group
resourceGroupName: example-resources
outputs:
dedicatedHostId: ${example.id}
Content copied to clipboard
Return
A collection of values returned by getDedicatedHost.
Parameters
argument
A collection of arguments for invoking getDedicatedHost.
suspend fun getDedicatedHost(dedicatedHostGroupName: String, name: String, resourceGroupName: String): GetDedicatedHostResult
Return
A collection of values returned by getDedicatedHost.
Parameters
dedicated Host Group Name
Specifies the name of the Dedicated Host Group the Dedicated Host is located in.
name
Specifies the name of the Dedicated Host.
resource Group Name
Specifies the name of the resource group the Dedicated Host is located in.
See also
suspend fun getDedicatedHost(argument: suspend GetDedicatedHostPlainArgsBuilder.() -> Unit): GetDedicatedHostResult
Return
A collection of values returned by getDedicatedHost.
Parameters
argument
Builder for com.pulumi.azure.compute.kotlin.inputs.GetDedicatedHostPlainArgs.