published on Thursday, Sep 3, 2026 by Volcengine
published on Thursday, Sep 3, 2026 by Volcengine
Volcengine Redis expired key scan/cleanup task (KeyScanJob). Refers to a one-time expired key scan and cleanup job initiated for the target Redis instance. You can create, query, or cancel (interrupt) the job. The task is one-time and does not support updates. Finished/Failed/Interrupted are terminal states; canceled and failed tasks are considered nonexistent resources when queried.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcenginecc from "@volcengine/pulumi-volcenginecc";
const example = new volcenginecc.redis.KeyScanJob("example", {
instanceId: "redis-xxxx",
scanKeyNumPerSecond: 3000,
timeoutMinutes: 60,
});
import pulumi
import pulumi_volcenginecc as volcenginecc
example = volcenginecc.redis.KeyScanJob("example",
instance_id="redis-xxxx",
scan_key_num_per_second=3000,
timeout_minutes=60)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcenginecc/sdk/go/volcenginecc/redis"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := redis.NewKeyScanJob(ctx, "example", &redis.KeyScanJobArgs{
InstanceId: pulumi.String("redis-xxxx"),
ScanKeyNumPerSecond: pulumi.Int(3000),
TimeoutMinutes: pulumi.Int(60),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcenginecc = Volcengine.Pulumi.Volcenginecc;
return await Deployment.RunAsync(() =>
{
var example = new Volcenginecc.Redis.KeyScanJob("example", new()
{
InstanceId = "redis-xxxx",
ScanKeyNumPerSecond = 3000,
TimeoutMinutes = 60,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.volcengine.volcenginecc.redis.KeyScanJob;
import com.volcengine.volcenginecc.redis.KeyScanJobArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
var example = new KeyScanJob("example", KeyScanJobArgs.builder()
.instanceId("redis-xxxx")
.scanKeyNumPerSecond(3000)
.timeoutMinutes(60)
.build());
}
}
resources:
example:
type: volcenginecc:redis:KeyScanJob
properties:
instanceId: redis-xxxx
scanKeyNumPerSecond: 3000
timeoutMinutes: 60
pulumi {
required_providers {
volcenginecc = {
source = "pulumi/volcenginecc"
}
}
}
resource "volcenginecc_redis_keyscanjob" "example" {
instance_id = "redis-xxxx"
scan_key_num_per_second = 3000
timeout_minutes = 60
}
Create KeyScanJob Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KeyScanJob(name: string, args: KeyScanJobArgs, opts?: CustomResourceOptions);@overload
def KeyScanJob(resource_name: str,
args: KeyScanJobArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KeyScanJob(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
scan_key_num_per_second: Optional[int] = None,
timeout_minutes: Optional[int] = None)func NewKeyScanJob(ctx *Context, name string, args KeyScanJobArgs, opts ...ResourceOption) (*KeyScanJob, error)public KeyScanJob(string name, KeyScanJobArgs args, CustomResourceOptions? opts = null)
public KeyScanJob(String name, KeyScanJobArgs args)
public KeyScanJob(String name, KeyScanJobArgs args, CustomResourceOptions options)
type: volcenginecc:redis:KeyScanJob
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "volcenginecc_redis_key_scan_job" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args KeyScanJobArgs
- 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 KeyScanJobArgs
- 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 KeyScanJobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyScanJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KeyScanJobArgs
- 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 keyScanJobResource = new Volcenginecc.Redis.KeyScanJob("keyScanJobResource", new()
{
InstanceId = "string",
ScanKeyNumPerSecond = 0,
TimeoutMinutes = 0,
});
example, err := redis.NewKeyScanJob(ctx, "keyScanJobResource", &redis.KeyScanJobArgs{
InstanceId: pulumi.String("string"),
ScanKeyNumPerSecond: pulumi.Int(0),
TimeoutMinutes: pulumi.Int(0),
})
resource "volcenginecc_redis_key_scan_job" "keyScanJobResource" {
lifecycle {
create_before_destroy = true
}
instance_id = "string"
scan_key_num_per_second = 0
timeout_minutes = 0
}
var keyScanJobResource = new KeyScanJob("keyScanJobResource", KeyScanJobArgs.builder()
.instanceId("string")
.scanKeyNumPerSecond(0)
.timeoutMinutes(0)
.build());
key_scan_job_resource = volcenginecc.redis.KeyScanJob("keyScanJobResource",
instance_id="string",
scan_key_num_per_second=0,
timeout_minutes=0)
const keyScanJobResource = new volcenginecc.redis.KeyScanJob("keyScanJobResource", {
instanceId: "string",
scanKeyNumPerSecond: 0,
timeoutMinutes: 0,
});
type: volcenginecc:redis:KeyScanJob
properties:
instanceId: string
scanKeyNumPerSecond: 0
timeoutMinutes: 0
KeyScanJob 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 KeyScanJob resource accepts the following input properties:
- Instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- Scan
Key intNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- Timeout
Minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- Instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- Scan
Key intNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- Timeout
Minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- instance_
id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- scan_
key_ numbernum_ per_ second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- timeout_
minutes number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- instance
Id String - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- scan
Key IntegerNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- timeout
Minutes Integer - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- scan
Key numberNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- timeout
Minutes number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- instance_
id str - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- scan_
key_ intnum_ per_ second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- timeout_
minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- instance
Id String - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- scan
Key NumberNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- timeout
Minutes Number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
Outputs
All input properties are implicitly available as output properties. Additionally, the KeyScanJob resource produces the following output properties:
- Completed
Count int - Number of shards analyzed.
- Create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Id string
- The provider-assigned unique ID for this managed resource.
- Job
Id string - Task ID of the scan job.
- Start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- Total
Count int - Total number of shards to analyze.
- Completed
Count int - Number of shards analyzed.
- Create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Id string
- The provider-assigned unique ID for this managed resource.
- Job
Id string - Task ID of the scan job.
- Start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- Total
Count int - Total number of shards to analyze.
- completed_
count number - Number of shards analyzed.
- create_
time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish_
time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- id string
- The provider-assigned unique ID for this managed resource.
- job_
id string - Task ID of the scan job.
- start_
time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- total_
count number - Total number of shards to analyze.
- completed
Count Integer - Number of shards analyzed.
- create
Time String - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time String - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- id String
- The provider-assigned unique ID for this managed resource.
- job
Id String - Task ID of the scan job.
- start
Time String - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status String
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- total
Count Integer - Total number of shards to analyze.
- completed
Count number - Number of shards analyzed.
- create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- id string
- The provider-assigned unique ID for this managed resource.
- job
Id string - Task ID of the scan job.
- start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- total
Count number - Total number of shards to analyze.
- completed_
count int - Number of shards analyzed.
- create_
time str - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish_
time str - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- id str
- The provider-assigned unique ID for this managed resource.
- job_
id str - Task ID of the scan job.
- start_
time str - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status str
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- total_
count int - Total number of shards to analyze.
- completed
Count Number - Number of shards analyzed.
- create
Time String - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time String - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- id String
- The provider-assigned unique ID for this managed resource.
- job
Id String - Task ID of the scan job.
- start
Time String - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status String
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- total
Count Number - Total number of shards to analyze.
Look up Existing KeyScanJob Resource
Get an existing KeyScanJob 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?: KeyScanJobState, opts?: CustomResourceOptions): KeyScanJob@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
completed_count: Optional[int] = None,
create_time: Optional[str] = None,
finish_time: Optional[str] = None,
instance_id: Optional[str] = None,
job_id: Optional[str] = None,
scan_key_num_per_second: Optional[int] = None,
start_time: Optional[str] = None,
status: Optional[str] = None,
timeout_minutes: Optional[int] = None,
total_count: Optional[int] = None) -> KeyScanJobfunc GetKeyScanJob(ctx *Context, name string, id IDInput, state *KeyScanJobState, opts ...ResourceOption) (*KeyScanJob, error)public static KeyScanJob Get(string name, Input<string> id, KeyScanJobState? state, CustomResourceOptions? opts = null)public static KeyScanJob get(String name, Output<String> id, KeyScanJobState state, CustomResourceOptions options)resources: _: type: volcenginecc:redis:KeyScanJob get: id: ${id}import {
to = volcenginecc_redis_key_scan_job.example
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.
- Completed
Count int - Number of shards analyzed.
- Create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- Job
Id string - Task ID of the scan job.
- Scan
Key intNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- Start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- Timeout
Minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- Total
Count int - Total number of shards to analyze.
- Completed
Count int - Number of shards analyzed.
- Create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- Job
Id string - Task ID of the scan job.
- Scan
Key intNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- Start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- Status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- Timeout
Minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- Total
Count int - Total number of shards to analyze.
- completed_
count number - Number of shards analyzed.
- create_
time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish_
time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- instance_
id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- job_
id string - Task ID of the scan job.
- scan_
key_ numbernum_ per_ second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- start_
time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- timeout_
minutes number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- total_
count number - Total number of shards to analyze.
- completed
Count Integer - Number of shards analyzed.
- create
Time String - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time String - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- instance
Id String - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- job
Id String - Task ID of the scan job.
- scan
Key IntegerNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- start
Time String - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status String
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- timeout
Minutes Integer - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- total
Count Integer - Total number of shards to analyze.
- completed
Count number - Number of shards analyzed.
- create
Time string - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time string - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- instance
Id string - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- job
Id string - Task ID of the scan job.
- scan
Key numberNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- start
Time string - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status string
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- timeout
Minutes number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- total
Count number - Total number of shards to analyze.
- completed_
count int - Number of shards analyzed.
- create_
time str - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish_
time str - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- instance_
id str - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- job_
id str - Task ID of the scan job.
- scan_
key_ intnum_ per_ second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- start_
time str - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status str
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- timeout_
minutes int - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- total_
count int - Total number of shards to analyze.
- completed
Count Number - Number of shards analyzed.
- create
Time String - Task creation time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- finish
Time String - Task end time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- instance
Id String - Instance ID. You can call the DescribeDBInstances API to query basic information for all Redis instances in the target region, including the instance ID.
- job
Id String - Task ID of the scan job.
- scan
Key NumberNum Per Second - Number of expired keys scanned per second. Value range: integer between 2000 and 100000.
- start
Time String - Task start time. Format: yyyy-MM-ddTHH:mm:ssZ (UTC).
- status String
- Task status. Values: Created, Running, Finished, Failed, Interrupted.
- timeout
Minutes Number - Scan timeout. Value range: integer between 30 and 1440, unit: minutes.
- total
Count Number - Total number of shards to analyze.
Import
$ pulumi import volcenginecc:redis/keyScanJob:KeyScanJob example "instance_id|job_id"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcenginecc volcengine/pulumi-volcenginecc
- License
- MPL-2.0
- Notes
- This Pulumi package is based on the
volcengineccTerraform Provider.
published on Thursday, Sep 3, 2026 by Volcengine