TemplateArgs

data class TemplateArgs(val autoDeleteExecutions: Output<Boolean>? = null, val content: Output<String>? = null, val resourceGroupId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val templateName: Output<String>? = null, val versionName: Output<String>? = null) : ConvertibleToJava<TemplateArgs>

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

Constructors

Link copied to clipboard
constructor(autoDeleteExecutions: Output<Boolean>? = null, content: Output<String>? = null, resourceGroupId: Output<String>? = null, tags: Output<Map<String, String>>? = null, templateName: Output<String>? = null, versionName: Output<String>? = null)

Properties

Link copied to clipboard
val autoDeleteExecutions: Output<Boolean>? = null

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

Link copied to clipboard
val content: Output<String>? = null

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

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The ID of resource group which the template belongs.

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

A mapping of tags to assign to the resource.

Link copied to clipboard
val templateName: Output<String>? = null

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 versionName: Output<String>? = null

The name of template version.

Functions

Link copied to clipboard
open override fun toJava(): TemplateArgs