1. Packages
  2. UpCloud
  3. API Docs
  4. StorageTemplate
UpCloud v0.1.0 published on Friday, Mar 14, 2025 by UpCloudLtd

upcloud.StorageTemplate

Explore with Pulumi AI

Manages UpCloud storage templates. The storage templates are stored in the system as storages with template type.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as upcloud from "@upcloud/pulumi-upcloud";

const template = new upcloud.StorageTemplate("template", {
    sourceStorage: "e0328f8a-9944-406b-99c3-656dcc03e671",
    title: "custom-storage-template",
    labels: {
        os: "linux",
        usage: "example",
    },
});
Copy
import pulumi
import pulumi_upcloud as upcloud

template = upcloud.StorageTemplate("template",
    source_storage="e0328f8a-9944-406b-99c3-656dcc03e671",
    title="custom-storage-template",
    labels={
        "os": "linux",
        "usage": "example",
    })
Copy
package main

import (
	"github.com/UpCloudLtd/pulumi-upcloud/sdk/go/upcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := upcloud.NewStorageTemplate(ctx, "template", &upcloud.StorageTemplateArgs{
			SourceStorage: pulumi.String("e0328f8a-9944-406b-99c3-656dcc03e671"),
			Title:         pulumi.String("custom-storage-template"),
			Labels: pulumi.StringMap{
				"os":    pulumi.String("linux"),
				"usage": pulumi.String("example"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using UpCloud = UpCloud.Pulumi.UpCloud;

return await Deployment.RunAsync(() => 
{
    var template = new UpCloud.StorageTemplate("template", new()
    {
        SourceStorage = "e0328f8a-9944-406b-99c3-656dcc03e671",
        Title = "custom-storage-template",
        Labels = 
        {
            { "os", "linux" },
            { "usage", "example" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.upcloud.StorageTemplate;
import com.pulumi.upcloud.StorageTemplateArgs;
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) {
        var template = new StorageTemplate("template", StorageTemplateArgs.builder()
            .sourceStorage("e0328f8a-9944-406b-99c3-656dcc03e671")
            .title("custom-storage-template")
            .labels(Map.ofEntries(
                Map.entry("os", "linux"),
                Map.entry("usage", "example")
            ))
            .build());

    }
}
Copy
resources:
  template:
    type: upcloud:StorageTemplate
    properties:
      sourceStorage: e0328f8a-9944-406b-99c3-656dcc03e671
      title: custom-storage-template
      labels:
        os: linux
        usage: example
Copy

Create StorageTemplate Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new StorageTemplate(name: string, args: StorageTemplateArgs, opts?: CustomResourceOptions);
@overload
def StorageTemplate(resource_name: str,
                    args: StorageTemplateArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def StorageTemplate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    source_storage: Optional[str] = None,
                    title: Optional[str] = None,
                    labels: Optional[Mapping[str, str]] = None)
func NewStorageTemplate(ctx *Context, name string, args StorageTemplateArgs, opts ...ResourceOption) (*StorageTemplate, error)
public StorageTemplate(string name, StorageTemplateArgs args, CustomResourceOptions? opts = null)
public StorageTemplate(String name, StorageTemplateArgs args)
public StorageTemplate(String name, StorageTemplateArgs args, CustomResourceOptions options)
type: upcloud:StorageTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. StorageTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. StorageTemplateArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. StorageTemplateArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. StorageTemplateArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. StorageTemplateArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var storageTemplateResource = new UpCloud.StorageTemplate("storageTemplateResource", new()
{
    SourceStorage = "string",
    Title = "string",
    Labels = 
    {
        { "string", "string" },
    },
});
Copy
example, err := upcloud.NewStorageTemplate(ctx, "storageTemplateResource", &upcloud.StorageTemplateArgs{
	SourceStorage: pulumi.String("string"),
	Title:         pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
})
Copy
var storageTemplateResource = new StorageTemplate("storageTemplateResource", StorageTemplateArgs.builder()
    .sourceStorage("string")
    .title("string")
    .labels(Map.of("string", "string"))
    .build());
Copy
storage_template_resource = upcloud.StorageTemplate("storageTemplateResource",
    source_storage="string",
    title="string",
    labels={
        "string": "string",
    })
Copy
const storageTemplateResource = new upcloud.StorageTemplate("storageTemplateResource", {
    sourceStorage: "string",
    title: "string",
    labels: {
        string: "string",
    },
});
Copy
type: upcloud:StorageTemplate
properties:
    labels:
        string: string
    sourceStorage: string
    title: string
Copy

StorageTemplate Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The StorageTemplate resource accepts the following input properties:

SourceStorage This property is required. string
The source storage that is used as a base for this storage template.
Title This property is required. string
The title of the storage.
Labels Dictionary<string, string>
User defined key-value pairs to classify the storage.
SourceStorage This property is required. string
The source storage that is used as a base for this storage template.
Title This property is required. string
The title of the storage.
Labels map[string]string
User defined key-value pairs to classify the storage.
sourceStorage This property is required. String
The source storage that is used as a base for this storage template.
title This property is required. String
The title of the storage.
labels Map<String,String>
User defined key-value pairs to classify the storage.
sourceStorage This property is required. string
The source storage that is used as a base for this storage template.
title This property is required. string
The title of the storage.
labels {[key: string]: string}
User defined key-value pairs to classify the storage.
source_storage This property is required. str
The source storage that is used as a base for this storage template.
title This property is required. str
The title of the storage.
labels Mapping[str, str]
User defined key-value pairs to classify the storage.
sourceStorage This property is required. String
The source storage that is used as a base for this storage template.
title This property is required. String
The title of the storage.
labels Map<String>
User defined key-value pairs to classify the storage.

Outputs

All input properties are implicitly available as output properties. Additionally, the StorageTemplate resource produces the following output properties:

Encrypt bool
Sets if the storage is encrypted at rest.
Id string
The provider-assigned unique ID for this managed resource.
Size int
The size of the storage in gigabytes.
SystemLabels Dictionary<string, string>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
Tier string
The tier of the storage.
Type string
The type of the storage.
Zone string
The zone the storage is in, e.g. de-fra1.
Encrypt bool
Sets if the storage is encrypted at rest.
Id string
The provider-assigned unique ID for this managed resource.
Size int
The size of the storage in gigabytes.
SystemLabels map[string]string
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
Tier string
The tier of the storage.
Type string
The type of the storage.
Zone string
The zone the storage is in, e.g. de-fra1.
encrypt Boolean
Sets if the storage is encrypted at rest.
id String
The provider-assigned unique ID for this managed resource.
size Integer
The size of the storage in gigabytes.
systemLabels Map<String,String>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier String
The tier of the storage.
type String
The type of the storage.
zone String
The zone the storage is in, e.g. de-fra1.
encrypt boolean
Sets if the storage is encrypted at rest.
id string
The provider-assigned unique ID for this managed resource.
size number
The size of the storage in gigabytes.
systemLabels {[key: string]: string}
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier string
The tier of the storage.
type string
The type of the storage.
zone string
The zone the storage is in, e.g. de-fra1.
encrypt bool
Sets if the storage is encrypted at rest.
id str
The provider-assigned unique ID for this managed resource.
size int
The size of the storage in gigabytes.
system_labels Mapping[str, str]
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier str
The tier of the storage.
type str
The type of the storage.
zone str
The zone the storage is in, e.g. de-fra1.
encrypt Boolean
Sets if the storage is encrypted at rest.
id String
The provider-assigned unique ID for this managed resource.
size Number
The size of the storage in gigabytes.
systemLabels Map<String>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier String
The tier of the storage.
type String
The type of the storage.
zone String
The zone the storage is in, e.g. de-fra1.

Look up Existing StorageTemplate Resource

Get an existing StorageTemplate resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: StorageTemplateState, opts?: CustomResourceOptions): StorageTemplate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        encrypt: Optional[bool] = None,
        labels: Optional[Mapping[str, str]] = None,
        size: Optional[int] = None,
        source_storage: Optional[str] = None,
        system_labels: Optional[Mapping[str, str]] = None,
        tier: Optional[str] = None,
        title: Optional[str] = None,
        type: Optional[str] = None,
        zone: Optional[str] = None) -> StorageTemplate
func GetStorageTemplate(ctx *Context, name string, id IDInput, state *StorageTemplateState, opts ...ResourceOption) (*StorageTemplate, error)
public static StorageTemplate Get(string name, Input<string> id, StorageTemplateState? state, CustomResourceOptions? opts = null)
public static StorageTemplate get(String name, Output<String> id, StorageTemplateState state, CustomResourceOptions options)
resources:  _:    type: upcloud:StorageTemplate    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Encrypt bool
Sets if the storage is encrypted at rest.
Labels Dictionary<string, string>
User defined key-value pairs to classify the storage.
Size int
The size of the storage in gigabytes.
SourceStorage string
The source storage that is used as a base for this storage template.
SystemLabels Dictionary<string, string>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
Tier string
The tier of the storage.
Title string
The title of the storage.
Type string
The type of the storage.
Zone string
The zone the storage is in, e.g. de-fra1.
Encrypt bool
Sets if the storage is encrypted at rest.
Labels map[string]string
User defined key-value pairs to classify the storage.
Size int
The size of the storage in gigabytes.
SourceStorage string
The source storage that is used as a base for this storage template.
SystemLabels map[string]string
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
Tier string
The tier of the storage.
Title string
The title of the storage.
Type string
The type of the storage.
Zone string
The zone the storage is in, e.g. de-fra1.
encrypt Boolean
Sets if the storage is encrypted at rest.
labels Map<String,String>
User defined key-value pairs to classify the storage.
size Integer
The size of the storage in gigabytes.
sourceStorage String
The source storage that is used as a base for this storage template.
systemLabels Map<String,String>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier String
The tier of the storage.
title String
The title of the storage.
type String
The type of the storage.
zone String
The zone the storage is in, e.g. de-fra1.
encrypt boolean
Sets if the storage is encrypted at rest.
labels {[key: string]: string}
User defined key-value pairs to classify the storage.
size number
The size of the storage in gigabytes.
sourceStorage string
The source storage that is used as a base for this storage template.
systemLabels {[key: string]: string}
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier string
The tier of the storage.
title string
The title of the storage.
type string
The type of the storage.
zone string
The zone the storage is in, e.g. de-fra1.
encrypt bool
Sets if the storage is encrypted at rest.
labels Mapping[str, str]
User defined key-value pairs to classify the storage.
size int
The size of the storage in gigabytes.
source_storage str
The source storage that is used as a base for this storage template.
system_labels Mapping[str, str]
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier str
The tier of the storage.
title str
The title of the storage.
type str
The type of the storage.
zone str
The zone the storage is in, e.g. de-fra1.
encrypt Boolean
Sets if the storage is encrypted at rest.
labels Map<String>
User defined key-value pairs to classify the storage.
size Number
The size of the storage in gigabytes.
sourceStorage String
The source storage that is used as a base for this storage template.
systemLabels Map<String>
System defined key-value pairs to classify the storage. The keys of system defined labels are prefixed with underscore and can not be modified by the user.
tier String
The tier of the storage.
title String
The title of the storage.
type String
The type of the storage.
zone String
The zone the storage is in, e.g. de-fra1.

Package Details

Repository
upcloud UpCloudLtd/pulumi-upcloud
License
Apache-2.0
Notes
This Pulumi package is based on the upcloud Terraform Provider.