published on Wednesday, Apr 15, 2026 by ionos-cloud
published on Wednesday, Apr 15, 2026 by ionos-cloud
The GPU data source can be used to search for and return an existing GPU by either its ID or name. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.
Example Usage
By ID
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
const example = ionoscloud.compute.getGpu({
datacenterId: "datacenter_id",
serverId: "server_id",
id: "gpu_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.compute.get_gpu(datacenter_id="datacenter_id",
server_id="server_id",
id="gpu_id")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetGpu(ctx, &compute.GetGpuArgs{
DatacenterId: "datacenter_id",
ServerId: "server_id",
Id: pulumi.StringRef("gpu_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Compute.GetGpu.Invoke(new()
{
DatacenterId = "datacenter_id",
ServerId = "server_id",
Id = "gpu_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.compute.ComputeFunctions;
import com.pulumi.ionoscloud.compute.inputs.GetGpuArgs;
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.getGpu(GetGpuArgs.builder()
.datacenterId("datacenter_id")
.serverId("server_id")
.id("gpu_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:compute:getGpu
arguments:
datacenterId: datacenter_id
serverId: server_id
id: gpu_id
By Name
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
const example = ionoscloud.compute.getGpu({
datacenterId: "datacenter_id",
serverId: "server_id",
name: "GPU Name",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.compute.get_gpu(datacenter_id="datacenter_id",
server_id="server_id",
name="GPU Name")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.GetGpu(ctx, &compute.GetGpuArgs{
DatacenterId: "datacenter_id",
ServerId: "server_id",
Name: pulumi.StringRef("GPU Name"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.Compute.GetGpu.Invoke(new()
{
DatacenterId = "datacenter_id",
ServerId = "server_id",
Name = "GPU Name",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.compute.ComputeFunctions;
import com.pulumi.ionoscloud.compute.inputs.GetGpuArgs;
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.getGpu(GetGpuArgs.builder()
.datacenterId("datacenter_id")
.serverId("server_id")
.name("GPU Name")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:compute:getGpu
arguments:
datacenterId: datacenter_id
serverId: server_id
name: GPU Name
Using getGpu
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 getGpu(args: GetGpuArgs, opts?: InvokeOptions): Promise<GetGpuResult>
function getGpuOutput(args: GetGpuOutputArgs, opts?: InvokeOptions): Output<GetGpuResult>def get_gpu(datacenter_id: Optional[str] = None,
id: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
server_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGpuResult
def get_gpu_output(datacenter_id: pulumi.Input[Optional[str]] = None,
id: pulumi.Input[Optional[str]] = None,
location: pulumi.Input[Optional[str]] = None,
name: pulumi.Input[Optional[str]] = None,
server_id: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGpuResult]func GetGpu(ctx *Context, args *GetGpuArgs, opts ...InvokeOption) (*GetGpuResult, error)
func GetGpuOutput(ctx *Context, args *GetGpuOutputArgs, opts ...InvokeOption) GetGpuResultOutput> Note: This function is named GetGpu in the Go SDK.
public static class GetGpu
{
public static Task<GetGpuResult> InvokeAsync(GetGpuArgs args, InvokeOptions? opts = null)
public static Output<GetGpuResult> Invoke(GetGpuInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetGpuResult> getGpu(GetGpuArgs args, InvokeOptions options)
public static Output<GetGpuResult> getGpu(GetGpuArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getGpu:getGpu
arguments:
# arguments dictionaryThe following arguments are supported:
- Datacenter
Id string - The ID of the datacenter.
- Server
Id string - The ID of the server.
- Id string
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- Location string
- Name string
- Name of the GPU.
- Datacenter
Id string - The ID of the datacenter.
- Server
Id string - The ID of the server.
- Id string
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- Location string
- Name string
- Name of the GPU.
- datacenter
Id String - The ID of the datacenter.
- server
Id String - The ID of the server.
- id String
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- location String
- name String
- Name of the GPU.
- datacenter
Id string - The ID of the datacenter.
- server
Id string - The ID of the server.
- id string
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- location string
- name string
- Name of the GPU.
- datacenter_
id str - The ID of the datacenter.
- server_
id str - The ID of the server.
- id str
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- location str
- name str
- Name of the GPU.
- datacenter
Id String - The ID of the datacenter.
- server
Id String - The ID of the server.
- id String
ID of the GPU.
datacenterIdandserverIdare required. Eithernameoridmust be provided. If bothnameandidare provided, the datasource will return an error.- location String
- name String
- Name of the GPU.
getGpu Result
The following output properties are available:
Package Details
- Repository
- ionoscloud ionos-cloud/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloudTerraform Provider.
published on Wednesday, Apr 15, 2026 by ionos-cloud
