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
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
}
{
"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
}
The following arguments are supported:
name
- (Required, ForceNew) The meta store's name, can be used as table name.type
- (Required) The meta store's type, userdefine e.g.description
- (Optional) The meta store's description.schema
- (Required) The meta store's schema info, which is json string format, used to define table's fields.ext_info
- (Optional) The ext info of meta store.The following attributes are exported:
id
- The ID of the resource. It formats of <name>
.Log resource can be imported using the id, e.g.
$ terraform import alicloud_log_resource_record.example <id>