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

alicloud.log.ResourceRecord

Explore with Pulumi AI

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

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

    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"
            }
          ]
        }
    `,
    });
    const exampleResourceRecord = new alicloud.log.ResourceRecord("example", {
        resourceName: example.id,
        recordId: "user_tf_resource_1",
        tag: "resource tag",
        value: `    {
          "col1": "this is col1 value",
          "col2": "col2   value"
        }
    `,
    });
    
    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"
            }
          ]
        }
    """)
    example_resource_record = alicloud.log.ResourceRecord("example",
        resource_name_=example.id,
        record_id="user_tf_resource_1",
        tag="resource tag",
        value="""    {
          "col1": "this is col1 value",
          "col2": "col2   value"
        }
    """)
    
    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 {
    		example, 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
    		}
    		_, err = log.NewResourceRecord(ctx, "example", &log.ResourceRecordArgs{
    			ResourceName: example.ID(),
    			RecordId:     pulumi.String("user_tf_resource_1"),
    			Tag:          pulumi.String("resource tag"),
    			Value:        pulumi.String("    {\n      \"col1\": \"this is col1 value\",\n      \"col2\": \"col2   value\"\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.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""
            }
          ]
        }
    ",
        });
    
        var exampleResourceRecord = new AliCloud.Log.ResourceRecord("example", new()
        {
            ResourceName = example.Id,
            RecordId = "user_tf_resource_1",
            Tag = "resource tag",
            Value = @"    {
          ""col1"": ""this is col1 value"",
          ""col2"": ""col2   value""
        }
    ",
        });
    
    });
    
    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 com.pulumi.alicloud.log.ResourceRecord;
    import com.pulumi.alicloud.log.ResourceRecordArgs;
    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());
    
            var exampleResourceRecord = new ResourceRecord("exampleResourceRecord", ResourceRecordArgs.builder()
                .resourceName(example.id())
                .recordId("user_tf_resource_1")
                .tag("resource tag")
                .value("""
        {
          "col1": "this is col1 value",
          "col2": "col2   value"
        }
                """)
                .build());
    
        }
    }
    
    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"
                    }
                  ]
                }
      exampleResourceRecord:
        type: alicloud:log:ResourceRecord
        name: example
        properties:
          resourceName: ${example.id}
          recordId: user_tf_resource_1
          tag: resource tag
          value: |2
                {
                  "col1": "this is col1 value",
                  "col2": "col2   value"
                }
    

    Create ResourceRecord Resource

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

    Constructor syntax

    new ResourceRecord(name: string, args: ResourceRecordArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceRecord(resource_name: str,
                       args: ResourceRecordArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceRecord(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       record_id: Optional[str] = None,
                       resource_name_: Optional[str] = None,
                       tag: Optional[str] = None,
                       value: Optional[str] = None)
    func NewResourceRecord(ctx *Context, name string, args ResourceRecordArgs, opts ...ResourceOption) (*ResourceRecord, error)
    public ResourceRecord(string name, ResourceRecordArgs args, CustomResourceOptions? opts = null)
    public ResourceRecord(String name, ResourceRecordArgs args)
    public ResourceRecord(String name, ResourceRecordArgs args, CustomResourceOptions options)
    
    type: alicloud:log:ResourceRecord
    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 ResourceRecordArgs
    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 ResourceRecordArgs
    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 ResourceRecordArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceRecordArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceRecordArgs
    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 resourceRecordResource = new AliCloud.Log.ResourceRecord("resourceRecordResource", new()
    {
        RecordId = "string",
        ResourceName = "string",
        Tag = "string",
        Value = "string",
    });
    
    example, err := log.NewResourceRecord(ctx, "resourceRecordResource", &log.ResourceRecordArgs{
    	RecordId:     pulumi.String("string"),
    	ResourceName: pulumi.String("string"),
    	Tag:          pulumi.String("string"),
    	Value:        pulumi.String("string"),
    })
    
    var resourceRecordResource = new ResourceRecord("resourceRecordResource", ResourceRecordArgs.builder()
        .recordId("string")
        .resourceName("string")
        .tag("string")
        .value("string")
        .build());
    
    resource_record_resource = alicloud.log.ResourceRecord("resourceRecordResource",
        record_id="string",
        resource_name_="string",
        tag="string",
        value="string")
    
    const resourceRecordResource = new alicloud.log.ResourceRecord("resourceRecordResource", {
        recordId: "string",
        resourceName: "string",
        tag: "string",
        value: "string",
    });
    
    type: alicloud:log:ResourceRecord
    properties:
        recordId: string
        resourceName: string
        tag: string
        value: string
    

    ResourceRecord 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 ResourceRecord resource accepts the following input properties:

    RecordId string
    The record's id, should be unique.
    ResourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    Tag string
    The record's tag, can be used for search.
    Value string
    The json value of record.
    RecordId string
    The record's id, should be unique.
    ResourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    Tag string
    The record's tag, can be used for search.
    Value string
    The json value of record.
    recordId String
    The record's id, should be unique.
    resourceName String
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag String
    The record's tag, can be used for search.
    value String
    The json value of record.
    recordId string
    The record's id, should be unique.
    resourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag string
    The record's tag, can be used for search.
    value string
    The json value of record.
    record_id str
    The record's id, should be unique.
    resource_name str
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag str
    The record's tag, can be used for search.
    value str
    The json value of record.
    recordId String
    The record's id, should be unique.
    resourceName String
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag String
    The record's tag, can be used for search.
    value String
    The json value of record.

    Outputs

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

    Get an existing ResourceRecord 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?: ResourceRecordState, opts?: CustomResourceOptions): ResourceRecord
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            record_id: Optional[str] = None,
            resource_name: Optional[str] = None,
            tag: Optional[str] = None,
            value: Optional[str] = None) -> ResourceRecord
    func GetResourceRecord(ctx *Context, name string, id IDInput, state *ResourceRecordState, opts ...ResourceOption) (*ResourceRecord, error)
    public static ResourceRecord Get(string name, Input<string> id, ResourceRecordState? state, CustomResourceOptions? opts = null)
    public static ResourceRecord get(String name, Output<String> id, ResourceRecordState 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:
    RecordId string
    The record's id, should be unique.
    ResourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    Tag string
    The record's tag, can be used for search.
    Value string
    The json value of record.
    RecordId string
    The record's id, should be unique.
    ResourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    Tag string
    The record's tag, can be used for search.
    Value string
    The json value of record.
    recordId String
    The record's id, should be unique.
    resourceName String
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag String
    The record's tag, can be used for search.
    value String
    The json value of record.
    recordId string
    The record's id, should be unique.
    resourceName string
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag string
    The record's tag, can be used for search.
    value string
    The json value of record.
    record_id str
    The record's id, should be unique.
    resource_name str
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag str
    The record's tag, can be used for search.
    value str
    The json value of record.
    recordId String
    The record's id, should be unique.
    resourceName String
    The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group.
    tag String
    The record's tag, can be used for search.
    value String
    The json value of record.

    Import

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

    $ pulumi import alicloud:log/resourceRecord:ResourceRecord example <resource_name>:<record_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