alicloud.esa.CacheReserveInstance
Explore with Pulumi AI
Provides a ESA Cache Reserve Instance resource.
For information about ESA Cache Reserve Instance and how to use it, see What is Cache Reserve Instance.
NOTE: Available since v1.247.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,
});
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)
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
		}
		_, 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
		}
		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,
    });
});
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 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 CacheReserveInstance("default", CacheReserveInstanceArgs.builder()
            .quotaGb("10240")
            .crRegion("CN-beijing")
            .autoRenew(true)
            .period("1")
            .paymentType("Subscription")
            .autoPay(true)
            .build());
    }
}
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
Create CacheReserveInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CacheReserveInstance(name: string, args: CacheReserveInstanceArgs, opts?: CustomResourceOptions);@overload
def CacheReserveInstance(resource_name: str,
                         args: CacheReserveInstanceArgs,
                         opts: Optional[ResourceOptions] = None)
@overload
def CacheReserveInstance(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         payment_type: Optional[str] = None,
                         auto_pay: Optional[bool] = None,
                         auto_renew: Optional[bool] = None,
                         cr_region: Optional[str] = None,
                         period: Optional[int] = None,
                         quota_gb: Optional[int] = None)func NewCacheReserveInstance(ctx *Context, name string, args CacheReserveInstanceArgs, opts ...ResourceOption) (*CacheReserveInstance, error)public CacheReserveInstance(string name, CacheReserveInstanceArgs args, CustomResourceOptions? opts = null)
public CacheReserveInstance(String name, CacheReserveInstanceArgs args)
public CacheReserveInstance(String name, CacheReserveInstanceArgs args, CustomResourceOptions options)
type: alicloud:esa:CacheReserveInstance
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 CacheReserveInstanceArgs
- 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 CacheReserveInstanceArgs
- 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 CacheReserveInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CacheReserveInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CacheReserveInstanceArgs
- 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 cacheReserveInstanceResource = new AliCloud.Esa.CacheReserveInstance("cacheReserveInstanceResource", new()
{
    PaymentType = "string",
    AutoPay = false,
    AutoRenew = false,
    CrRegion = "string",
    Period = 0,
    QuotaGb = 0,
});
example, err := esa.NewCacheReserveInstance(ctx, "cacheReserveInstanceResource", &esa.CacheReserveInstanceArgs{
	PaymentType: pulumi.String("string"),
	AutoPay:     pulumi.Bool(false),
	AutoRenew:   pulumi.Bool(false),
	CrRegion:    pulumi.String("string"),
	Period:      pulumi.Int(0),
	QuotaGb:     pulumi.Int(0),
})
var cacheReserveInstanceResource = new CacheReserveInstance("cacheReserveInstanceResource", CacheReserveInstanceArgs.builder()
    .paymentType("string")
    .autoPay(false)
    .autoRenew(false)
    .crRegion("string")
    .period(0)
    .quotaGb(0)
    .build());
cache_reserve_instance_resource = alicloud.esa.CacheReserveInstance("cacheReserveInstanceResource",
    payment_type="string",
    auto_pay=False,
    auto_renew=False,
    cr_region="string",
    period=0,
    quota_gb=0)
const cacheReserveInstanceResource = new alicloud.esa.CacheReserveInstance("cacheReserveInstanceResource", {
    paymentType: "string",
    autoPay: false,
    autoRenew: false,
    crRegion: "string",
    period: 0,
    quotaGb: 0,
});
type: alicloud:esa:CacheReserveInstance
properties:
    autoPay: false
    autoRenew: false
    crRegion: string
    paymentType: string
    period: 0
    quotaGb: 0
CacheReserveInstance 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 CacheReserveInstance resource accepts the following input properties:
- paymentType String
- Specifies whether to enable auto payment.
- autoPay Boolean
- Automatic payment.
- autoRenew Boolean
- Whether to auto-renew:
- crRegion String
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- period Integer
- Purchase period (unit: month).
- quotaGb Integer
- Cache retention specification (unit: GB).
- paymentType string
- Specifies whether to enable auto payment.
- autoPay boolean
- Automatic payment.
- autoRenew boolean
- Whether to auto-renew:
- crRegion string
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- period number
- Purchase period (unit: month).
- quotaGb number
- Cache retention specification (unit: GB).
- payment_type str
- Specifies whether to enable auto payment.
- auto_pay bool
- Automatic payment.
- auto_renew bool
- Whether to auto-renew:
- cr_region str
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- period int
- Purchase period (unit: month).
- quota_gb int
- Cache retention specification (unit: GB).
- paymentType String
- Specifies whether to enable auto payment.
- autoPay Boolean
- Automatic payment.
- autoRenew Boolean
- Whether to auto-renew:
- crRegion String
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- period Number
- Purchase period (unit: month).
- quotaGb Number
- Cache retention specification (unit: GB).
Outputs
All input properties are implicitly available as output properties. Additionally, the CacheReserveInstance resource produces the following output properties:
- CreateTime string
- Instance purchase time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the cache reserve instance. , it is unavailable.
- CreateTime string
- Instance purchase time.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the cache reserve instance. , it is unavailable.
- createTime String
- Instance purchase time.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the cache reserve instance. , it is unavailable.
- createTime string
- Instance purchase time.
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- The status of the cache reserve instance. , it is unavailable.
- create_time str
- Instance purchase time.
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- The status of the cache reserve instance. , it is unavailable.
- createTime String
- Instance purchase time.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the cache reserve instance. , it is unavailable.
Look up Existing CacheReserveInstance Resource
Get an existing CacheReserveInstance 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?: CacheReserveInstanceState, opts?: CustomResourceOptions): CacheReserveInstance@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        auto_pay: Optional[bool] = None,
        auto_renew: Optional[bool] = None,
        cr_region: Optional[str] = None,
        create_time: Optional[str] = None,
        payment_type: Optional[str] = None,
        period: Optional[int] = None,
        quota_gb: Optional[int] = None,
        status: Optional[str] = None) -> CacheReserveInstancefunc GetCacheReserveInstance(ctx *Context, name string, id IDInput, state *CacheReserveInstanceState, opts ...ResourceOption) (*CacheReserveInstance, error)public static CacheReserveInstance Get(string name, Input<string> id, CacheReserveInstanceState? state, CustomResourceOptions? opts = null)public static CacheReserveInstance get(String name, Output<String> id, CacheReserveInstanceState state, CustomResourceOptions options)resources:  _:    type: alicloud:esa:CacheReserveInstance    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.
- AutoPay bool
- Automatic payment.
- AutoRenew bool
- Whether to auto-renew:
- CrRegion string
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- CreateTime string
- Instance purchase time.
- PaymentType string
- Specifies whether to enable auto payment.
- Period int
- Purchase period (unit: month).
- QuotaGb int
- Cache retention specification (unit: GB).
- Status string
- The status of the cache reserve instance. , it is unavailable.
- AutoPay bool
- Automatic payment.
- AutoRenew bool
- Whether to auto-renew:
- CrRegion string
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- CreateTime string
- Instance purchase time.
- PaymentType string
- Specifies whether to enable auto payment.
- Period int
- Purchase period (unit: month).
- QuotaGb int
- Cache retention specification (unit: GB).
- Status string
- The status of the cache reserve instance. , it is unavailable.
- autoPay Boolean
- Automatic payment.
- autoRenew Boolean
- Whether to auto-renew:
- crRegion String
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- createTime String
- Instance purchase time.
- paymentType String
- Specifies whether to enable auto payment.
- period Integer
- Purchase period (unit: month).
- quotaGb Integer
- Cache retention specification (unit: GB).
- status String
- The status of the cache reserve instance. , it is unavailable.
- autoPay boolean
- Automatic payment.
- autoRenew boolean
- Whether to auto-renew:
- crRegion string
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- createTime string
- Instance purchase time.
- paymentType string
- Specifies whether to enable auto payment.
- period number
- Purchase period (unit: month).
- quotaGb number
- Cache retention specification (unit: GB).
- status string
- The status of the cache reserve instance. , it is unavailable.
- auto_pay bool
- Automatic payment.
- auto_renew bool
- Whether to auto-renew:
- cr_region str
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- create_time str
- Instance purchase time.
- payment_type str
- Specifies whether to enable auto payment.
- period int
- Purchase period (unit: month).
- quota_gb int
- Cache retention specification (unit: GB).
- status str
- The status of the cache reserve instance. , it is unavailable.
- autoPay Boolean
- Automatic payment.
- autoRenew Boolean
- Whether to auto-renew:
- crRegion String
- Cache holding area- HK: Hong Kong, China
- CN: Mainland China
 
- createTime String
- Instance purchase time.
- paymentType String
- Specifies whether to enable auto payment.
- period Number
- Purchase period (unit: month).
- quotaGb Number
- Cache retention specification (unit: GB).
- status String
- The status of the cache reserve instance. , it is unavailable.
Import
ESA Cache Reserve Instance can be imported using the id, e.g.
$ pulumi import alicloud:esa/cacheReserveInstance:CacheReserveInstance 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 alicloudTerraform Provider.