Viewing docs for Alibaba Cloud v3.104.0
published on Thursday, Jun 25, 2026 by Pulumi
published on Thursday, Jun 25, 2026 by Pulumi
Viewing docs for Alibaba Cloud v3.104.0
published on Thursday, Jun 25, 2026 by Pulumi
published on Thursday, Jun 25, 2026 by Pulumi
This data source provides the Esa Cache Reserve Instances of the current Alibaba Cloud user.
NOTE: Available since v1.282.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.esa.CacheReserveInstance("default", {
quotaGb: 10240,
crRegion: "CN-beijing",
autoRenew: true,
period: 1,
paymentType: "Subscription",
autoPay: true,
});
const ids = alicloud.esa.getCacheReserveInstancesOutput({
ids: [_default.id],
});
export const esaCacheReserveInstancesId0 = ids.apply(ids => ids.instances?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.esa.CacheReserveInstance("default",
quota_gb=10240,
cr_region="CN-beijing",
auto_renew=True,
period=1,
payment_type="Subscription",
auto_pay=True)
ids = alicloud.esa.get_cache_reserve_instances_output(ids=[default.id])
pulumi.export("esaCacheReserveInstancesId0", ids.instances[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/esa"
"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
}
_default, err := esa.NewCacheReserveInstance(ctx, "default", &esa.CacheReserveInstanceArgs{
QuotaGb: pulumi.Int(10240),
CrRegion: pulumi.String("CN-beijing"),
AutoRenew: pulumi.Bool(true),
Period: pulumi.Int(1),
PaymentType: pulumi.String("Subscription"),
AutoPay: pulumi.Bool(true),
})
if err != nil {
return err
}
ids := esa.GetCacheReserveInstancesOutput(ctx, esa.GetCacheReserveInstancesOutputArgs{
Ids: pulumi.StringArray{
_default.ID(),
},
}, nil)
ctx.Export("esaCacheReserveInstancesId0", ids.ApplyT(func(ids esa.GetCacheReserveInstancesResult) (*string, error) {
return ids.Instances[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
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.Esa.CacheReserveInstance("default", new()
{
QuotaGb = 10240,
CrRegion = "CN-beijing",
AutoRenew = true,
Period = 1,
PaymentType = "Subscription",
AutoPay = true,
});
var ids = AliCloud.Esa.GetCacheReserveInstances.Invoke(new()
{
Ids = new[]
{
@default.Id,
},
});
return new Dictionary<string, object?>
{
["esaCacheReserveInstancesId0"] = ids.Apply(getCacheReserveInstancesResult => getCacheReserveInstancesResult.Instances[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.esa.CacheReserveInstance;
import com.pulumi.alicloud.esa.CacheReserveInstanceArgs;
import com.pulumi.alicloud.esa.EsaFunctions;
import com.pulumi.alicloud.esa.inputs.GetCacheReserveInstancesArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new CacheReserveInstance("default", CacheReserveInstanceArgs.builder()
.quotaGb(10240)
.crRegion("CN-beijing")
.autoRenew(true)
.period(1)
.paymentType("Subscription")
.autoPay(true)
.build());
final var ids = EsaFunctions.getCacheReserveInstances(GetCacheReserveInstancesArgs.builder()
.ids(default_.id())
.build());
ctx.export("esaCacheReserveInstancesId0", ids.applyValue(_ids -> _ids.instances()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:esa:CacheReserveInstance
properties:
quotaGb: '10240'
crRegion: CN-beijing
autoRenew: true
period: '1'
paymentType: Subscription
autoPay: true
variables:
ids:
fn::invoke:
function: alicloud:esa:getCacheReserveInstances
arguments:
ids:
- ${default.id}
outputs:
esaCacheReserveInstancesId0: ${ids.instances[0].id}
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
data "alicloud_esa_getcachereserveinstances" "ids" {
ids = [alicloud_esa_cachereserveinstance.default.id]
}
resource "alicloud_esa_cachereserveinstance" "default" {
quota_gb = "10240"
cr_region = "CN-beijing"
auto_renew = true
period = "1"
payment_type = "Subscription"
auto_pay = true
}
variable "name" {
type = string
default = "terraform-example"
}
output "esaCacheReserveInstancesId0" {
value = data.alicloud_esa_getcachereserveinstances.ids.instances[0].id
}
Using getCacheReserveInstances
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 getCacheReserveInstances(args: GetCacheReserveInstancesArgs, opts?: InvokeOptions): Promise<GetCacheReserveInstancesResult>
function getCacheReserveInstancesOutput(args: GetCacheReserveInstancesOutputArgs, opts?: InvokeOptions): Output<GetCacheReserveInstancesResult>def get_cache_reserve_instances(cache_reserve_instance_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
output_file: Optional[str] = None,
sort_by: Optional[str] = None,
sort_order: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCacheReserveInstancesResult
def get_cache_reserve_instances_output(cache_reserve_instance_id: pulumi.Input[Optional[str]] = None,
ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
output_file: pulumi.Input[Optional[str]] = None,
sort_by: pulumi.Input[Optional[str]] = None,
sort_order: pulumi.Input[Optional[str]] = None,
status: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCacheReserveInstancesResult]func GetCacheReserveInstances(ctx *Context, args *GetCacheReserveInstancesArgs, opts ...InvokeOption) (*GetCacheReserveInstancesResult, error)
func GetCacheReserveInstancesOutput(ctx *Context, args *GetCacheReserveInstancesOutputArgs, opts ...InvokeOption) GetCacheReserveInstancesResultOutput> Note: This function is named GetCacheReserveInstances in the Go SDK.
public static class GetCacheReserveInstances
{
public static Task<GetCacheReserveInstancesResult> InvokeAsync(GetCacheReserveInstancesArgs args, InvokeOptions? opts = null)
public static Output<GetCacheReserveInstancesResult> Invoke(GetCacheReserveInstancesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetCacheReserveInstancesResult> getCacheReserveInstances(GetCacheReserveInstancesArgs args, InvokeOptions options)
public static Output<GetCacheReserveInstancesResult> getCacheReserveInstances(GetCacheReserveInstancesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:esa/getCacheReserveInstances:getCacheReserveInstances
arguments:
# arguments dictionarydata "alicloud_esa_getcachereserveinstances" "name" {
# arguments
}The following arguments are supported:
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Ids List<string>
- A list of Cache Reserve Instance IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Sort
By string - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - Sort
Order string - The sort order. Valid values:
asc,desc. - Status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Ids []string
- A list of Cache Reserve Instance IDs.
- Output
File string - File name where to save data source results (after running
pulumi preview). - Sort
By string - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - Sort
Order string - The sort order. Valid values:
asc,desc. - Status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache_
reserve_ stringinstance_ id - The ID of the Cache Reserve Instance.
- ids list(string)
- A list of Cache Reserve Instance IDs.
- output_
file string - File name where to save data source results (after running
pulumi preview). - sort_
by string - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - sort_
order string - The sort order. Valid values:
asc,desc. - status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- ids List<String>
- A list of Cache Reserve Instance IDs.
- output
File String - File name where to save data source results (after running
pulumi preview). - sort
By String - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - sort
Order String - The sort order. Valid values:
asc,desc. - status String
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- ids string[]
- A list of Cache Reserve Instance IDs.
- output
File string - File name where to save data source results (after running
pulumi preview). - sort
By string - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - sort
Order string - The sort order. Valid values:
asc,desc. - status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache_
reserve_ strinstance_ id - The ID of the Cache Reserve Instance.
- ids Sequence[str]
- A list of Cache Reserve Instance IDs.
- output_
file str - File name where to save data source results (after running
pulumi preview). - sort_
by str - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - sort_
order str - The sort order. Valid values:
asc,desc. - status str
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- ids List<String>
- A list of Cache Reserve Instance IDs.
- output
File String - File name where to save data source results (after running
pulumi preview). - sort
By String - The field to sort the results by. Valid values:
CreateTime,ExpireTime. - sort
Order String - The sort order. Valid values:
asc,desc. - status String
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
getCacheReserveInstances Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<Pulumi.
Ali Cloud. Esa. Outputs. Get Cache Reserve Instances Instance> - A list of Cache Reserve Instances. Each element contains the following attributes:
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Ids List<string>
- Output
File string - Sort
By string - Sort
Order string - Status string
- The status of the instance.
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Get
Cache Reserve Instances Instance - A list of Cache Reserve Instances. Each element contains the following attributes:
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Ids []string
- Output
File string - Sort
By string - Sort
Order string - Status string
- The status of the instance.
- id string
- The provider-assigned unique ID for this managed resource.
- instances list(object)
- A list of Cache Reserve Instances. Each element contains the following attributes:
- cache_
reserve_ stringinstance_ id - The ID of the Cache Reserve Instance.
- ids list(string)
- output_
file string - sort_
by string - sort_
order string - status string
- The status of the instance.
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Get
Cache Reserve Instances Instance> - A list of Cache Reserve Instances. Each element contains the following attributes:
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- ids List<String>
- output
File String - sort
By String - sort
Order String - status String
- The status of the instance.
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Get
Cache Reserve Instances Instance[] - A list of Cache Reserve Instances. Each element contains the following attributes:
- cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- ids string[]
- output
File string - sort
By string - sort
Order string - status string
- The status of the instance.
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Get
Cache Reserve Instances Instance] - A list of Cache Reserve Instances. Each element contains the following attributes:
- cache_
reserve_ strinstance_ id - The ID of the Cache Reserve Instance.
- ids Sequence[str]
- output_
file str - sort_
by str - sort_
order str - status str
- The status of the instance.
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
- A list of Cache Reserve Instances. Each element contains the following attributes:
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- ids List<String>
- output
File String - sort
By String - sort
Order String - status String
- The status of the instance.
Supporting Types
GetCacheReserveInstancesInstance
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Cr
Region string - The region where the cache reserve instance is used.
- Create
Time string - The time when the instance was created.
- Expire
Time string - The expiration time of the instance.
- Id string
- The ID of the Cache Reserve Instance.
- Payment
Type string - The payment type of the resource.
- Period int
- The purchase duration of the instance, in months.
- Quota
Gb int - The cache reserve capacity, in GB.
- Status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- Cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- Cr
Region string - The region where the cache reserve instance is used.
- Create
Time string - The time when the instance was created.
- Expire
Time string - The expiration time of the instance.
- Id string
- The ID of the Cache Reserve Instance.
- Payment
Type string - The payment type of the resource.
- Period int
- The purchase duration of the instance, in months.
- Quota
Gb int - The cache reserve capacity, in GB.
- Status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache_
reserve_ stringinstance_ id - The ID of the Cache Reserve Instance.
- cr_
region string - The region where the cache reserve instance is used.
- create_
time string - The time when the instance was created.
- expire_
time string - The expiration time of the instance.
- id string
- The ID of the Cache Reserve Instance.
- payment_
type string - The payment type of the resource.
- period number
- The purchase duration of the instance, in months.
- quota_
gb number - The cache reserve capacity, in GB.
- status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- cr
Region String - The region where the cache reserve instance is used.
- create
Time String - The time when the instance was created.
- expire
Time String - The expiration time of the instance.
- id String
- The ID of the Cache Reserve Instance.
- payment
Type String - The payment type of the resource.
- period Integer
- The purchase duration of the instance, in months.
- quota
Gb Integer - The cache reserve capacity, in GB.
- status String
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve stringInstance Id - The ID of the Cache Reserve Instance.
- cr
Region string - The region where the cache reserve instance is used.
- create
Time string - The time when the instance was created.
- expire
Time string - The expiration time of the instance.
- id string
- The ID of the Cache Reserve Instance.
- payment
Type string - The payment type of the resource.
- period number
- The purchase duration of the instance, in months.
- quota
Gb number - The cache reserve capacity, in GB.
- status string
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache_
reserve_ strinstance_ id - The ID of the Cache Reserve Instance.
- cr_
region str - The region where the cache reserve instance is used.
- create_
time str - The time when the instance was created.
- expire_
time str - The expiration time of the instance.
- id str
- The ID of the Cache Reserve Instance.
- payment_
type str - The payment type of the resource.
- period int
- The purchase duration of the instance, in months.
- quota_
gb int - The cache reserve capacity, in GB.
- status str
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
- cache
Reserve StringInstance Id - The ID of the Cache Reserve Instance.
- cr
Region String - The region where the cache reserve instance is used.
- create
Time String - The time when the instance was created.
- expire
Time String - The expiration time of the instance.
- id String
- The ID of the Cache Reserve Instance.
- payment
Type String - The payment type of the resource.
- period Number
- The purchase duration of the instance, in months.
- quota
Gb Number - The cache reserve capacity, in GB.
- status String
- The status of the cache reserve instance. Valid values:
online,offline,disable,overdue.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.
Viewing docs for Alibaba Cloud v3.104.0
published on Thursday, Jun 25, 2026 by Pulumi
published on Thursday, Jun 25, 2026 by Pulumi