Provides a SLS Project resource.
For information about SLS Project and how to use it, see What is Project.
Basic Usage
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_log_project" "example" {
name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
tags = {
Created = "TF",
For = "example",
}
}
Project With Policy Usage
resource "random_integer" "default" {
max = 99999
min = 10000
}
resource "alicloud_log_project" "example_policy" {
name = "terraform-example-${random_integer.default.result}"
description = "terraform-example"
policy = <<EOF
{
"Statement": [
{
"Action": [
"log:PostLogStoreLogs"
],
"Condition": {
"StringNotLike": {
"acs:SourceVpc": [
"vpc-*"
]
}
},
"Effect": "Deny",
"Resource": "acs:log:*:*:project/tf-log/*"
}
],
"Version": "1"
}
EOF
}
You can use the existing sls module to create SLS project, store and store index one-click, like ECS instances.
The following arguments are supported:
policy
- (Optional, Available since v1.197.0) Log project policy, used to set a policy for a project.description
- (Optional) Description.project_name
- (Optional, ForceNew, Available since v1.212.0) The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
resource_group_id
- (Optional, Computed, Available since v1.212.0) The ID of the resource group.tags
- (Optional, Map) Tag.The following arguments will be discarded. Please use new fields as soon as possible:
name
- (Deprecated since v1.223.0). Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.The following attributes are exported:
id
- The ID of the resource supplied above.create_time
- CreateTime.status
- The status of the resource.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Project.delete
- (Defaults to 5 mins) Used when delete the Project.update
- (Defaults to 5 mins) Used when update the Project.SLS Project can be imported using the id, e.g.
$ terraform import alicloud_log_project.example <id>