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

ionoscloud.getBackupUnit

Explore with Pulumi AI

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

    The Backup Unit data source can be used to search for and return an existing Backup Unit. You can provide a string for either id or name parameters which will be compared with provisioned Backup Units. 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.getBackupUnit({
        id: "backup_unit_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_backup_unit(id="backup_unit_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.LookupBackupUnit(ctx, &ionoscloud.LookupBackupUnitArgs{
    			Id: pulumi.StringRef("backup_unit_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.GetBackupUnit.Invoke(new()
        {
            Id = "backup_unit_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.GetBackupUnitArgs;
    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.getBackupUnit(GetBackupUnitArgs.builder()
                .id("backup_unit_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getBackupUnit
          arguments:
            id: backup_unit_id
    

    By Name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getBackupUnit({
        name: "Backup Unit Example",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_backup_unit(name="Backup Unit Example")
    
    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.LookupBackupUnit(ctx, &ionoscloud.LookupBackupUnitArgs{
    			Name: pulumi.StringRef("Backup Unit Example"),
    		}, 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.GetBackupUnit.Invoke(new()
        {
            Name = "Backup Unit Example",
        });
    
    });
    
    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.GetBackupUnitArgs;
    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.getBackupUnit(GetBackupUnitArgs.builder()
                .name("Backup Unit Example")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getBackupUnit
          arguments:
            name: Backup Unit Example
    

    Using getBackupUnit

    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 getBackupUnit(args: GetBackupUnitArgs, opts?: InvokeOptions): Promise<GetBackupUnitResult>
    function getBackupUnitOutput(args: GetBackupUnitOutputArgs, opts?: InvokeOptions): Output<GetBackupUnitResult>
    def get_backup_unit(id: Optional[str] = None,
                        name: Optional[str] = None,
                        timeouts: Optional[GetBackupUnitTimeouts] = None,
                        opts: Optional[InvokeOptions] = None) -> GetBackupUnitResult
    def get_backup_unit_output(id: Optional[pulumi.Input[str]] = None,
                        name: Optional[pulumi.Input[str]] = None,
                        timeouts: Optional[pulumi.Input[GetBackupUnitTimeoutsArgs]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetBackupUnitResult]
    func LookupBackupUnit(ctx *Context, args *LookupBackupUnitArgs, opts ...InvokeOption) (*LookupBackupUnitResult, error)
    func LookupBackupUnitOutput(ctx *Context, args *LookupBackupUnitOutputArgs, opts ...InvokeOption) LookupBackupUnitResultOutput

    > Note: This function is named LookupBackupUnit in the Go SDK.

    public static class GetBackupUnit 
    {
        public static Task<GetBackupUnitResult> InvokeAsync(GetBackupUnitArgs args, InvokeOptions? opts = null)
        public static Output<GetBackupUnitResult> Invoke(GetBackupUnitInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBackupUnitResult> getBackupUnit(GetBackupUnitArgs args, InvokeOptions options)
    public static Output<GetBackupUnitResult> getBackupUnit(GetBackupUnitArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getBackupUnit:getBackupUnit
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    Name string
    Name of an existing backup unit that you want to search for.
    Timeouts GetBackupUnitTimeouts
    Id string

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    Name string
    Name of an existing backup unit that you want to search for.
    Timeouts GetBackupUnitTimeouts
    id String

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    name String
    Name of an existing backup unit that you want to search for.
    timeouts GetBackupUnitTimeouts
    id string

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    name string
    Name of an existing backup unit that you want to search for.
    timeouts GetBackupUnitTimeouts
    id str

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    name str
    Name of an existing backup unit that you want to search for.
    timeouts GetBackupUnitTimeouts
    id String

    ID of the backup unit you want to search for.

    Either name or id must be provided. If none, or both are provided, the datasource will return an error.

    name String
    Name of an existing backup unit that you want to search for.
    timeouts Property Map

    getBackupUnit Result

    The following output properties are available:

    Email string
    The e-mail address you want assigned to the backup unit.
    Id string
    The id of the Backup Unit.
    Login string
    The login associated with the backup unit. Derived from the contract number.
    Name string
    The name of the Backup Unit.
    Timeouts GetBackupUnitTimeouts
    Email string
    The e-mail address you want assigned to the backup unit.
    Id string
    The id of the Backup Unit.
    Login string
    The login associated with the backup unit. Derived from the contract number.
    Name string
    The name of the Backup Unit.
    Timeouts GetBackupUnitTimeouts
    email String
    The e-mail address you want assigned to the backup unit.
    id String
    The id of the Backup Unit.
    login String
    The login associated with the backup unit. Derived from the contract number.
    name String
    The name of the Backup Unit.
    timeouts GetBackupUnitTimeouts
    email string
    The e-mail address you want assigned to the backup unit.
    id string
    The id of the Backup Unit.
    login string
    The login associated with the backup unit. Derived from the contract number.
    name string
    The name of the Backup Unit.
    timeouts GetBackupUnitTimeouts
    email str
    The e-mail address you want assigned to the backup unit.
    id str
    The id of the Backup Unit.
    login str
    The login associated with the backup unit. Derived from the contract number.
    name str
    The name of the Backup Unit.
    timeouts GetBackupUnitTimeouts
    email String
    The e-mail address you want assigned to the backup unit.
    id String
    The id of the Backup Unit.
    login String
    The login associated with the backup unit. Derived from the contract number.
    name String
    The name of the Backup Unit.
    timeouts Property Map

    Supporting Types

    GetBackupUnitTimeouts

    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