ionoscloud.getSnapshot
Explore with Pulumi AI
The Snapshot data source can be used to search for and return an existing snapshot which can then be used to provision a server. 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 "@pulumi/ionoscloud";
const example = ionoscloud.getSnapshot({
id: "snapshot_id",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_snapshot(id="snapshot_id")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupSnapshot(ctx, &ionoscloud.LookupSnapshotArgs{
Id: pulumi.StringRef("snapshot_id"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetSnapshot.Invoke(new()
{
Id = "snapshot_id",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetSnapshotArgs;
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 = IonoscloudFunctions.getSnapshot(GetSnapshotArgs.builder()
.id("snapshot_id")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getSnapshot
arguments:
id: snapshot_id
By Name & Size & Location
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const example = ionoscloud.getSnapshot({
location: "us/las",
name: "Snapshot Example",
size: 2,
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.get_snapshot(location="us/las",
name="Snapshot Example",
size=2)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ionoscloud.LookupSnapshot(ctx, &ionoscloud.LookupSnapshotArgs{
Location: pulumi.StringRef("us/las"),
Name: pulumi.StringRef("Snapshot Example"),
Size: pulumi.Float64Ref(2),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = Ionoscloud.GetSnapshot.Invoke(new()
{
Location = "us/las",
Name = "Snapshot Example",
Size = 2,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.IonoscloudFunctions;
import com.pulumi.ionoscloud.inputs.GetSnapshotArgs;
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 = IonoscloudFunctions.getSnapshot(GetSnapshotArgs.builder()
.location("us/las")
.name("Snapshot Example")
.size("2")
.build());
}
}
variables:
example:
fn::invoke:
function: ionoscloud:getSnapshot
arguments:
location: us/las
name: Snapshot Example
size: '2'
Note: The size argument is in GB
Using getSnapshot
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 getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>
function getSnapshotOutput(args: GetSnapshotOutputArgs, opts?: InvokeOptions): Output<GetSnapshotResult>
def get_snapshot(id: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
size: Optional[float] = None,
timeouts: Optional[GetSnapshotTimeouts] = None,
opts: Optional[InvokeOptions] = None) -> GetSnapshotResult
def get_snapshot_output(id: Optional[pulumi.Input[str]] = None,
location: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
size: Optional[pulumi.Input[float]] = None,
timeouts: Optional[pulumi.Input[GetSnapshotTimeoutsArgs]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotResult]
func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)
func LookupSnapshotOutput(ctx *Context, args *LookupSnapshotOutputArgs, opts ...InvokeOption) LookupSnapshotResultOutput
> Note: This function is named LookupSnapshot
in the Go SDK.
public static class GetSnapshot
{
public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
public static Output<GetSnapshotResult> Invoke(GetSnapshotInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
public static Output<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
fn::invoke:
function: ionoscloud:index/getSnapshot:getSnapshot
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- UUID of an existing snapshot that you want to search for.
- Location string
- Existing snapshot's location.
- Name string
- Name of an existing snapshot that you want to search for.
- Size double
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- Timeouts
Get
Snapshot Timeouts
- Id string
- UUID of an existing snapshot that you want to search for.
- Location string
- Existing snapshot's location.
- Name string
- Name of an existing snapshot that you want to search for.
- Size float64
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- Timeouts
Get
Snapshot Timeouts
- id String
- UUID of an existing snapshot that you want to search for.
- location String
- Existing snapshot's location.
- name String
- Name of an existing snapshot that you want to search for.
- size Double
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- timeouts
Get
Snapshot Timeouts
- id string
- UUID of an existing snapshot that you want to search for.
- location string
- Existing snapshot's location.
- name string
- Name of an existing snapshot that you want to search for.
- size number
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- timeouts
Get
Snapshot Timeouts
- id str
- UUID of an existing snapshot that you want to search for.
- location str
- Existing snapshot's location.
- name str
- Name of an existing snapshot that you want to search for.
- size float
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- timeouts
Get
Snapshot Timeouts
- id String
- UUID of an existing snapshot that you want to search for.
- location String
- Existing snapshot's location.
- name String
- Name of an existing snapshot that you want to search for.
- size Number
The size of the snapshot to look for.
Either
name
orid
must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can addlocation
andsize
along with thename
argument for a more refined search. 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.- timeouts Property Map
getSnapshot Result
The following output properties are available:
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Cpu
Hot boolUnplug - Is capable of CPU hot unplug (no reboot required)
- Description string
- Human readable description
- Disc
Scsi boolHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- Disc
Scsi boolHot Unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Id string
- UUID of the snapshot
- Licence
Type string - OS type of this Snapshot
- Location string
- Location of that image/snapshot
- Name string
- The name of the snapshot.
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Ram
Hot boolUnplug - Is capable of memory hot unplug (no reboot required)
- Sec
Auth boolProtection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- Size double
- The size of the image in GB
- Timeouts
Get
Snapshot Timeouts
- Cpu
Hot boolPlug - Is capable of CPU hot plug (no reboot required)
- Cpu
Hot boolUnplug - Is capable of CPU hot unplug (no reboot required)
- Description string
- Human readable description
- Disc
Scsi boolHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- Disc
Scsi boolHot Unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Disc
Virtio boolHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- Disc
Virtio boolHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- Id string
- UUID of the snapshot
- Licence
Type string - OS type of this Snapshot
- Location string
- Location of that image/snapshot
- Name string
- The name of the snapshot.
- Nic
Hot boolPlug - Is capable of nic hot plug (no reboot required)
- Nic
Hot boolUnplug - Is capable of nic hot unplug (no reboot required)
- Ram
Hot boolPlug - Is capable of memory hot plug (no reboot required)
- Ram
Hot boolUnplug - Is capable of memory hot unplug (no reboot required)
- Sec
Auth boolProtection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- Size float64
- The size of the image in GB
- Timeouts
Get
Snapshot Timeouts
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot BooleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description String
- Human readable description
- disc
Scsi BooleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi BooleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- id String
- UUID of the snapshot
- licence
Type String - OS type of this Snapshot
- location String
- Location of that image/snapshot
- name String
- The name of the snapshot.
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot BooleanUnplug - Is capable of memory hot unplug (no reboot required)
- sec
Auth BooleanProtection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- size Double
- The size of the image in GB
- timeouts
Get
Snapshot Timeouts
- cpu
Hot booleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot booleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description string
- Human readable description
- disc
Scsi booleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi booleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disc
Virtio booleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio booleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- id string
- UUID of the snapshot
- licence
Type string - OS type of this Snapshot
- location string
- Location of that image/snapshot
- name string
- The name of the snapshot.
- nic
Hot booleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot booleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot booleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot booleanUnplug - Is capable of memory hot unplug (no reboot required)
- sec
Auth booleanProtection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- size number
- The size of the image in GB
- timeouts
Get
Snapshot Timeouts
- cpu_
hot_ boolplug - Is capable of CPU hot plug (no reboot required)
- cpu_
hot_ boolunplug - Is capable of CPU hot unplug (no reboot required)
- description str
- Human readable description
- disc_
scsi_ boolhot_ plug - Is capable of SCSI drive hot plug (no reboot required)
- disc_
scsi_ boolhot_ unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disc_
virtio_ boolhot_ plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc_
virtio_ boolhot_ unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- id str
- UUID of the snapshot
- licence_
type str - OS type of this Snapshot
- location str
- Location of that image/snapshot
- name str
- The name of the snapshot.
- nic_
hot_ boolplug - Is capable of nic hot plug (no reboot required)
- nic_
hot_ boolunplug - Is capable of nic hot unplug (no reboot required)
- ram_
hot_ boolplug - Is capable of memory hot plug (no reboot required)
- ram_
hot_ boolunplug - Is capable of memory hot unplug (no reboot required)
- sec_
auth_ boolprotection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- size float
- The size of the image in GB
- timeouts
Get
Snapshot Timeouts
- cpu
Hot BooleanPlug - Is capable of CPU hot plug (no reboot required)
- cpu
Hot BooleanUnplug - Is capable of CPU hot unplug (no reboot required)
- description String
- Human readable description
- disc
Scsi BooleanHot Plug - Is capable of SCSI drive hot plug (no reboot required)
- disc
Scsi BooleanHot Unplug - Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- disc
Virtio BooleanHot Plug - Is capable of Virt-IO drive hot plug (no reboot required)
- disc
Virtio BooleanHot Unplug - Is capable of Virt-IO drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
- id String
- UUID of the snapshot
- licence
Type String - OS type of this Snapshot
- location String
- Location of that image/snapshot
- name String
- The name of the snapshot.
- nic
Hot BooleanPlug - Is capable of nic hot plug (no reboot required)
- nic
Hot BooleanUnplug - Is capable of nic hot unplug (no reboot required)
- ram
Hot BooleanPlug - Is capable of memory hot plug (no reboot required)
- ram
Hot BooleanUnplug - Is capable of memory hot unplug (no reboot required)
- sec
Auth BooleanProtection - Boolean value representing if the snapshot requires extra protection e.g. two factor protection
- size Number
- The size of the image in GB
- timeouts Property Map
Supporting Types
GetSnapshotTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.