Skip to content

Latest commit

 

History

History
103 lines (84 loc) · 3.25 KB

log_resource_record.html.markdown

File metadata and controls

103 lines (84 loc) · 3.25 KB
subcategory layout page_title sidebar_current description
Log Service (SLS)
alicloud
Alicloud: alicloud_log_resource_record
docs-alicloud-resource-log-resource-record
Provides a Alicloud log resource record.

alicloud_log_resource_record

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

provider "alicloud" {
  region = "cn-heyuan"
}

resource "alicloud_log_resource" "example" {
  type        = "userdefine"
  name        = "user.tf.resource"
  description = "user tf resource desc"
  ext_info    = "{}"
  schema      = <<EOF
    {
      "schema": [
        {
          "column": "col1",
          "desc": "col1   desc",
          "ext_info": {
          },
          "required": true,
          "type": "string"
        },
        {
          "column": "col2",
          "desc": "col2   desc",
          "ext_info": "optional",
          "required": true,
          "type": "string"
        }
      ]
    }
  EOF
}

resource "alicloud_log_resource_record" "example" {
  resource_name = alicloud_log_resource.example.id
  record_id     = "tf_user_example"
  tag           = "tf example"
  value         = <<EOF
{
  "user_name": "tf example",
  "sms_enabled": true,
  "phone": "18888888889",
  "voice_enabled": false,
  "email": [
    "[email protected]"
  ],
  "enabled": true,
  "user_id": "tf_user",
  "country_code": "86"
}
EOF
}

Argument Reference

The following arguments are supported:

  • resource_name - (Required) The name defined in log_resource, log service have some internal resource, like sls.common.user, sls.common.user_group. More detail see Resource Data Structure.
  • record_id - (Required, ForceNew) The record's id, should be unique.
  • tag - (Required) The record's tag, can be used for search.
  • value - (Required) The json value of record. More detail see Resource Data Structure.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource record. It formats of <resource_name>:<record_id>.

Import

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

$ terraform import alicloud_log_resource_record.example <resource_name>:<record_id>