Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine
volcengine.redis.Backups
Explore with Pulumi AI
Use this data source to query detailed information of redis backups
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Ecs.Zones.Invoke();
var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
{
VpcName = "acc-test-vpc",
CidrBlock = "172.16.0.0/16",
});
var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
{
SubnetName = "acc-test-subnet",
CidrBlock = "172.16.0.0/24",
ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
VpcId = fooVpc.Id,
});
var fooInstance = new Volcengine.Redis.Instance("fooInstance", new()
{
ZoneIds = new[]
{
fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
},
InstanceName = "acc-test-tf-redis",
ShardedCluster = 1,
Password = "1qaz!QAZ12",
NodeNumber = 2,
ShardCapacity = 1024,
ShardNumber = 2,
EngineVersion = "5.0",
SubnetId = fooSubnet.Id,
DeletionProtection = "disabled",
VpcAuthMode = "close",
ChargeType = "PostPaid",
Port = 6381,
ProjectName = "default",
});
var fooBackup = new List<Volcengine.Redis.Backup>();
for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
{
var range = new { Value = rangeIndex };
fooBackup.Add(new Volcengine.Redis.Backup($"fooBackup-{range.Value}", new()
{
InstanceId = fooInstance.Id,
}));
}
var fooBackups = Volcengine.Redis.Backups.Invoke(new()
{
InstanceId = fooInstance.Id,
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/redis"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := ecs.Zones(ctx, nil, nil)
if err != nil {
return err
}
fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
VpcName: pulumi.String("acc-test-vpc"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
SubnetName: pulumi.String("acc-test-subnet"),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: *pulumi.String(fooZones.Zones[0].Id),
VpcId: fooVpc.ID(),
})
if err != nil {
return err
}
fooInstance, err := redis.NewInstance(ctx, "fooInstance", &redis.InstanceArgs{
ZoneIds: pulumi.StringArray{
*pulumi.String(fooZones.Zones[0].Id),
},
InstanceName: pulumi.String("acc-test-tf-redis"),
ShardedCluster: pulumi.Int(1),
Password: pulumi.String("1qaz!QAZ12"),
NodeNumber: pulumi.Int(2),
ShardCapacity: pulumi.Int(1024),
ShardNumber: pulumi.Int(2),
EngineVersion: pulumi.String("5.0"),
SubnetId: fooSubnet.ID(),
DeletionProtection: pulumi.String("disabled"),
VpcAuthMode: pulumi.String("close"),
ChargeType: pulumi.String("PostPaid"),
Port: pulumi.Int(6381),
ProjectName: pulumi.String("default"),
})
if err != nil {
return err
}
var fooBackup []*redis.Backup
for index := 0; index < 3; index++ {
key0 := index
_ := index
__res, err := redis.NewBackup(ctx, fmt.Sprintf("fooBackup-%v", key0), &redis.BackupArgs{
InstanceId: fooInstance.ID(),
})
if err != nil {
return err
}
fooBackup = append(fooBackup, __res)
}
_ = redis.BackupsOutput(ctx, redis.BackupsOutputArgs{
InstanceId: fooInstance.ID(),
}, nil)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.redis.Instance;
import com.pulumi.volcengine.redis.InstanceArgs;
import com.pulumi.volcengine.redis.Backup;
import com.pulumi.volcengine.redis.BackupArgs;
import com.pulumi.volcengine.redis.RedisFunctions;
import com.pulumi.volcengine.redis.inputs.BackupsArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 fooZones = EcsFunctions.Zones();
var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.vpcName("acc-test-vpc")
.cidrBlock("172.16.0.0/16")
.build());
var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
.subnetName("acc-test-subnet")
.cidrBlock("172.16.0.0/24")
.zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
.vpcId(fooVpc.id())
.build());
var fooInstance = new Instance("fooInstance", InstanceArgs.builder()
.zoneIds(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
.instanceName("acc-test-tf-redis")
.shardedCluster(1)
.password("1qaz!QAZ12")
.nodeNumber(2)
.shardCapacity(1024)
.shardNumber(2)
.engineVersion("5.0")
.subnetId(fooSubnet.id())
.deletionProtection("disabled")
.vpcAuthMode("close")
.chargeType("PostPaid")
.port(6381)
.projectName("default")
.build());
for (var i = 0; i < 3; i++) {
new Backup("fooBackup-" + i, BackupArgs.builder()
.instanceId(fooInstance.id())
.build());
}
final var fooBackups = RedisFunctions.Backups(BackupsArgs.builder()
.instanceId(fooInstance.id())
.build());
}
}
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
vpc_name="acc-test-vpc",
cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
subnet_name="acc-test-subnet",
cidr_block="172.16.0.0/24",
zone_id=foo_zones.zones[0].id,
vpc_id=foo_vpc.id)
foo_instance = volcengine.redis.Instance("fooInstance",
zone_ids=[foo_zones.zones[0].id],
instance_name="acc-test-tf-redis",
sharded_cluster=1,
password="1qaz!QAZ12",
node_number=2,
shard_capacity=1024,
shard_number=2,
engine_version="5.0",
subnet_id=foo_subnet.id,
deletion_protection="disabled",
vpc_auth_mode="close",
charge_type="PostPaid",
port=6381,
project_name="default")
foo_backup = []
for range in [{"value": i} for i in range(0, 3)]:
foo_backup.append(volcengine.redis.Backup(f"fooBackup-{range['value']}", instance_id=foo_instance.id))
foo_backups = volcengine.redis.backups_output(instance_id=foo_instance.id)
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooZones = volcengine.ecs.Zones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
vpcName: "acc-test-vpc",
cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
subnetName: "acc-test-subnet",
cidrBlock: "172.16.0.0/24",
zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
vpcId: fooVpc.id,
});
const fooInstance = new volcengine.redis.Instance("fooInstance", {
zoneIds: [fooZones.then(fooZones => fooZones.zones?.[0]?.id)],
instanceName: "acc-test-tf-redis",
shardedCluster: 1,
password: "1qaz!QAZ12",
nodeNumber: 2,
shardCapacity: 1024,
shardNumber: 2,
engineVersion: "5.0",
subnetId: fooSubnet.id,
deletionProtection: "disabled",
vpcAuthMode: "close",
chargeType: "PostPaid",
port: 6381,
projectName: "default",
});
const fooBackup: volcengine.redis.Backup[] = [];
for (const range = {value: 0}; range.value < 3; range.value++) {
fooBackup.push(new volcengine.redis.Backup(`fooBackup-${range.value}`, {instanceId: fooInstance.id}));
}
const fooBackups = volcengine.redis.BackupsOutput({
instanceId: fooInstance.id,
});
resources:
fooVpc:
type: volcengine:vpc:Vpc
properties:
vpcName: acc-test-vpc
cidrBlock: 172.16.0.0/16
fooSubnet:
type: volcengine:vpc:Subnet
properties:
subnetName: acc-test-subnet
cidrBlock: 172.16.0.0/24
zoneId: ${fooZones.zones[0].id}
vpcId: ${fooVpc.id}
fooInstance:
type: volcengine:redis:Instance
properties:
zoneIds:
- ${fooZones.zones[0].id}
instanceName: acc-test-tf-redis
shardedCluster: 1
password: 1qaz!QAZ12
nodeNumber: 2
shardCapacity: 1024
shardNumber: 2
engineVersion: '5.0'
subnetId: ${fooSubnet.id}
deletionProtection: disabled
vpcAuthMode: close
chargeType: PostPaid
port: 6381
projectName: default
fooBackup:
type: volcengine:redis:Backup
properties:
instanceId: ${fooInstance.id}
options: {}
variables:
fooZones:
fn::invoke:
Function: volcengine:ecs:Zones
Arguments: {}
fooBackups:
fn::invoke:
Function: volcengine:redis:Backups
Arguments:
instanceId: ${fooInstance.id}
Using Backups
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function backups(args: BackupsArgs, opts?: InvokeOptions): Promise<BackupsResult>
function backupsOutput(args: BackupsOutputArgs, opts?: InvokeOptions): Output<BackupsResult>
def backups(backup_strategy_lists: Optional[Sequence[str]] = None,
end_time: Optional[str] = None,
instance_id: Optional[str] = None,
output_file: Optional[str] = None,
start_time: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> BackupsResult
def backups_output(backup_strategy_lists: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
end_time: Optional[pulumi.Input[str]] = None,
instance_id: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
start_time: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[BackupsResult]
func Backups(ctx *Context, args *BackupsArgs, opts ...InvokeOption) (*BackupsResult, error)
func BackupsOutput(ctx *Context, args *BackupsOutputArgs, opts ...InvokeOption) BackupsResultOutput
public static class Backups
{
public static Task<BackupsResult> InvokeAsync(BackupsArgs args, InvokeOptions? opts = null)
public static Output<BackupsResult> Invoke(BackupsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<BackupsResult> backups(BackupsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: volcengine:redis:Backups
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Id string - Id of instance.
- Backup
Strategy List<string>Lists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- End
Time string - Query end time.
- Output
File string - File name where to save data source results.
- Start
Time string - Query start time.
- Instance
Id string - Id of instance.
- Backup
Strategy []stringLists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- End
Time string - Query end time.
- Output
File string - File name where to save data source results.
- Start
Time string - Query start time.
- instance
Id String - Id of instance.
- backup
Strategy List<String>Lists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- end
Time String - Query end time.
- output
File String - File name where to save data source results.
- start
Time String - Query start time.
- instance
Id string - Id of instance.
- backup
Strategy string[]Lists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- end
Time string - Query end time.
- output
File string - File name where to save data source results.
- start
Time string - Query start time.
- instance_
id str - Id of instance.
- backup_
strategy_ Sequence[str]lists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- end_
time str - Query end time.
- output_
file str - File name where to save data source results.
- start_
time str - Query start time.
- instance
Id String - Id of instance.
- backup
Strategy List<String>Lists - The list of backup strategy, support AutomatedBackup and ManualBackup.
- end
Time String - Query end time.
- output
File String - File name where to save data source results.
- start
Time String - Query start time.
Backups Result
The following output properties are available:
- Backups
List<Backups
Backup> - Information of backups.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Id string - Id of instance.
- Total
Count int - The total count of backup query.
- Backup
Strategy List<string>Lists - End
Time string - End time of backup.
- Output
File string - Start
Time string - Start time of backup.
- Backups
[]Backups
Backup - Information of backups.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instance
Id string - Id of instance.
- Total
Count int - The total count of backup query.
- Backup
Strategy []stringLists - End
Time string - End time of backup.
- Output
File string - Start
Time string - Start time of backup.
- backups
List<Backups
Backup> - Information of backups.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id String - Id of instance.
- total
Count Integer - The total count of backup query.
- backup
Strategy List<String>Lists - end
Time String - End time of backup.
- output
File String - start
Time String - Start time of backup.
- backups
Backups
Backup[] - Information of backups.
- id string
- The provider-assigned unique ID for this managed resource.
- instance
Id string - Id of instance.
- total
Count number - The total count of backup query.
- backup
Strategy string[]Lists - end
Time string - End time of backup.
- output
File string - start
Time string - Start time of backup.
- backups
Sequence[Backups
Backup] - Information of backups.
- id str
- The provider-assigned unique ID for this managed resource.
- instance_
id str - Id of instance.
- total_
count int - The total count of backup query.
- backup_
strategy_ Sequence[str]lists - end_
time str - End time of backup.
- output_
file str - start_
time str - Start time of backup.
- backups List<Property Map>
- Information of backups.
- id String
- The provider-assigned unique ID for this managed resource.
- instance
Id String - Id of instance.
- total
Count Number - The total count of backup query.
- backup
Strategy List<String>Lists - end
Time String - End time of backup.
- output
File String - start
Time String - Start time of backup.
Supporting Types
BackupsBackup
- Backup
Point stringId - The id of backup point.
- Backup
Strategy string - Backup strategy.
- Backup
Type string - Backup type.
- End
Time string - Query end time.
- Instance
Details List<BackupsBackup Instance Detail> - Information of instance.
- Instance
Id string - Id of instance.
- Size int
- Size in MiB.
- Start
Time string - Query start time.
- Status string
- Status of backup (Creating/Available/Unavailable/Deleting).
- Backup
Point stringId - The id of backup point.
- Backup
Strategy string - Backup strategy.
- Backup
Type string - Backup type.
- End
Time string - Query end time.
- Instance
Details []BackupsBackup Instance Detail - Information of instance.
- Instance
Id string - Id of instance.
- Size int
- Size in MiB.
- Start
Time string - Query start time.
- Status string
- Status of backup (Creating/Available/Unavailable/Deleting).
- backup
Point StringId - The id of backup point.
- backup
Strategy String - Backup strategy.
- backup
Type String - Backup type.
- end
Time String - Query end time.
- instance
Details List<BackupsBackup Instance Detail> - Information of instance.
- instance
Id String - Id of instance.
- size Integer
- Size in MiB.
- start
Time String - Query start time.
- status String
- Status of backup (Creating/Available/Unavailable/Deleting).
- backup
Point stringId - The id of backup point.
- backup
Strategy string - Backup strategy.
- backup
Type string - Backup type.
- end
Time string - Query end time.
- instance
Details BackupsBackup Instance Detail[] - Information of instance.
- instance
Id string - Id of instance.
- size number
- Size in MiB.
- start
Time string - Query start time.
- status string
- Status of backup (Creating/Available/Unavailable/Deleting).
- backup_
point_ strid - The id of backup point.
- backup_
strategy str - Backup strategy.
- backup_
type str - Backup type.
- end_
time str - Query end time.
- instance_
details Sequence[BackupsBackup Instance Detail] - Information of instance.
- instance_
id str - Id of instance.
- size int
- Size in MiB.
- start_
time str - Query start time.
- status str
- Status of backup (Creating/Available/Unavailable/Deleting).
- backup
Point StringId - The id of backup point.
- backup
Strategy String - Backup strategy.
- backup
Type String - Backup type.
- end
Time String - Query end time.
- instance
Details List<Property Map> - Information of instance.
- instance
Id String - Id of instance.
- size Number
- Size in MiB.
- start
Time String - Query start time.
- status String
- Status of backup (Creating/Available/Unavailable/Deleting).
BackupsBackupInstanceDetail
- Account
Id int - Id of account.
- Arch
Type string - Arch type of instance(Standard/Cluster).
- Charge
Type string - Charge type of instance(Postpaid/Prepaid).
- Engine
Version string - Engine version of instance.
- Expired
Time string - Expired time of instance.
- Instance
Id string - Id of instance.
- Instance
Name string - Name of instance.
- Maintenance
Time string - The maintainable period (in UTC) of the instance.
- Network
Type string - Network type of instance.
- Project
Name string - Project name of instance.
- Region
Id string - Id of region.
- Replicas int
- Count of replica in which shard.
- Server
Cpu int - Count of cpu cores of instance.
- int
- Capacity of shard.
- int
- Count of shard.
- Total
Capacity int - Total capacity of instance.
- Used
Capacity int - Capacity used of this instance.
- Vpc
Infos List<BackupsBackup Instance Detail Vpc Info> - Information of vpc.
- Zone
Ids List<string> - List of id of zone.
- Account
Id int - Id of account.
- Arch
Type string - Arch type of instance(Standard/Cluster).
- Charge
Type string - Charge type of instance(Postpaid/Prepaid).
- Engine
Version string - Engine version of instance.
- Expired
Time string - Expired time of instance.
- Instance
Id string - Id of instance.
- Instance
Name string - Name of instance.
- Maintenance
Time string - The maintainable period (in UTC) of the instance.
- Network
Type string - Network type of instance.
- Project
Name string - Project name of instance.
- Region
Id string - Id of region.
- Replicas int
- Count of replica in which shard.
- Server
Cpu int - Count of cpu cores of instance.
- int
- Capacity of shard.
- int
- Count of shard.
- Total
Capacity int - Total capacity of instance.
- Used
Capacity int - Capacity used of this instance.
- Vpc
Infos []BackupsBackup Instance Detail Vpc Info - Information of vpc.
- Zone
Ids []string - List of id of zone.
- account
Id Integer - Id of account.
- arch
Type String - Arch type of instance(Standard/Cluster).
- charge
Type String - Charge type of instance(Postpaid/Prepaid).
- engine
Version String - Engine version of instance.
- expired
Time String - Expired time of instance.
- instance
Id String - Id of instance.
- instance
Name String - Name of instance.
- maintenance
Time String - The maintainable period (in UTC) of the instance.
- network
Type String - Network type of instance.
- project
Name String - Project name of instance.
- region
Id String - Id of region.
- replicas Integer
- Count of replica in which shard.
- server
Cpu Integer - Count of cpu cores of instance.
- Integer
- Capacity of shard.
- Integer
- Count of shard.
- total
Capacity Integer - Total capacity of instance.
- used
Capacity Integer - Capacity used of this instance.
- vpc
Infos List<BackupsBackup Instance Detail Vpc Info> - Information of vpc.
- zone
Ids List<String> - List of id of zone.
- account
Id number - Id of account.
- arch
Type string - Arch type of instance(Standard/Cluster).
- charge
Type string - Charge type of instance(Postpaid/Prepaid).
- engine
Version string - Engine version of instance.
- expired
Time string - Expired time of instance.
- instance
Id string - Id of instance.
- instance
Name string - Name of instance.
- maintenance
Time string - The maintainable period (in UTC) of the instance.
- network
Type string - Network type of instance.
- project
Name string - Project name of instance.
- region
Id string - Id of region.
- replicas number
- Count of replica in which shard.
- server
Cpu number - Count of cpu cores of instance.
- number
- Capacity of shard.
- number
- Count of shard.
- total
Capacity number - Total capacity of instance.
- used
Capacity number - Capacity used of this instance.
- vpc
Infos BackupsBackup Instance Detail Vpc Info[] - Information of vpc.
- zone
Ids string[] - List of id of zone.
- account_
id int - Id of account.
- arch_
type str - Arch type of instance(Standard/Cluster).
- charge_
type str - Charge type of instance(Postpaid/Prepaid).
- engine_
version str - Engine version of instance.
- expired_
time str - Expired time of instance.
- instance_
id str - Id of instance.
- instance_
name str - Name of instance.
- maintenance_
time str - The maintainable period (in UTC) of the instance.
- network_
type str - Network type of instance.
- project_
name str - Project name of instance.
- region_
id str - Id of region.
- replicas int
- Count of replica in which shard.
- server_
cpu int - Count of cpu cores of instance.
- int
- Capacity of shard.
- int
- Count of shard.
- total_
capacity int - Total capacity of instance.
- used_
capacity int - Capacity used of this instance.
- vpc_
infos Sequence[BackupsBackup Instance Detail Vpc Info] - Information of vpc.
- zone_
ids Sequence[str] - List of id of zone.
- account
Id Number - Id of account.
- arch
Type String - Arch type of instance(Standard/Cluster).
- charge
Type String - Charge type of instance(Postpaid/Prepaid).
- engine
Version String - Engine version of instance.
- expired
Time String - Expired time of instance.
- instance
Id String - Id of instance.
- instance
Name String - Name of instance.
- maintenance
Time String - The maintainable period (in UTC) of the instance.
- network
Type String - Network type of instance.
- project
Name String - Project name of instance.
- region
Id String - Id of region.
- replicas Number
- Count of replica in which shard.
- server
Cpu Number - Count of cpu cores of instance.
- Number
- Capacity of shard.
- Number
- Count of shard.
- total
Capacity Number - Total capacity of instance.
- used
Capacity Number - Capacity used of this instance.
- vpc
Infos List<Property Map> - Information of vpc.
- zone
Ids List<String> - List of id of zone.
BackupsBackupInstanceDetailVpcInfo
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.