1. Packages
  2. Exoscale
  3. API Docs
  4. getTemplate
Exoscale v0.62.7 published on Tuesday, Dec 10, 2024 by Pulumiverse

exoscale.getTemplate

Explore with Pulumi AI

Exoscale v0.62.7 published on Tuesday, Dec 10, 2024 by Pulumiverse

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as exoscale from "@pulumi/exoscale";

const myTemplate = exoscale.getTemplate({
    zone: "ch-gva-2",
    name: "Linux Ubuntu 22.04 LTS 64-bit",
});
export const myTemplateId = myTemplate.then(myTemplate => myTemplate.id);
Copy
import pulumi
import pulumi_exoscale as exoscale

my_template = exoscale.get_template(zone="ch-gva-2",
    name="Linux Ubuntu 22.04 LTS 64-bit")
pulumi.export("myTemplateId", my_template.id)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-exoscale/sdk/go/exoscale"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myTemplate, err := exoscale.GetTemplate(ctx, &exoscale.GetTemplateArgs{
			Zone: "ch-gva-2",
			Name: pulumi.StringRef("Linux Ubuntu 22.04 LTS 64-bit"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("myTemplateId", myTemplate.Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Exoscale = Pulumi.Exoscale;

return await Deployment.RunAsync(() => 
{
    var myTemplate = Exoscale.GetTemplate.Invoke(new()
    {
        Zone = "ch-gva-2",
        Name = "Linux Ubuntu 22.04 LTS 64-bit",
    });

    return new Dictionary<string, object?>
    {
        ["myTemplateId"] = myTemplate.Apply(getTemplateResult => getTemplateResult.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.exoscale.ExoscaleFunctions;
import com.pulumi.exoscale.inputs.GetTemplateArgs;
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 myTemplate = ExoscaleFunctions.getTemplate(GetTemplateArgs.builder()
            .zone("ch-gva-2")
            .name("Linux Ubuntu 22.04 LTS 64-bit")
            .build());

        ctx.export("myTemplateId", myTemplate.applyValue(getTemplateResult -> getTemplateResult.id()));
    }
}
Copy
variables:
  myTemplate:
    fn::invoke:
      function: exoscale:getTemplate
      arguments:
        zone: ch-gva-2
        name: Linux Ubuntu 22.04 LTS 64-bit
outputs:
  myTemplateId: ${myTemplate.id}
Copy

Please refer to the examples directory for complete configuration examples.

Using getTemplate

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 getTemplate(args: GetTemplateArgs, opts?: InvokeOptions): Promise<GetTemplateResult>
function getTemplateOutput(args: GetTemplateOutputArgs, opts?: InvokeOptions): Output<GetTemplateResult>
Copy
def get_template(id: Optional[str] = None,
                 name: Optional[str] = None,
                 visibility: Optional[str] = None,
                 zone: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetTemplateResult
def get_template_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 visibility: Optional[pulumi.Input[str]] = None,
                 zone: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetTemplateResult]
Copy
func GetTemplate(ctx *Context, args *GetTemplateArgs, opts ...InvokeOption) (*GetTemplateResult, error)
func GetTemplateOutput(ctx *Context, args *GetTemplateOutputArgs, opts ...InvokeOption) GetTemplateResultOutput
Copy

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

public static class GetTemplate 
{
    public static Task<GetTemplateResult> InvokeAsync(GetTemplateArgs args, InvokeOptions? opts = null)
    public static Output<GetTemplateResult> Invoke(GetTemplateInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
public static Output<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: exoscale:index/getTemplate:getTemplate
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Zone This property is required. string
The Exoscale Zone name.
Id string
The compute instance template ID to match (conflicts with name).
Name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
Visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
Zone This property is required. string
The Exoscale Zone name.
Id string
The compute instance template ID to match (conflicts with name).
Name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
Visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
zone This property is required. String
The Exoscale Zone name.
id String
The compute instance template ID to match (conflicts with name).
name String
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility String
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
zone This property is required. string
The Exoscale Zone name.
id string
The compute instance template ID to match (conflicts with name).
name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
zone This property is required. str
The Exoscale Zone name.
id str
The compute instance template ID to match (conflicts with name).
name str
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility str
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
zone This property is required. String
The Exoscale Zone name.
id String
The compute instance template ID to match (conflicts with name).
name String
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility String
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization

getTemplate Result

The following output properties are available:

DefaultUser string
Username to use to log into a compute instance based on this template
Zone string
The Exoscale Zone name.
Id string
The compute instance template ID to match (conflicts with name).
Name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
Visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
DefaultUser string
Username to use to log into a compute instance based on this template
Zone string
The Exoscale Zone name.
Id string
The compute instance template ID to match (conflicts with name).
Name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
Visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
defaultUser String
Username to use to log into a compute instance based on this template
zone String
The Exoscale Zone name.
id String
The compute instance template ID to match (conflicts with name).
name String
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility String
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
defaultUser string
Username to use to log into a compute instance based on this template
zone string
The Exoscale Zone name.
id string
The compute instance template ID to match (conflicts with name).
name string
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility string
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
default_user str
Username to use to log into a compute instance based on this template
zone str
The Exoscale Zone name.
id str
The compute instance template ID to match (conflicts with name).
name str
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility str
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization
defaultUser String
Username to use to log into a compute instance based on this template
zone String
The Exoscale Zone name.
id String
The compute instance template ID to match (conflicts with name).
name String
The template name to match (conflicts with id) (when multiple templates have the same name, the newest one will be returned).
visibility String
A template category filter (default: public); among: - public - official Exoscale templates - private - custom templates private to my organization

Package Details

Repository
exoscale pulumiverse/pulumi-exoscale
License
Apache-2.0
Notes
This Pulumi package is based on the exoscale Terraform Provider.
Exoscale v0.62.7 published on Tuesday, Dec 10, 2024 by Pulumiverse