Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getTemplates

This data source provides the Ros Templates of the current Alibaba Cloud user.

NOTE: Available in v1.108.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Ros.GetTemplates.InvokeAsync(new AliCloud.Ros.GetTemplatesArgs
        {
            Ids = 
            {
                "example_value",
            },
            NameRegex = "the_resource_name",
        }));
        this.FirstRosTemplateId = example.Apply(example => example.Templates?[0]?.Id);
    }

    [Output("firstRosTemplateId")]
    public Output<string> FirstRosTemplateId { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ros"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := ros.GetTemplates(ctx, &ros.GetTemplatesArgs{
			Ids: []string{
				"example_value",
			},
			NameRegex: pulumi.StringRef("the_resource_name"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstRosTemplateId", example.Templates[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ros.RosFunctions;
import com.pulumi.alicloud.oos.inputs.GetTemplatesArgs;
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 = RosFunctions.getTemplates(GetTemplatesArgs.builder()
            .ids("example_value")
            .nameRegex("the_resource_name")
            .build());

        ctx.export("firstRosTemplateId", example.applyValue(getTemplatesResult -> getTemplatesResult.templates()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.ros.get_templates(ids=["example_value"],
    name_regex="the_resource_name")
pulumi.export("firstRosTemplateId", example.templates[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.ros.getTemplates({
    ids: ["example_value"],
    nameRegex: "the_resource_name",
});
export const firstRosTemplateId = example.then(example => example.templates?[0]?.id);
variables:
  example:
    Fn::Invoke:
      Function: alicloud:ros:getTemplates
      Arguments:
        ids:
          - example_value
        nameRegex: the_resource_name
outputs:
  firstRosTemplateId: ${example.templates[0].id}

Using getTemplates

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 getTemplates(args: GetTemplatesArgs, opts?: InvokeOptions): Promise<GetTemplatesResult>
function getTemplatesOutput(args: GetTemplatesOutputArgs, opts?: InvokeOptions): Output<GetTemplatesResult>
def get_templates(enable_details: Optional[bool] = None,
                  ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  share_type: Optional[str] = None,
                  tags: Optional[Mapping[str, Any]] = None,
                  template_name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetTemplatesResult
def get_templates_output(enable_details: Optional[pulumi.Input[bool]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  share_type: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                  template_name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetTemplatesResult]
func GetTemplates(ctx *Context, args *GetTemplatesArgs, opts ...InvokeOption) (*GetTemplatesResult, error)
func GetTemplatesOutput(ctx *Context, args *GetTemplatesOutputArgs, opts ...InvokeOption) GetTemplatesResultOutput

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

public static class GetTemplates 
{
    public static Task<GetTemplatesResult> InvokeAsync(GetTemplatesArgs args, InvokeOptions? opts = null)
    public static Output<GetTemplatesResult> Invoke(GetTemplatesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTemplatesResult> getTemplates(GetTemplatesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:ros/getTemplates:getTemplates
  arguments:
    # arguments dictionary

The following arguments are supported:

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

Ids List<string>

A list of Template IDs.

NameRegex string

A regex string to filter results by Template name.

OutputFile string
ShareType string

Share Type.

Tags Dictionary<string, object>

Tags.

TemplateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

Ids []string

A list of Template IDs.

NameRegex string

A regex string to filter results by Template name.

OutputFile string
ShareType string

Share Type.

Tags map[string]interface{}

Tags.

TemplateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

ids List<String>

A list of Template IDs.

nameRegex String

A regex string to filter results by Template name.

outputFile String
shareType String

Share Type.

tags Map<String,Object>

Tags.

templateName String

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

enableDetails boolean

Default to false. Set it to true can output more details about resource attributes.

ids string[]

A list of Template IDs.

nameRegex string

A regex string to filter results by Template name.

outputFile string
shareType string

Share Type.

tags {[key: string]: any}

Tags.

templateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

enable_details bool

Default to false. Set it to true can output more details about resource attributes.

ids Sequence[str]

A list of Template IDs.

name_regex str

A regex string to filter results by Template name.

output_file str
share_type str

Share Type.

tags Mapping[str, Any]

Tags.

template_name str

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

ids List<String>

A list of Template IDs.

nameRegex String

A regex string to filter results by Template name.

outputFile String
shareType String

Share Type.

tags Map<Any>

Tags.

templateName String

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

getTemplates Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
Templates List<Pulumi.AliCloud.Ros.Outputs.GetTemplatesTemplate>
EnableDetails bool
NameRegex string
OutputFile string
ShareType string
Tags Dictionary<string, object>
TemplateName string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Templates []GetTemplatesTemplate
EnableDetails bool
NameRegex string
OutputFile string
ShareType string
Tags map[string]interface{}
TemplateName string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
templates List<GetTemplatesTemplate>
enableDetails Boolean
nameRegex String
outputFile String
shareType String
tags Map<String,Object>
templateName String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
templates GetTemplatesTemplate[]
enableDetails boolean
nameRegex string
outputFile string
shareType string
tags {[key: string]: any}
templateName string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
templates Sequence[GetTemplatesTemplate]
enable_details bool
name_regex str
output_file str
share_type str
tags Mapping[str, Any]
template_name str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
templates List<Property Map>
enableDetails Boolean
nameRegex String
outputFile String
shareType String
tags Map<Any>
templateName String

Supporting Types

GetTemplatesTemplate

ChangeSetId string

The ID of the change set.

Description string

The description of the template. The description can be up to 256 characters in length.

Id string

The ID of the Template.

ShareType string

Share Type.

StackGroupName string

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

StackId string

The ID of the stack.

Tags Dictionary<string, object>

Tags.

TemplateBody string

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

TemplateId string

The ID of the template.

TemplateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

TemplateVersion string

Template Version.

ChangeSetId string

The ID of the change set.

Description string

The description of the template. The description can be up to 256 characters in length.

Id string

The ID of the Template.

ShareType string

Share Type.

StackGroupName string

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

StackId string

The ID of the stack.

Tags map[string]interface{}

Tags.

TemplateBody string

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

TemplateId string

The ID of the template.

TemplateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

TemplateVersion string

Template Version.

changeSetId String

The ID of the change set.

description String

The description of the template. The description can be up to 256 characters in length.

id String

The ID of the Template.

shareType String

Share Type.

stackGroupName String

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

stackId String

The ID of the stack.

tags Map<String,Object>

Tags.

templateBody String

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

templateId String

The ID of the template.

templateName String

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

templateVersion String

Template Version.

changeSetId string

The ID of the change set.

description string

The description of the template. The description can be up to 256 characters in length.

id string

The ID of the Template.

shareType string

Share Type.

stackGroupName string

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

stackId string

The ID of the stack.

tags {[key: string]: any}

Tags.

templateBody string

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

templateId string

The ID of the template.

templateName string

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

templateVersion string

Template Version.

change_set_id str

The ID of the change set.

description str

The description of the template. The description can be up to 256 characters in length.

id str

The ID of the Template.

share_type str

Share Type.

stack_group_name str

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

stack_id str

The ID of the stack.

tags Mapping[str, Any]

Tags.

template_body str

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

template_id str

The ID of the template.

template_name str

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

template_version str

Template Version.

changeSetId String

The ID of the change set.

description String

The description of the template. The description can be up to 256 characters in length.

id String

The ID of the Template.

shareType String

Share Type.

stackGroupName String

The name of the stack group. The name must be unique in a region. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

stackId String

The ID of the stack.

tags Map<Any>

Tags.

templateBody String

The structure that contains the template body. The template body must be 1 to 524,288 bytes in length. If the length of the template body is longer than required, we recommend that you add parameters to the HTTP POST request body to avoid request failures due to excessive length of URLs. You must specify one of the TemplateBody and TemplateURL parameters, but you cannot specify both of them.

templateId String

The ID of the template.

templateName String

The name of the template. The name can be up to 255 characters in length and can contain digits, letters, hyphens (-), and underscores (_). It must start with a digit or letter.

templateVersion String

Template Version.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.