1. Packages
  2. Exoscale
  3. API Docs
  4. getTemplate
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

exoscale.getTemplate

Explore with Pulumi AI

exoscale logo
Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse

    Fetch Exoscale Compute Instance Templates data.

    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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    variables:
      myTemplate:
        fn::invoke:
          Function: exoscale:getTemplate
          Arguments:
            zone: ch-gva-2
            name: Linux Ubuntu 22.04 LTS 64-bit
    outputs:
      myTemplateId: ${myTemplate.id}
    

    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>
    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]
    func GetTemplate(ctx *Context, args *GetTemplateArgs, opts ...InvokeOption) (*GetTemplateResult, error)
    func GetTemplateOutput(ctx *Context, args *GetTemplateOutputArgs, opts ...InvokeOption) GetTemplateResultOutput

    > 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)
    }
    public static CompletableFuture<GetTemplateResult> getTemplate(GetTemplateArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: exoscale:index/getTemplate:getTemplate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    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
    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
    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
    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
    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
    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

    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 logo
    Exoscale v0.59.2 published on Monday, Jul 22, 2024 by Pulumiverse