Template

class Template : KotlinCustomResource

Provides a OOS Template resource. For information about Alicloud OOS Template and how to use it, see What is Resource Alicloud OOS Template.

NOTE: Available since v1.92.0.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const _default = new random.index.Integer("default", {
min: 10000,
max: 99999,
});
const example = new alicloud.oos.Template("example", {
content: ` {
"FormatVersion": "OOS-2019-06-01",
"Description": "Update Describe instances of given status",
"Parameters":{
"Status":{
"Type": "String",
"Description": "(Required) The status of the Ecs instance."
}
},
"Tasks": [
{
"Properties" :{
"Parameters":{
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Name": "foo",
"Action": "ACS::ExecuteApi"
}]
}
`,
templateName: `tf-example-name-${_default.result}`,
versionName: "example",
tags: {
Created: "TF",
For: "acceptance Test",
},
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
default = random.index.Integer("default",
min=10000,
max=99999)
example = alicloud.oos.Template("example",
content=""" {
"FormatVersion": "OOS-2019-06-01",
"Description": "Update Describe instances of given status",
"Parameters":{
"Status":{
"Type": "String",
"Description": "(Required) The status of the Ecs instance."
}
},
"Tasks": [
{
"Properties" :{
"Parameters":{
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Name": "foo",
"Action": "ACS::ExecuteApi"
}]
}
""",
template_name=f"tf-example-name-{default['result']}",
version_name="example",
tags={
"Created": "TF",
"For": "acceptance Test",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var @default = new Random.Index.Integer("default", new()
{
Min = 10000,
Max = 99999,
});
var example = new AliCloud.Oos.Template("example", new()
{
Content = @" {
""FormatVersion"": ""OOS-2019-06-01"",
""Description"": ""Update Describe instances of given status"",
""Parameters"":{
""Status"":{
""Type"": ""String"",
""Description"": ""(Required) The status of the Ecs instance.""
}
},
""Tasks"": [
{
""Properties"" :{
""Parameters"":{
""Status"": ""{{ Status }}""
},
""API"": ""DescribeInstances"",
""Service"": ""Ecs""
},
""Name"": ""foo"",
""Action"": ""ACS::ExecuteApi""
}]
}
",
TemplateName = $"tf-example-name-{@default.Result}",
VersionName = "example",
Tags =
{
{ "Created", "TF" },
{ "For", "acceptance Test" },
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Min: 10000,
Max: 99999,
})
if err != nil {
return err
}
_, err = oos.NewTemplate(ctx, "example", &oos.TemplateArgs{
Content: pulumi.String(` {
"FormatVersion": "OOS-2019-06-01",
"Description": "Update Describe instances of given status",
"Parameters":{
"Status":{
"Type": "String",
"Description": "(Required) The status of the Ecs instance."
}
},
"Tasks": [
{
"Properties" :{
"Parameters":{
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Name": "foo",
"Action": "ACS::ExecuteApi"
}]
}
`),
TemplateName: pulumi.Sprintf("tf-example-name-%v", _default.Result),
VersionName: pulumi.String("example"),
Tags: pulumi.StringMap{
"Created": pulumi.String("TF"),
"For": pulumi.String("acceptance Test"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.integerArgs;
import com.pulumi.alicloud.oos.Template;
import com.pulumi.alicloud.oos.TemplateArgs;
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) {
var default_ = new Integer("default", IntegerArgs.builder()
.min(10000)
.max(99999)
.build());
var example = new Template("example", TemplateArgs.builder()
.content("""
{
"FormatVersion": "OOS-2019-06-01",
"Description": "Update Describe instances of given status",
"Parameters":{
"Status":{
"Type": "String",
"Description": "(Required) The status of the Ecs instance."
}
},
"Tasks": [
{
"Properties" :{
"Parameters":{
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Name": "foo",
"Action": "ACS::ExecuteApi"
}]
}
""")
.templateName(String.format("tf-example-name-%s", default_.result()))
.versionName("example")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "acceptance Test")
))
.build());
}
}
resources:
default:
type: random:integer
properties:
min: 10000
max: 99999
example:
type: alicloud:oos:Template
properties:
content: |2
{
"FormatVersion": "OOS-2019-06-01",
"Description": "Update Describe instances of given status",
"Parameters":{
"Status":{
"Type": "String",
"Description": "(Required) The status of the Ecs instance."
}
},
"Tasks": [
{
"Properties" :{
"Parameters":{
"Status": "{{ Status }}"
},
"API": "DescribeInstances",
"Service": "Ecs"
},
"Name": "foo",
"Action": "ACS::ExecuteApi"
}]
}
templateName: tf-example-name-${default.result}
versionName: example
tags:
Created: TF
For: acceptance Test

Import

OOS Template can be imported using the id or template_name, e.g.

$ pulumi import alicloud:oos/template:Template example template_name

Properties

Link copied to clipboard

When deleting a template, whether to delete its related executions. Default to false.

Link copied to clipboard
val content: Output<String>

The content of the template. The template must be in the JSON or YAML format. Maximum size: 64 KB.

Link copied to clipboard
val createdBy: Output<String>

The creator of the template.

Link copied to clipboard
val createdDate: Output<String>

The time when the template is created.

Link copied to clipboard
val description: Output<String>

The description of the template.

Link copied to clipboard
val hasTrigger: Output<Boolean>

Is it triggered successfully.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>

The ID of resource group which the template belongs.

Link copied to clipboard
val shareType: Output<String>

The sharing type of the template. The sharing type of templates created by users are set to Private. The sharing type of common templates provided by OOS are set to Public.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val templateFormat: Output<String>

The format of the template. The format can be JSON or YAML. The system automatically identifies the format.

Link copied to clipboard
val templateId: Output<String>

The id of OOS Template.

Link copied to clipboard
val templateName: Output<String>

The name of the template. The template name can be up to 200 characters in length. The name can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.

Link copied to clipboard
val templateType: Output<String>

The type of OOS Template. Automation means the implementation of Alibaba Cloud API template, Package means represents a template for installing software.

Link copied to clipboard
val templateVersion: Output<String>

The version of OOS Template.

Link copied to clipboard
val updatedBy: Output<String>

The user who updated the template.

Link copied to clipboard
val updatedDate: Output<String>

The time when the template was updated.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val versionName: Output<String>?

The name of template version.