1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. log
  5. Resource
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.log.Resource

Explore with Pulumi AI

Log resource is a meta store service provided by log service, resource can be used to define meta store’s table structure.

For information about SLS Resource and how to use it, see Resource management

NOTE: Available since v1.162.0. log resource region should be set a main region: cn-heyuan.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.log.Resource("example", {
    type: "userdefine",
    name: "user.tf.resource",
    description: "user tf resource desc",
    extInfo: "{}",
    schema: `    {
      "schema": [
        {
          "column": "col1",
          "desc": "col1   desc",
          "ext_info": {
          },
          "required": true,
          "type": "string"
        },
        {
          "column": "col2",
          "desc": "col2   desc",
          "ext_info": "optional",
          "required": true,
          "type": "string"
        }
      ]
    }
`,
});
Copy
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.log.Resource("example",
    type="userdefine",
    name="user.tf.resource",
    description="user tf resource desc",
    ext_info="{}",
    schema="""    {
      "schema": [
        {
          "column": "col1",
          "desc": "col1   desc",
          "ext_info": {
          },
          "required": true,
          "type": "string"
        },
        {
          "column": "col2",
          "desc": "col2   desc",
          "ext_info": "optional",
          "required": true,
          "type": "string"
        }
      ]
    }
""")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := log.NewResource(ctx, "example", &log.ResourceArgs{
			Type:        pulumi.String("userdefine"),
			Name:        pulumi.String("user.tf.resource"),
			Description: pulumi.String("user tf resource desc"),
			ExtInfo:     pulumi.String("{}"),
			Schema: pulumi.String(`    {
      "schema": [
        {
          "column": "col1",
          "desc": "col1   desc",
          "ext_info": {
          },
          "required": true,
          "type": "string"
        },
        {
          "column": "col2",
          "desc": "col2   desc",
          "ext_info": "optional",
          "required": true,
          "type": "string"
        }
      ]
    }
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = new AliCloud.Log.Resource("example", new()
    {
        Type = "userdefine",
        Name = "user.tf.resource",
        Description = "user tf resource desc",
        ExtInfo = "{}",
        Schema = @"    {
      ""schema"": [
        {
          ""column"": ""col1"",
          ""desc"": ""col1   desc"",
          ""ext_info"": {
          },
          ""required"": true,
          ""type"": ""string""
        },
        {
          ""column"": ""col2"",
          ""desc"": ""col2   desc"",
          ""ext_info"": ""optional"",
          ""required"": true,
          ""type"": ""string""
        }
      ]
    }
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.log.Resource;
import com.pulumi.alicloud.log.ResourceArgs;
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 Resource("example", ResourceArgs.builder()
            .type("userdefine")
            .name("user.tf.resource")
            .description("user tf resource desc")
            .extInfo("{}")
            .schema("""
    {
      "schema": [
        {
          "column": "col1",
          "desc": "col1   desc",
          "ext_info": {
          },
          "required": true,
          "type": "string"
        },
        {
          "column": "col2",
          "desc": "col2   desc",
          "ext_info": "optional",
          "required": true,
          "type": "string"
        }
      ]
    }
            """)
            .build());

    }
}
Copy
resources:
  example:
    type: alicloud:log:Resource
    properties:
      type: userdefine
      name: user.tf.resource
      description: user tf resource desc
      extInfo: '{}'
      schema: |2
            {
              "schema": [
                {
                  "column": "col1",
                  "desc": "col1   desc",
                  "ext_info": {
                  },
                  "required": true,
                  "type": "string"
                },
                {
                  "column": "col2",
                  "desc": "col2   desc",
                  "ext_info": "optional",
                  "required": true,
                  "type": "string"
                }
              ]
            }
Copy

Create Resource Resource

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

Constructor syntax

new Resource(name: string, args: ResourceArgs, opts?: CustomResourceOptions);
@overload
def Resource(resource_name: str,
             args: ResourceArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def Resource(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             schema: Optional[str] = None,
             type: Optional[str] = None,
             description: Optional[str] = None,
             ext_info: Optional[str] = None,
             name: Optional[str] = None)
func NewResource(ctx *Context, name string, args ResourceArgs, opts ...ResourceOption) (*Resource, error)
public Resource(string name, ResourceArgs args, CustomResourceOptions? opts = null)
public Resource(String name, ResourceArgs args)
public Resource(String name, ResourceArgs args, CustomResourceOptions options)
type: alicloud:log:Resource
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ResourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ResourceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ResourceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ResourceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ResourceArgs
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 alicloudResourceResource = new AliCloud.Log.Resource("alicloudResourceResource", new()
{
    Schema = "string",
    Type = "string",
    Description = "string",
    ExtInfo = "string",
    Name = "string",
});
Copy
example, err := log.NewResource(ctx, "alicloudResourceResource", &log.ResourceArgs{
	Schema:      pulumi.String("string"),
	Type:        pulumi.String("string"),
	Description: pulumi.String("string"),
	ExtInfo:     pulumi.String("string"),
	Name:        pulumi.String("string"),
})
Copy
var alicloudResourceResource = new Resource("alicloudResourceResource", ResourceArgs.builder()
    .schema("string")
    .type("string")
    .description("string")
    .extInfo("string")
    .name("string")
    .build());
Copy
alicloud_resource_resource = alicloud.log.Resource("alicloudResourceResource",
    schema="string",
    type="string",
    description="string",
    ext_info="string",
    name="string")
Copy
const alicloudResourceResource = new alicloud.log.Resource("alicloudResourceResource", {
    schema: "string",
    type: "string",
    description: "string",
    extInfo: "string",
    name: "string",
});
Copy
type: alicloud:log:Resource
properties:
    description: string
    extInfo: string
    name: string
    schema: string
    type: string
Copy

Resource Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Resource resource accepts the following input properties:

Schema This property is required. string
The meta store's schema info, which is json string format, used to define table's fields.
Type This property is required. string
The meta store's type, userdefine e.g.
Description string
The meta store's description.
ExtInfo string
The ext info of meta store.
Name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
Schema This property is required. string
The meta store's schema info, which is json string format, used to define table's fields.
Type This property is required. string
The meta store's type, userdefine e.g.
Description string
The meta store's description.
ExtInfo string
The ext info of meta store.
Name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
schema This property is required. String
The meta store's schema info, which is json string format, used to define table's fields.
type This property is required. String
The meta store's type, userdefine e.g.
description String
The meta store's description.
extInfo String
The ext info of meta store.
name Changes to this property will trigger replacement. String
The meta store's name, can be used as table name.
schema This property is required. string
The meta store's schema info, which is json string format, used to define table's fields.
type This property is required. string
The meta store's type, userdefine e.g.
description string
The meta store's description.
extInfo string
The ext info of meta store.
name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
schema This property is required. str
The meta store's schema info, which is json string format, used to define table's fields.
type This property is required. str
The meta store's type, userdefine e.g.
description str
The meta store's description.
ext_info str
The ext info of meta store.
name Changes to this property will trigger replacement. str
The meta store's name, can be used as table name.
schema This property is required. String
The meta store's schema info, which is json string format, used to define table's fields.
type This property is required. String
The meta store's type, userdefine e.g.
description String
The meta store's description.
extInfo String
The ext info of meta store.
name Changes to this property will trigger replacement. String
The meta store's name, can be used as table name.

Outputs

All input properties are implicitly available as output properties. Additionally, the Resource 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 Resource Resource

Get an existing Resource 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?: ResourceState, opts?: CustomResourceOptions): Resource
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        ext_info: Optional[str] = None,
        name: Optional[str] = None,
        schema: Optional[str] = None,
        type: Optional[str] = None) -> Resource
func GetResource(ctx *Context, name string, id IDInput, state *ResourceState, opts ...ResourceOption) (*Resource, error)
public static Resource Get(string name, Input<string> id, ResourceState? state, CustomResourceOptions? opts = null)
public static Resource get(String name, Output<String> id, ResourceState state, CustomResourceOptions options)
resources:  _:    type: alicloud:log:Resource    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 meta store's description.
ExtInfo string
The ext info of meta store.
Name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
Schema string
The meta store's schema info, which is json string format, used to define table's fields.
Type string
The meta store's type, userdefine e.g.
Description string
The meta store's description.
ExtInfo string
The ext info of meta store.
Name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
Schema string
The meta store's schema info, which is json string format, used to define table's fields.
Type string
The meta store's type, userdefine e.g.
description String
The meta store's description.
extInfo String
The ext info of meta store.
name Changes to this property will trigger replacement. String
The meta store's name, can be used as table name.
schema String
The meta store's schema info, which is json string format, used to define table's fields.
type String
The meta store's type, userdefine e.g.
description string
The meta store's description.
extInfo string
The ext info of meta store.
name Changes to this property will trigger replacement. string
The meta store's name, can be used as table name.
schema string
The meta store's schema info, which is json string format, used to define table's fields.
type string
The meta store's type, userdefine e.g.
description str
The meta store's description.
ext_info str
The ext info of meta store.
name Changes to this property will trigger replacement. str
The meta store's name, can be used as table name.
schema str
The meta store's schema info, which is json string format, used to define table's fields.
type str
The meta store's type, userdefine e.g.
description String
The meta store's description.
extInfo String
The ext info of meta store.
name Changes to this property will trigger replacement. String
The meta store's name, can be used as table name.
schema String
The meta store's schema info, which is json string format, used to define table's fields.
type String
The meta store's type, userdefine e.g.

Import

Log resource can be imported using the id, e.g.

$ pulumi import alicloud:log/resource:Resource example <id>
Copy

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.