Provides a Threat Detection Oss Scan Config resource. Oss detection configuration.
For information about Threat Detection Oss Scan Config and how to use it, see What is Oss Scan Config.
Basic Usage
variable "name" {
default = "terraform-example"
}
resource "random_integer" "default" {
min = 10000
max = 99999
}
locals {
bucket_random = random_integer.default.result
}
resource "alicloud_oss_bucket" "default8j4t1R" {
bucket = "${var.name}-1-${local.bucket_random}"
storage_class = "Standard"
}
resource "alicloud_oss_bucket" "default9HMqfT" {
bucket = "${var.name}-2-${local.bucket_random}"
storage_class = "Standard"
}
resource "alicloud_oss_bucket" "defaultxBXqFQ" {
bucket = "${var.name}-3-${local.bucket_random}"
storage_class = "Standard"
}
resource "alicloud_oss_bucket" "defaulthZvCmR" {
bucket = "${var.name}-4-${local.bucket_random}"
storage_class = "Standard"
}
resource "alicloud_threat_detection_oss_scan_config" "default" {
key_suffix_list = [
".jsp",
".php",
".k"
]
scan_day_list = [
"2",
"5",
"4",
"3"
]
oss_scan_config_name = var.name
end_time = "00:00:02"
start_time = "00:00:01"
enable = "1"
all_key_prefix = "false"
bucket_name_list = [
alicloud_oss_bucket.default8j4t1R.bucket,
alicloud_oss_bucket.default9HMqfT.bucket,
alicloud_oss_bucket.defaultxBXqFQ.bucket
]
key_prefix_list = [
"/root",
"/usr",
"/123"
]
}
The following arguments are supported:
all_key_prefix
- (Optional) Match all prefixes.bucket_name_list
- (Required) Bucket List.enable
- (Required) Enable configuration.end_time
- (Required) End time, hours, minutes and seconds.key_prefix_list
- (Optional) File prefix list.key_suffix_list
- (Required) File Suffix List.oss_scan_config_name
- (Optional) Configuration Name.scan_day_list
- (Required) Scan cycle.start_time
- (Required) Start time, hours, minutes and seconds.The following attributes are exported:
id
- The ID of the resource supplied above.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Oss Scan Config.delete
- (Defaults to 5 mins) Used when delete the Oss Scan Config.update
- (Defaults to 5 mins) Used when update the Oss Scan Config.Threat Detection Oss Scan Config can be imported using the id, e.g.
$ terraform import alicloud_threat_detection_oss_scan_config.example <id>