Template
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
When deleting a template, whether to delete its related executions. Default to false
.
The time when the template is created.
The description of the template.
Is it triggered successfully.
The ID of resource group which the template belongs.
The format of the template. The format can be JSON or YAML. The system automatically identifies the format.
The id of OOS Template.
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
.
The type of OOS Template. Automation
means the implementation of Alibaba Cloud API template, Package
means represents a template for installing software.
The version of OOS Template.
The time when the template was updated.
The name of template version.