Alibaba Cloud v3.62.1 published on Monday, Sep 16, 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 dictionary
The following arguments are supported:
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of Template IDs.
- Name
Regex string - A regex string to filter results by Template name.
- Output
File 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can be empty. Format example{"key1":"value1"}
. - Template
Name 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 totrue
can output more details about resource attributes. - Ids []string
- A list of Template IDs.
- Name
Regex string - A regex string to filter results by Template name.
- Output
File 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can be empty. Format example{"key1":"value1"}
. - Template
Name 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 Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Template IDs.
- name
Regex String - A regex string to filter results by Template name.
- output
File 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can be empty. Format example{"key1":"value1"}
. - template
Name 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 boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of Template IDs.
- name
Regex string - A regex string to filter results by Template name.
- output
File 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can be empty. Format example{"key1":"value1"}
. - template
Name 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 totrue
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 - 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can 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.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of Template IDs.
- name
Regex String - A regex string to filter results by Template name.
- output
File 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
json
string, includingTagKey
andTagValue
.TagKey
cannot be null, andTagValue
can be empty. Format example{"key1":"value1"}
. - template
Name 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> - Enable
Details bool - Name
Regex string - Output
File string - string
- Dictionary<string, string>
- Template
Name string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Templates
[]Get
Templates Template - Enable
Details bool - Name
Regex string - Output
File string - string
- map[string]string
- Template
Name string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- templates
List<Get
Templates Template> - enable
Details Boolean - name
Regex String - output
File String - String
- Map<String,String>
- template
Name String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- templates
Get
Templates Template[] - enable
Details boolean - name
Regex string - output
File string - string
- {[key: string]: string}
- template
Name string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- templates
Sequence[Get
Templates 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>
- enable
Details Boolean - name
Regex String - output
File String - String
- Map<String>
- template
Name String
Supporting Types
GetTemplatesTemplate
- Change
Set 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.
- Stack
Group 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.
- Stack
Id string - The ID of the stack.
- Dictionary<string, string>
- Tags.
- Template
Body 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.
- Template
Id string - The ID of the template.
- Template
Name 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.
- Template
Version string - Template Version.
- Change
Set 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.
- Stack
Group 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.
- Stack
Id string - The ID of the stack.
- map[string]string
- Tags.
- Template
Body 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.
- Template
Id string - The ID of the template.
- Template
Name 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.
- Template
Version string - Template Version.
- change
Set 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.
- stack
Group 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.
- stack
Id String - The ID of the stack.
- Map<String,String>
- Tags.
- template
Body 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.
- template
Id String - The ID of the template.
- template
Name 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.
- template
Version String - Template Version.
- change
Set 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.
- stack
Group 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.
- stack
Id string - The ID of the stack.
- {[key: string]: string}
- Tags.
- template
Body 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.
- template
Id string - The ID of the template.
- template
Name 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.
- template
Version 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.
- change
Set 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.
- stack
Group 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.
- stack
Id String - The ID of the stack.
- Map<String>
- Tags.
- template
Body 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.
- template
Id String - The ID of the template.
- template
Name 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.
- template
Version String - Template Version.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.