gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core
gcore.getImage
Explore with Pulumi AI
Represent image data
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcore from "@pulumi/gcore";
const pr = gcore.getProject({
name: "test",
});
const rg = gcore.getRegion({
name: "ED-10 Preprod",
});
const ubuntu = Promise.all([rg, pr]).then(([rg, pr]) => gcore.getImage({
name: "ubuntu-22.04-x64",
regionId: rg.id,
projectId: pr.id,
}));
export const view = ubuntu;
import pulumi
import pulumi_gcore as gcore
pr = gcore.get_project(name="test")
rg = gcore.get_region(name="ED-10 Preprod")
ubuntu = gcore.get_image(name="ubuntu-22.04-x64",
region_id=rg.id,
project_id=pr.id)
pulumi.export("view", ubuntu)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
pr, err := gcore.GetProject(ctx, &gcore.GetProjectArgs{
Name: "test",
}, nil)
if err != nil {
return err
}
rg, err := gcore.GetRegion(ctx, &gcore.GetRegionArgs{
Name: "ED-10 Preprod",
}, nil)
if err != nil {
return err
}
ubuntu, err := gcore.GetImage(ctx, &gcore.GetImageArgs{
Name: pulumi.StringRef("ubuntu-22.04-x64"),
RegionId: pulumi.Float64Ref(rg.Id),
ProjectId: pulumi.Float64Ref(pr.Id),
}, nil)
if err != nil {
return err
}
ctx.Export("view", ubuntu)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcore = Pulumi.Gcore;
return await Deployment.RunAsync(() =>
{
var pr = Gcore.GetProject.Invoke(new()
{
Name = "test",
});
var rg = Gcore.GetRegion.Invoke(new()
{
Name = "ED-10 Preprod",
});
var ubuntu = Gcore.GetImage.Invoke(new()
{
Name = "ubuntu-22.04-x64",
RegionId = rg.Apply(getRegionResult => getRegionResult.Id),
ProjectId = pr.Apply(getProjectResult => getProjectResult.Id),
});
return new Dictionary<string, object?>
{
["view"] = ubuntu,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcore.GcoreFunctions;
import com.pulumi.gcore.inputs.GetProjectArgs;
import com.pulumi.gcore.inputs.GetRegionArgs;
import com.pulumi.gcore.inputs.GetImageArgs;
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 pr = GcoreFunctions.getProject(GetProjectArgs.builder()
.name("test")
.build());
final var rg = GcoreFunctions.getRegion(GetRegionArgs.builder()
.name("ED-10 Preprod")
.build());
final var ubuntu = GcoreFunctions.getImage(GetImageArgs.builder()
.name("ubuntu-22.04-x64")
.regionId(rg.applyValue(getRegionResult -> getRegionResult.id()))
.projectId(pr.applyValue(getProjectResult -> getProjectResult.id()))
.build());
ctx.export("view", ubuntu.applyValue(getImageResult -> getImageResult));
}
}
variables:
pr:
fn::invoke:
function: gcore:getProject
arguments:
name: test
rg:
fn::invoke:
function: gcore:getRegion
arguments:
name: ED-10 Preprod
ubuntu:
fn::invoke:
function: gcore:getImage
arguments:
name: ubuntu-22.04-x64
regionId: ${rg.id}
projectId: ${pr.id}
outputs:
view: ${ubuntu}
Using getImage
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 getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
def get_image(id: Optional[str] = None,
image_id: Optional[str] = None,
is_baremetal: Optional[bool] = None,
metadata_k: Optional[str] = None,
metadata_kv: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
project_id: Optional[float] = None,
project_name: Optional[str] = None,
region_id: Optional[float] = None,
region_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(id: Optional[pulumi.Input[str]] = None,
image_id: Optional[pulumi.Input[str]] = None,
is_baremetal: Optional[pulumi.Input[bool]] = None,
metadata_k: Optional[pulumi.Input[str]] = None,
metadata_kv: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[float]] = None,
project_name: Optional[pulumi.Input[str]] = None,
region_id: Optional[pulumi.Input[float]] = None,
region_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]
func GetImage(ctx *Context, args *GetImageArgs, opts ...InvokeOption) (*GetImageResult, error)
func GetImageOutput(ctx *Context, args *GetImageOutputArgs, opts ...InvokeOption) GetImageResultOutput
> Note: This function is named GetImage
in the Go SDK.
public static class GetImage
{
public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
fn::invoke:
function: gcore:index/getImage:getImage
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- The ID of this resource.
- Image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- Is
Baremetal bool - set to true if you need to get baremetal image
- Metadata
K string - Metadata
Kv Dictionary<string, string> - Name string
- use 'os-version', for example 'ubuntu-20.04'
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Id string
- The ID of this resource.
- Image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- Is
Baremetal bool - set to true if you need to get baremetal image
- Metadata
K string - Metadata
Kv map[string]string - Name string
- use 'os-version', for example 'ubuntu-20.04'
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- id String
- The ID of this resource.
- image
Id String - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal Boolean - set to true if you need to get baremetal image
- metadata
K String - metadata
Kv Map<String,String> - name String
- use 'os-version', for example 'ubuntu-20.04'
- project
Id Double - project
Name String - region
Id Double - region
Name String
- id string
- The ID of this resource.
- image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal boolean - set to true if you need to get baremetal image
- metadata
K string - metadata
Kv {[key: string]: string} - name string
- use 'os-version', for example 'ubuntu-20.04'
- project
Id number - project
Name string - region
Id number - region
Name string
- id str
- The ID of this resource.
- image_
id str - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is_
baremetal bool - set to true if you need to get baremetal image
- metadata_
k str - metadata_
kv Mapping[str, str] - name str
- use 'os-version', for example 'ubuntu-20.04'
- project_
id float - project_
name str - region_
id float - region_
name str
- id String
- The ID of this resource.
- image
Id String - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal Boolean - set to true if you need to get baremetal image
- metadata
K String - metadata
Kv Map<String> - name String
- use 'os-version', for example 'ubuntu-20.04'
- project
Id Number - project
Name String - region
Id Number - region
Name String
getImage Result
The following output properties are available:
- Description string
- Id string
- The ID of this resource.
- Metadata
Read List<GetOnlies Image Metadata Read Only> - Min
Disk double - Min
Ram double - Os
Distro string - Os
Version string - Image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- Is
Baremetal bool - set to true if you need to get baremetal image
- Metadata
K string - Metadata
Kv Dictionary<string, string> - Name string
- use 'os-version', for example 'ubuntu-20.04'
- Project
Id double - Project
Name string - Region
Id double - Region
Name string
- Description string
- Id string
- The ID of this resource.
- Metadata
Read []GetOnlies Image Metadata Read Only - Min
Disk float64 - Min
Ram float64 - Os
Distro string - Os
Version string - Image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- Is
Baremetal bool - set to true if you need to get baremetal image
- Metadata
K string - Metadata
Kv map[string]string - Name string
- use 'os-version', for example 'ubuntu-20.04'
- Project
Id float64 - Project
Name string - Region
Id float64 - Region
Name string
- description String
- id String
- The ID of this resource.
- metadata
Read List<GetOnlies Image Metadata Read Only> - min
Disk Double - min
Ram Double - os
Distro String - os
Version String - image
Id String - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal Boolean - set to true if you need to get baremetal image
- metadata
K String - metadata
Kv Map<String,String> - name String
- use 'os-version', for example 'ubuntu-20.04'
- project
Id Double - project
Name String - region
Id Double - region
Name String
- description string
- id string
- The ID of this resource.
- metadata
Read GetOnlies Image Metadata Read Only[] - min
Disk number - min
Ram number - os
Distro string - os
Version string - image
Id string - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal boolean - set to true if you need to get baremetal image
- metadata
K string - metadata
Kv {[key: string]: string} - name string
- use 'os-version', for example 'ubuntu-20.04'
- project
Id number - project
Name string - region
Id number - region
Name string
- description str
- id str
- The ID of this resource.
- metadata_
read_ Sequence[Getonlies Image Metadata Read Only] - min_
disk float - min_
ram float - os_
distro str - os_
version str - image_
id str - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is_
baremetal bool - set to true if you need to get baremetal image
- metadata_
k str - metadata_
kv Mapping[str, str] - name str
- use 'os-version', for example 'ubuntu-20.04'
- project_
id float - project_
name str - region_
id float - region_
name str
- description String
- id String
- The ID of this resource.
- metadata
Read List<Property Map>Onlies - min
Disk Number - min
Ram Number - os
Distro String - os
Version String - image
Id String - use 'image_id' if you know it, for example 'f4b1b1b1-1b1b-1b1b-1b1b-1b1b1b1b1b1b'
- is
Baremetal Boolean - set to true if you need to get baremetal image
- metadata
K String - metadata
Kv Map<String> - name String
- use 'os-version', for example 'ubuntu-20.04'
- project
Id Number - project
Name String - region
Id Number - region
Name String
Supporting Types
GetImageMetadataReadOnly
Package Details
- Repository
- gcore g-core/terraform-provider-gcore
- License
- Notes
- This Pulumi package is based on the
gcore
Terraform Provider.