1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ros
  5. Template
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.ros.Template

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a ROS Template resource.

    For information about ROS Template and how to use it, see What is Template.

    NOTE: Available in v1.108.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.ros.Template("example", {
        templateName: "example_value",
        templateBody: `    {
        \x09"ROSTemplateFormatVersion": "2015-09-01"
        }
    `,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ros.Template("example",
        template_name="example_value",
        template_body="""    {
        \x09"ROSTemplateFormatVersion": "2015-09-01"
        }
    """)
    
    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 {
    		_, err := ros.NewTemplate(ctx, "example", &ros.TemplateArgs{
    			TemplateName: pulumi.String("example_value"),
    			TemplateBody: pulumi.String("    {\n    	\"ROSTemplateFormatVersion\": \"2015-09-01\"\n    }\n"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Ros.Template("example", new()
        {
            TemplateName = "example_value",
            TemplateBody = @"    {
        	""ROSTemplateFormatVersion"": ""2015-09-01""
        }
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ros.Template;
    import com.pulumi.alicloud.ros.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 example = new Template("example", TemplateArgs.builder()
                .templateName("example_value")
                .templateBody("""
        {
        	"ROSTemplateFormatVersion": "2015-09-01"
        }
                """)
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:ros:Template
        properties:
          templateName: example_value
          templateBody: |2
                {
                	"ROSTemplateFormatVersion": "2015-09-01"
                }
    

    Create Template Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Template(name: string, args: TemplateArgs, opts?: CustomResourceOptions);
    @overload
    def Template(resource_name: str,
                 args: TemplateArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Template(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 template_name: Optional[str] = None,
                 description: Optional[str] = None,
                 tags: Optional[Mapping[str, Any]] = None,
                 template_body: Optional[str] = None,
                 template_url: Optional[str] = None)
    func NewTemplate(ctx *Context, name string, args TemplateArgs, opts ...ResourceOption) (*Template, error)
    public Template(string name, TemplateArgs args, CustomResourceOptions? opts = null)
    public Template(String name, TemplateArgs args)
    public Template(String name, TemplateArgs args, CustomResourceOptions options)
    
    type: alicloud:ros:Template
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TemplateArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alicloudTemplateResource = new AliCloud.Ros.Template("alicloudTemplateResource", new()
    {
        TemplateName = "string",
        Description = "string",
        Tags = 
        {
            { "string", "any" },
        },
        TemplateBody = "string",
        TemplateUrl = "string",
    });
    
    example, err := ros.NewTemplate(ctx, "alicloudTemplateResource", &ros.TemplateArgs{
    	TemplateName: pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	TemplateBody: pulumi.String("string"),
    	TemplateUrl:  pulumi.String("string"),
    })
    
    var alicloudTemplateResource = new Template("alicloudTemplateResource", TemplateArgs.builder()
        .templateName("string")
        .description("string")
        .tags(Map.of("string", "any"))
        .templateBody("string")
        .templateUrl("string")
        .build());
    
    alicloud_template_resource = alicloud.ros.Template("alicloudTemplateResource",
        template_name="string",
        description="string",
        tags={
            "string": "any",
        },
        template_body="string",
        template_url="string")
    
    const alicloudTemplateResource = new alicloud.ros.Template("alicloudTemplateResource", {
        templateName: "string",
        description: "string",
        tags: {
            string: "any",
        },
        templateBody: "string",
        templateUrl: "string",
    });
    
    type: alicloud:ros:Template
    properties:
        description: string
        tags:
            string: any
        templateBody: string
        templateName: string
        templateUrl: string
    

    Template Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Template resource accepts the following input properties:

    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.
    Description string
    The description of the template. The description can be up to 256 characters in length.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    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.
    TemplateUrl string
    The template url.
    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.
    Description string
    The description of the template. The description can be up to 256 characters in length.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    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.
    TemplateUrl string
    The template url.
    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.
    description String
    The description of the template. The description can be up to 256 characters in length.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    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.
    templateUrl String
    The template url.
    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.
    description string
    The description of the template. The description can be up to 256 characters in length.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    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.
    templateUrl string
    The template url.
    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.
    description str
    The description of the template. The description can be up to 256 characters in length.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    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_url str
    The template url.
    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.
    description String
    The description of the template. The description can be up to 256 characters in length.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    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.
    templateUrl String
    The template url.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Template resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Template Resource

    Get an existing Template resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: TemplateState, opts?: CustomResourceOptions): Template
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None,
            template_body: Optional[str] = None,
            template_name: Optional[str] = None,
            template_url: Optional[str] = None) -> Template
    func GetTemplate(ctx *Context, name string, id IDInput, state *TemplateState, opts ...ResourceOption) (*Template, error)
    public static Template Get(string name, Input<string> id, TemplateState? state, CustomResourceOptions? opts = null)
    public static Template get(String name, Output<String> id, TemplateState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    The description of the template. The description can be up to 256 characters in length.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    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.
    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.
    TemplateUrl string
    The template url.
    Description string
    The description of the template. The description can be up to 256 characters in length.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    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.
    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.
    TemplateUrl string
    The template url.
    description String
    The description of the template. The description can be up to 256 characters in length.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    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.
    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.
    templateUrl String
    The template url.
    description string
    The description of the template. The description can be up to 256 characters in length.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    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.
    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.
    templateUrl string
    The template url.
    description str
    The description of the template. The description can be up to 256 characters in length.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    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_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_url str
    The template url.
    description String
    The description of the template. The description can be up to 256 characters in length.
    tags Map<Any>
    A mapping of tags to assign to the resource.
    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.
    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.
    templateUrl String
    The template url.

    Import

    ROS Template can be imported using the id, e.g.

    $ pulumi import alicloud:ros/template:Template example <template_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi