alicloud.threatdetection.CycleTask
Explore with Pulumi AI
Provides a Threat Detection Cycle Task resource.
Configure periodic tasks in Security Center.
For information about Threat Detection Cycle Task and how to use it, see What is Cycle Task.
NOTE: Available since v1.253.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.threatdetection.CycleTask("default", {
targetEndTime: 6,
taskType: "VIRUS_VUL_SCHEDULE_SCAN",
targetStartTime: 0,
source: "console_batch",
taskName: "VIRUS_VUL_SCHEDULE_SCAN",
firstDateStr: 1650556800000,
periodUnit: "day",
intervalPeriod: 7,
param: JSON.stringify({
targetInfo: [
{
type: "groupId",
name: "TI HOST",
target: 10597,
},
{
type: "groupId",
name: "expense HOST",
target: 10597,
},
],
}),
enable: 1,
});
import pulumi
import json
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.threatdetection.CycleTask("default",
target_end_time=6,
task_type="VIRUS_VUL_SCHEDULE_SCAN",
target_start_time=0,
source="console_batch",
task_name="VIRUS_VUL_SCHEDULE_SCAN",
first_date_str=1650556800000,
period_unit="day",
interval_period=7,
param=json.dumps({
"targetInfo": [
{
"type": "groupId",
"name": "TI HOST",
"target": 10597,
},
{
"type": "groupId",
"name": "expense HOST",
"target": 10597,
},
],
}),
enable=1)
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/threatdetection"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"targetInfo": []map[string]interface{}{
map[string]interface{}{
"type": "groupId",
"name": "TI HOST",
"target": 10597,
},
map[string]interface{}{
"type": "groupId",
"name": "expense HOST",
"target": 10597,
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = threatdetection.NewCycleTask(ctx, "default", &threatdetection.CycleTaskArgs{
TargetEndTime: pulumi.Int(6),
TaskType: pulumi.String("VIRUS_VUL_SCHEDULE_SCAN"),
TargetStartTime: pulumi.Int(0),
Source: pulumi.String("console_batch"),
TaskName: pulumi.String("VIRUS_VUL_SCHEDULE_SCAN"),
FirstDateStr: pulumi.Int(1650556800000),
PeriodUnit: pulumi.String("day"),
IntervalPeriod: pulumi.Int(7),
Param: pulumi.String(json0),
Enable: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.ThreatDetection.CycleTask("default", new()
{
TargetEndTime = 6,
TaskType = "VIRUS_VUL_SCHEDULE_SCAN",
TargetStartTime = 0,
Source = "console_batch",
TaskName = "VIRUS_VUL_SCHEDULE_SCAN",
FirstDateStr = 1650556800000,
PeriodUnit = "day",
IntervalPeriod = 7,
Param = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["targetInfo"] = new[]
{
new Dictionary<string, object?>
{
["type"] = "groupId",
["name"] = "TI HOST",
["target"] = 10597,
},
new Dictionary<string, object?>
{
["type"] = "groupId",
["name"] = "expense HOST",
["target"] = 10597,
},
},
}),
Enable = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.threatdetection.CycleTask;
import com.pulumi.alicloud.threatdetection.CycleTaskArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new CycleTask("default", CycleTaskArgs.builder()
.targetEndTime(6)
.taskType("VIRUS_VUL_SCHEDULE_SCAN")
.targetStartTime(0)
.source("console_batch")
.taskName("VIRUS_VUL_SCHEDULE_SCAN")
.firstDateStr(1650556800000)
.periodUnit("day")
.intervalPeriod(7)
.param(serializeJson(
jsonObject(
jsonProperty("targetInfo", jsonArray(
jsonObject(
jsonProperty("type", "groupId"),
jsonProperty("name", "TI HOST"),
jsonProperty("target", 10597)
),
jsonObject(
jsonProperty("type", "groupId"),
jsonProperty("name", "expense HOST"),
jsonProperty("target", 10597)
)
))
)))
.enable(1)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:threatdetection:CycleTask
properties:
targetEndTime: '6'
taskType: VIRUS_VUL_SCHEDULE_SCAN
targetStartTime: '0'
source: console_batch
taskName: VIRUS_VUL_SCHEDULE_SCAN
firstDateStr: '1650556800000'
periodUnit: day
intervalPeriod: '7'
param:
fn::toJSON:
targetInfo:
- type: groupId
name: TI HOST
target: 10597
- type: groupId
name: expense HOST
target: 10597
enable: '1'
Create CycleTask Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CycleTask(name: string, args: CycleTaskArgs, opts?: CustomResourceOptions);
@overload
def CycleTask(resource_name: str,
args: CycleTaskArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CycleTask(resource_name: str,
opts: Optional[ResourceOptions] = None,
enable: Optional[int] = None,
first_date_str: Optional[int] = None,
interval_period: Optional[int] = None,
period_unit: Optional[str] = None,
target_end_time: Optional[int] = None,
target_start_time: Optional[int] = None,
task_name: Optional[str] = None,
task_type: Optional[str] = None,
param: Optional[str] = None,
source: Optional[str] = None)
func NewCycleTask(ctx *Context, name string, args CycleTaskArgs, opts ...ResourceOption) (*CycleTask, error)
public CycleTask(string name, CycleTaskArgs args, CustomResourceOptions? opts = null)
public CycleTask(String name, CycleTaskArgs args)
public CycleTask(String name, CycleTaskArgs args, CustomResourceOptions options)
type: alicloud:threatdetection:CycleTask
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 CycleTaskArgs
- 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 CycleTaskArgs
- 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 CycleTaskArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CycleTaskArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CycleTaskArgs
- 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 cycleTaskResource = new AliCloud.ThreatDetection.CycleTask("cycleTaskResource", new()
{
Enable = 0,
FirstDateStr = 0,
IntervalPeriod = 0,
PeriodUnit = "string",
TargetEndTime = 0,
TargetStartTime = 0,
TaskName = "string",
TaskType = "string",
Param = "string",
Source = "string",
});
example, err := threatdetection.NewCycleTask(ctx, "cycleTaskResource", &threatdetection.CycleTaskArgs{
Enable: pulumi.Int(0),
FirstDateStr: pulumi.Int(0),
IntervalPeriod: pulumi.Int(0),
PeriodUnit: pulumi.String("string"),
TargetEndTime: pulumi.Int(0),
TargetStartTime: pulumi.Int(0),
TaskName: pulumi.String("string"),
TaskType: pulumi.String("string"),
Param: pulumi.String("string"),
Source: pulumi.String("string"),
})
var cycleTaskResource = new CycleTask("cycleTaskResource", CycleTaskArgs.builder()
.enable(0)
.firstDateStr(0)
.intervalPeriod(0)
.periodUnit("string")
.targetEndTime(0)
.targetStartTime(0)
.taskName("string")
.taskType("string")
.param("string")
.source("string")
.build());
cycle_task_resource = alicloud.threatdetection.CycleTask("cycleTaskResource",
enable=0,
first_date_str=0,
interval_period=0,
period_unit="string",
target_end_time=0,
target_start_time=0,
task_name="string",
task_type="string",
param="string",
source="string")
const cycleTaskResource = new alicloud.threatdetection.CycleTask("cycleTaskResource", {
enable: 0,
firstDateStr: 0,
intervalPeriod: 0,
periodUnit: "string",
targetEndTime: 0,
targetStartTime: 0,
taskName: "string",
taskType: "string",
param: "string",
source: "string",
});
type: alicloud:threatdetection:CycleTask
properties:
enable: 0
firstDateStr: 0
intervalPeriod: 0
param: string
periodUnit: string
source: string
targetEndTime: 0
targetStartTime: 0
taskName: string
taskType: string
CycleTask Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The CycleTask resource accepts the following input properties:
- Enable int
- Whether to enable. Value:
- First
Date intStr - First execution time.
- Interval
Period int - Interval period.
- Period
Unit string - Unit of scan cycle, value:
- Target
End intTime - Task end time (hours).
- Target
Start intTime - Task start time (hours).
- Task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Param string
- Extended information field.
- Source string
- Added the source of the task.
- Enable int
- Whether to enable. Value:
- First
Date intStr - First execution time.
- Interval
Period int - Interval period.
- Period
Unit string - Unit of scan cycle, value:
- Target
End intTime - Task end time (hours).
- Target
Start intTime - Task start time (hours).
- Task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Param string
- Extended information field.
- Source string
- Added the source of the task.
- enable Integer
- Whether to enable. Value:
- first
Date IntegerStr - First execution time.
- interval
Period Integer - Interval period.
- period
Unit String - Unit of scan cycle, value:
- target
End IntegerTime - Task end time (hours).
- target
Start IntegerTime - Task start time (hours).
- task
Name String - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type String - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- param String
- Extended information field.
- source String
- Added the source of the task.
- enable number
- Whether to enable. Value:
- first
Date numberStr - First execution time.
- interval
Period number - Interval period.
- period
Unit string - Unit of scan cycle, value:
- target
End numberTime - Task end time (hours).
- target
Start numberTime - Task start time (hours).
- task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- param string
- Extended information field.
- source string
- Added the source of the task.
- enable int
- Whether to enable. Value:
- first_
date_ intstr - First execution time.
- interval_
period int - Interval period.
- period_
unit str - Unit of scan cycle, value:
- target_
end_ inttime - Task end time (hours).
- target_
start_ inttime - Task start time (hours).
- task_
name str - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task_
type str - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- param str
- Extended information field.
- source str
- Added the source of the task.
- enable Number
- Whether to enable. Value:
- first
Date NumberStr - First execution time.
- interval
Period Number - Interval period.
- period
Unit String - Unit of scan cycle, value:
- target
End NumberTime - Task end time (hours).
- target
Start NumberTime - Task start time (hours).
- task
Name String - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type String - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- param String
- Extended information field.
- source String
- Added the source of the task.
Outputs
All input properties are implicitly available as output properties. Additionally, the CycleTask 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 CycleTask Resource
Get an existing CycleTask 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?: CycleTaskState, opts?: CustomResourceOptions): CycleTask
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
enable: Optional[int] = None,
first_date_str: Optional[int] = None,
interval_period: Optional[int] = None,
param: Optional[str] = None,
period_unit: Optional[str] = None,
source: Optional[str] = None,
target_end_time: Optional[int] = None,
target_start_time: Optional[int] = None,
task_name: Optional[str] = None,
task_type: Optional[str] = None) -> CycleTask
func GetCycleTask(ctx *Context, name string, id IDInput, state *CycleTaskState, opts ...ResourceOption) (*CycleTask, error)
public static CycleTask Get(string name, Input<string> id, CycleTaskState? state, CustomResourceOptions? opts = null)
public static CycleTask get(String name, Output<String> id, CycleTaskState state, CustomResourceOptions options)
resources: _: type: alicloud:threatdetection:CycleTask get: id: ${id}
- 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.
- Enable int
- Whether to enable. Value:
- First
Date intStr - First execution time.
- Interval
Period int - Interval period.
- Param string
- Extended information field.
- Period
Unit string - Unit of scan cycle, value:
- Source string
- Added the source of the task.
- Target
End intTime - Task end time (hours).
- Target
Start intTime - Task start time (hours).
- Task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Enable int
- Whether to enable. Value:
- First
Date intStr - First execution time.
- Interval
Period int - Interval period.
- Param string
- Extended information field.
- Period
Unit string - Unit of scan cycle, value:
- Source string
- Added the source of the task.
- Target
End intTime - Task end time (hours).
- Target
Start intTime - Task start time (hours).
- Task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- Task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- enable Integer
- Whether to enable. Value:
- first
Date IntegerStr - First execution time.
- interval
Period Integer - Interval period.
- param String
- Extended information field.
- period
Unit String - Unit of scan cycle, value:
- source String
- Added the source of the task.
- target
End IntegerTime - Task end time (hours).
- target
Start IntegerTime - Task start time (hours).
- task
Name String - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type String - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- enable number
- Whether to enable. Value:
- first
Date numberStr - First execution time.
- interval
Period number - Interval period.
- param string
- Extended information field.
- period
Unit string - Unit of scan cycle, value:
- source string
- Added the source of the task.
- target
End numberTime - Task end time (hours).
- target
Start numberTime - Task start time (hours).
- task
Name string - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type string - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- enable int
- Whether to enable. Value:
- first_
date_ intstr - First execution time.
- interval_
period int - Interval period.
- param str
- Extended information field.
- period_
unit str - Unit of scan cycle, value:
- source str
- Added the source of the task.
- target_
end_ inttime - Task end time (hours).
- target_
start_ inttime - Task start time (hours).
- task_
name str - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task_
type str - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- enable Number
- Whether to enable. Value:
- first
Date NumberStr - First execution time.
- interval
Period Number - Interval period.
- param String
- Extended information field.
- period
Unit String - Unit of scan cycle, value:
- source String
- Added the source of the task.
- target
End NumberTime - Task end time (hours).
- target
Start NumberTime - Task start time (hours).
- task
Name String - The task name.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
- task
Type String - The task type.
- VIRUS_VUL_SCHEDULE_SCAN: scans for viruses.
- IMAGE_SCAN: Image scan.
- EMG_VUL_SCHEDULE_SCAN: Emergency vulnerability scanning.
Import
Threat Detection Cycle Task can be imported using the id, e.g.
$ pulumi import alicloud:threatdetection/cycleTask:CycleTask example <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.