Exoscale v0.56.0 published on Sunday, Mar 3, 2024 by Pulumiverse
exoscale.getTemplate
Explore with Pulumi AI
Fetch Exoscale Compute Instance Templates data.
Example Usage
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 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
})
}
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()));
}
}
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)
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);
variables:
myTemplate:
fn::invoke:
Function: exoscale:getTemplate
Arguments:
zone: ch-gva-2
name: Linux Ubuntu 22.04 LTS 64-bit
outputs:
myTemplateId: ${myTemplate.id}
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:
- Default
User 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 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 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 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
- default
User 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.