get Compute Machine
Use this data source to access information about an existing Hybrid Compute.
Disclaimers
Note: The Data Source
azure.hybrid.getComputeMachine
is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of theazure.arcmachine.get
Data Source.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.hybrid.getComputeMachine({
name: "existing-hcmachine",
resourceGroupName: "existing-rg",
});
export const id = example.then(example => example.id);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.hybrid.get_compute_machine(name="existing-hcmachine",
resource_group_name="existing-rg")
pulumi.export("id", 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.Hybrid.GetComputeMachine.Invoke(new()
{
Name = "existing-hcmachine",
ResourceGroupName = "existing-rg",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getComputeMachineResult => getComputeMachineResult.Id),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hybrid"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := hybrid.GetComputeMachine(ctx, &hybrid.GetComputeMachineArgs{
Name: "existing-hcmachine",
ResourceGroupName: "existing-rg",
}, nil)
if err != nil {
return err
}
ctx.Export("id", 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.hybrid.HybridFunctions;
import com.pulumi.azure.hybrid.inputs.GetComputeMachineArgs;
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 = HybridFunctions.getComputeMachine(GetComputeMachineArgs.builder()
.name("existing-hcmachine")
.resourceGroupName("existing-rg")
.build());
ctx.export("id", example.applyValue(getComputeMachineResult -> getComputeMachineResult.id()));
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
Function: azure:hybrid:getComputeMachine
Arguments:
name: existing-hcmachine
resourceGroupName: existing-rg
outputs:
id: ${example.id}
Content copied to clipboard
Return
A collection of values returned by getComputeMachine.
Parameters
argument
A collection of arguments for invoking getComputeMachine.
Return
A collection of values returned by getComputeMachine.
Parameters
name
The name of this hybrid compute machine.
resource Group Name
The name of the Resource Group where the Hybrid Compute exists.
See also
suspend fun getComputeMachine(argument: suspend GetComputeMachinePlainArgsBuilder.() -> Unit): GetComputeMachineResult
Return
A collection of values returned by getComputeMachine.
Parameters
argument
Builder for com.pulumi.azure.hybrid.kotlin.inputs.GetComputeMachinePlainArgs.