Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.ros.getTemplates
Explore with Pulumi AI
This data source provides the Ros Templates of the current Alibaba Cloud user.
NOTE: Available in v1.108.0+.
Example Usage
Basic Usage
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);
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)
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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var example = AliCloud.Ros.GetTemplates.Invoke(new()
    {
        Ids = new[]
        {
            "example_value",
        },
        NameRegex = "the_resource_name",
    });
    return new Dictionary<string, object?>
    {
        ["firstRosTemplateId"] = example.Apply(getTemplatesResult => getTemplatesResult.Templates[0]?.Id),
    };
});
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.ros.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()));
    }
}
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, str]] = 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, pulumi.Input[str]]]] = 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 dictionaryThe following arguments are supported:
- EnableDetails bool
- Default to false. Set it totruecan 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
- File name where to save data source results (after running pulumi preview).
- string
- Share Type. Valid Values: Private,Shared
- Dictionary<string, string>
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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 totruecan 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
- File name where to save data source results (after running pulumi preview).
- string
- Share Type. Valid Values: Private,Shared
- map[string]string
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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 totruecan 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
- File name where to save data source results (after running pulumi preview).
- String
- Share Type. Valid Values: Private,Shared
- Map<String,String>
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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 totruecan 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
- File name where to save data source results (after running pulumi preview).
- string
- Share Type. Valid Values: Private,Shared
- {[key: string]: string}
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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 totruecan 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
- File name where to save data source results (after running pulumi preview).
- str
- Share Type. Valid Values: Private,Shared
- Mapping[str, str]
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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 totruecan 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
- File name where to save data source results (after running pulumi preview).
- String
- Share Type. Valid Values: Private,Shared
- Map<String>
- Query the resource bound to the tag. The format of the incoming value is jsonstring, includingTagKeyandTagValue.TagKeycannot be null, andTagValuecan be empty. Format example{"key1":"value1"}.
- 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.Ali Cloud. Ros. Outputs. Get Templates Template> 
- EnableDetails bool
- NameRegex string
- OutputFile string
- string
- Dictionary<string, string>
- TemplateName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Templates
[]GetTemplates Template 
- EnableDetails bool
- NameRegex string
- OutputFile string
- string
- map[string]string
- TemplateName string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- templates
List<GetTemplates Template> 
- enableDetails Boolean
- nameRegex String
- outputFile String
- String
- Map<String,String>
- templateName String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- templates
GetTemplates Template[] 
- enableDetails boolean
- nameRegex string
- outputFile string
- string
- {[key: string]: string}
- templateName string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- templates
Sequence[GetTemplates Template] 
- enable_details bool
- name_regex str
- output_file str
- str
- Mapping[str, str]
- 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
- String
- Map<String>
- templateName String
Supporting Types
GetTemplatesTemplate  
- ChangeSet stringId 
- 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.
- string
- Share Type.
- StackGroup stringName 
- 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.
- Dictionary<string, string>
- 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.
- ChangeSet stringId 
- 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.
- string
- Share Type.
- StackGroup stringName 
- 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.
- map[string]string
- 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.
- changeSet StringId 
- 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.
- String
- Share Type.
- stackGroup StringName 
- 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.
- Map<String,String>
- 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.
- changeSet stringId 
- 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.
- string
- Share Type.
- stackGroup stringName 
- 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.
- {[key: string]: string}
- 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_ strid 
- 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.
- str
- Share Type.
- stack_group_ strname 
- 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.
- Mapping[str, str]
- 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.
- changeSet StringId 
- 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.
- String
- Share Type.
- stackGroup StringName 
- 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.
- Map<String>
- 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
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.