1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. getSnapshot
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.getSnapshot

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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 GetSnapshotTimeouts
    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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 GetSnapshotTimeouts
    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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 GetSnapshotTimeouts
    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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 GetSnapshotTimeouts
    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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 GetSnapshotTimeouts
    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 or id must be provided. If none, or both are provided, the datasource will return an error. Additionally, you can add location and size along with the name 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:

    CpuHotPlug bool
    Is capable of CPU hot plug (no reboot required)
    CpuHotUnplug bool
    Is capable of CPU hot unplug (no reboot required)
    Description string
    Human readable description
    DiscScsiHotPlug bool
    Is capable of SCSI drive hot plug (no reboot required)
    DiscScsiHotUnplug bool
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    DiscVirtioHotPlug bool
    Is capable of Virt-IO drive hot plug (no reboot required)
    DiscVirtioHotUnplug bool
    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
    LicenceType string
    OS type of this Snapshot
    Location string
    Location of that image/snapshot
    Name string
    The name of the snapshot.
    NicHotPlug bool
    Is capable of nic hot plug (no reboot required)
    NicHotUnplug bool
    Is capable of nic hot unplug (no reboot required)
    RamHotPlug bool
    Is capable of memory hot plug (no reboot required)
    RamHotUnplug bool
    Is capable of memory hot unplug (no reboot required)
    SecAuthProtection bool
    Boolean value representing if the snapshot requires extra protection e.g. two factor protection
    Size double
    The size of the image in GB
    Timeouts GetSnapshotTimeouts
    CpuHotPlug bool
    Is capable of CPU hot plug (no reboot required)
    CpuHotUnplug bool
    Is capable of CPU hot unplug (no reboot required)
    Description string
    Human readable description
    DiscScsiHotPlug bool
    Is capable of SCSI drive hot plug (no reboot required)
    DiscScsiHotUnplug bool
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    DiscVirtioHotPlug bool
    Is capable of Virt-IO drive hot plug (no reboot required)
    DiscVirtioHotUnplug bool
    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
    LicenceType string
    OS type of this Snapshot
    Location string
    Location of that image/snapshot
    Name string
    The name of the snapshot.
    NicHotPlug bool
    Is capable of nic hot plug (no reboot required)
    NicHotUnplug bool
    Is capable of nic hot unplug (no reboot required)
    RamHotPlug bool
    Is capable of memory hot plug (no reboot required)
    RamHotUnplug bool
    Is capable of memory hot unplug (no reboot required)
    SecAuthProtection bool
    Boolean value representing if the snapshot requires extra protection e.g. two factor protection
    Size float64
    The size of the image in GB
    Timeouts GetSnapshotTimeouts
    cpuHotPlug Boolean
    Is capable of CPU hot plug (no reboot required)
    cpuHotUnplug Boolean
    Is capable of CPU hot unplug (no reboot required)
    description String
    Human readable description
    discScsiHotPlug Boolean
    Is capable of SCSI drive hot plug (no reboot required)
    discScsiHotUnplug Boolean
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    discVirtioHotPlug Boolean
    Is capable of Virt-IO drive hot plug (no reboot required)
    discVirtioHotUnplug Boolean
    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
    licenceType String
    OS type of this Snapshot
    location String
    Location of that image/snapshot
    name String
    The name of the snapshot.
    nicHotPlug Boolean
    Is capable of nic hot plug (no reboot required)
    nicHotUnplug Boolean
    Is capable of nic hot unplug (no reboot required)
    ramHotPlug Boolean
    Is capable of memory hot plug (no reboot required)
    ramHotUnplug Boolean
    Is capable of memory hot unplug (no reboot required)
    secAuthProtection Boolean
    Boolean value representing if the snapshot requires extra protection e.g. two factor protection
    size Double
    The size of the image in GB
    timeouts GetSnapshotTimeouts
    cpuHotPlug boolean
    Is capable of CPU hot plug (no reboot required)
    cpuHotUnplug boolean
    Is capable of CPU hot unplug (no reboot required)
    description string
    Human readable description
    discScsiHotPlug boolean
    Is capable of SCSI drive hot plug (no reboot required)
    discScsiHotUnplug boolean
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    discVirtioHotPlug boolean
    Is capable of Virt-IO drive hot plug (no reboot required)
    discVirtioHotUnplug boolean
    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
    licenceType string
    OS type of this Snapshot
    location string
    Location of that image/snapshot
    name string
    The name of the snapshot.
    nicHotPlug boolean
    Is capable of nic hot plug (no reboot required)
    nicHotUnplug boolean
    Is capable of nic hot unplug (no reboot required)
    ramHotPlug boolean
    Is capable of memory hot plug (no reboot required)
    ramHotUnplug boolean
    Is capable of memory hot unplug (no reboot required)
    secAuthProtection boolean
    Boolean value representing if the snapshot requires extra protection e.g. two factor protection
    size number
    The size of the image in GB
    timeouts GetSnapshotTimeouts
    cpu_hot_plug bool
    Is capable of CPU hot plug (no reboot required)
    cpu_hot_unplug bool
    Is capable of CPU hot unplug (no reboot required)
    description str
    Human readable description
    disc_scsi_hot_plug bool
    Is capable of SCSI drive hot plug (no reboot required)
    disc_scsi_hot_unplug bool
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    disc_virtio_hot_plug bool
    Is capable of Virt-IO drive hot plug (no reboot required)
    disc_virtio_hot_unplug bool
    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_plug bool
    Is capable of nic hot plug (no reboot required)
    nic_hot_unplug bool
    Is capable of nic hot unplug (no reboot required)
    ram_hot_plug bool
    Is capable of memory hot plug (no reboot required)
    ram_hot_unplug bool
    Is capable of memory hot unplug (no reboot required)
    sec_auth_protection bool
    Boolean value representing if the snapshot requires extra protection e.g. two factor protection
    size float
    The size of the image in GB
    timeouts GetSnapshotTimeouts
    cpuHotPlug Boolean
    Is capable of CPU hot plug (no reboot required)
    cpuHotUnplug Boolean
    Is capable of CPU hot unplug (no reboot required)
    description String
    Human readable description
    discScsiHotPlug Boolean
    Is capable of SCSI drive hot plug (no reboot required)
    discScsiHotUnplug Boolean
    Is capable of SCSI drive hot unplug (no reboot required). This works only for non-Windows virtual Machines.
    discVirtioHotPlug Boolean
    Is capable of Virt-IO drive hot plug (no reboot required)
    discVirtioHotUnplug Boolean
    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
    licenceType String
    OS type of this Snapshot
    location String
    Location of that image/snapshot
    name String
    The name of the snapshot.
    nicHotPlug Boolean
    Is capable of nic hot plug (no reboot required)
    nicHotUnplug Boolean
    Is capable of nic hot unplug (no reboot required)
    ramHotPlug Boolean
    Is capable of memory hot plug (no reboot required)
    ramHotUnplug Boolean
    Is capable of memory hot unplug (no reboot required)
    secAuthProtection Boolean
    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

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud