tencentcloud.ReservedInstance
Explore with Pulumi AI
Provides a reserved instance resource.
NOTE: Reserved instance cannot be deleted and updated. The reserved instance still exist which can be extracted by reserved_instances data source when reserved instance is destroied.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const ri = new tencentcloud.ReservedInstance("ri", {
configId: "469043dd-28b9-4d89-b557-74f6a8326259",
instanceCount: 2,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
ri = tencentcloud.ReservedInstance("ri",
config_id="469043dd-28b9-4d89-b557-74f6a8326259",
instance_count=2)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewReservedInstance(ctx, "ri", &tencentcloud.ReservedInstanceArgs{
ConfigId: pulumi.String("469043dd-28b9-4d89-b557-74f6a8326259"),
InstanceCount: pulumi.Float64(2),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var ri = new Tencentcloud.ReservedInstance("ri", new()
{
ConfigId = "469043dd-28b9-4d89-b557-74f6a8326259",
InstanceCount = 2,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ReservedInstance;
import com.pulumi.tencentcloud.ReservedInstanceArgs;
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) {
var ri = new ReservedInstance("ri", ReservedInstanceArgs.builder()
.configId("469043dd-28b9-4d89-b557-74f6a8326259")
.instanceCount(2)
.build());
}
}
resources:
ri:
type: tencentcloud:ReservedInstance
properties:
configId: 469043dd-28b9-4d89-b557-74f6a8326259
instanceCount: 2
Create ReservedInstance Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ReservedInstance(name: string, args: ReservedInstanceArgs, opts?: CustomResourceOptions);
@overload
def ReservedInstance(resource_name: str,
args: ReservedInstanceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ReservedInstance(resource_name: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[str] = None,
instance_count: Optional[float] = None,
reserved_instance_id: Optional[str] = None,
reserved_instance_name: Optional[str] = None)
func NewReservedInstance(ctx *Context, name string, args ReservedInstanceArgs, opts ...ResourceOption) (*ReservedInstance, error)
public ReservedInstance(string name, ReservedInstanceArgs args, CustomResourceOptions? opts = null)
public ReservedInstance(String name, ReservedInstanceArgs args)
public ReservedInstance(String name, ReservedInstanceArgs args, CustomResourceOptions options)
type: tencentcloud:ReservedInstance
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 ReservedInstanceArgs
- 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 ReservedInstanceArgs
- 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 ReservedInstanceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ReservedInstanceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ReservedInstance 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 ReservedInstance resource accepts the following input properties:
- Config
Id string - Configuration ID of the reserved instance.
- Instance
Count double - Number of reserved instances to be purchased.
- Reserved
Instance stringId - ID of the resource.
- Reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- Config
Id string - Configuration ID of the reserved instance.
- Instance
Count float64 - Number of reserved instances to be purchased.
- Reserved
Instance stringId - ID of the resource.
- Reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- config
Id String - Configuration ID of the reserved instance.
- instance
Count Double - Number of reserved instances to be purchased.
- reserved
Instance StringId - ID of the resource.
- reserved
Instance StringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- config
Id string - Configuration ID of the reserved instance.
- instance
Count number - Number of reserved instances to be purchased.
- reserved
Instance stringId - ID of the resource.
- reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- config_
id str - Configuration ID of the reserved instance.
- instance_
count float - Number of reserved instances to be purchased.
- reserved_
instance_ strid - ID of the resource.
- reserved_
instance_ strname - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- config
Id String - Configuration ID of the reserved instance.
- instance
Count Number - Number of reserved instances to be purchased.
- reserved
Instance StringId - ID of the resource.
- reserved
Instance StringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
Outputs
All input properties are implicitly available as output properties. Additionally, the ReservedInstance resource produces the following output properties:
- end_
time str - Expiry time of the RI.
- id str
- The provider-assigned unique ID for this managed resource.
- start_
time str - Start time of the RI.
- status str
- Status of the RI at the time of purchase.
Look up Existing ReservedInstance Resource
Get an existing ReservedInstance 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?: ReservedInstanceState, opts?: CustomResourceOptions): ReservedInstance
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config_id: Optional[str] = None,
end_time: Optional[str] = None,
instance_count: Optional[float] = None,
reserved_instance_id: Optional[str] = None,
reserved_instance_name: Optional[str] = None,
start_time: Optional[str] = None,
status: Optional[str] = None) -> ReservedInstance
func GetReservedInstance(ctx *Context, name string, id IDInput, state *ReservedInstanceState, opts ...ResourceOption) (*ReservedInstance, error)
public static ReservedInstance Get(string name, Input<string> id, ReservedInstanceState? state, CustomResourceOptions? opts = null)
public static ReservedInstance get(String name, Output<String> id, ReservedInstanceState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ReservedInstance 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.
- Config
Id string - Configuration ID of the reserved instance.
- End
Time string - Expiry time of the RI.
- Instance
Count double - Number of reserved instances to be purchased.
- Reserved
Instance stringId - ID of the resource.
- Reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- Start
Time string - Start time of the RI.
- Status string
- Status of the RI at the time of purchase.
- Config
Id string - Configuration ID of the reserved instance.
- End
Time string - Expiry time of the RI.
- Instance
Count float64 - Number of reserved instances to be purchased.
- Reserved
Instance stringId - ID of the resource.
- Reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- Start
Time string - Start time of the RI.
- Status string
- Status of the RI at the time of purchase.
- config
Id String - Configuration ID of the reserved instance.
- end
Time String - Expiry time of the RI.
- instance
Count Double - Number of reserved instances to be purchased.
- reserved
Instance StringId - ID of the resource.
- reserved
Instance StringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- start
Time String - Start time of the RI.
- status String
- Status of the RI at the time of purchase.
- config
Id string - Configuration ID of the reserved instance.
- end
Time string - Expiry time of the RI.
- instance
Count number - Number of reserved instances to be purchased.
- reserved
Instance stringId - ID of the resource.
- reserved
Instance stringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- start
Time string - Start time of the RI.
- status string
- Status of the RI at the time of purchase.
- config_
id str - Configuration ID of the reserved instance.
- end_
time str - Expiry time of the RI.
- instance_
count float - Number of reserved instances to be purchased.
- reserved_
instance_ strid - ID of the resource.
- reserved_
instance_ strname - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- start_
time str - Start time of the RI.
- status str
- Status of the RI at the time of purchase.
- config
Id String - Configuration ID of the reserved instance.
- end
Time String - Expiry time of the RI.
- instance
Count Number - Number of reserved instances to be purchased.
- reserved
Instance StringId - ID of the resource.
- reserved
Instance StringName - Reserved Instance display name.
- If you do not specify an instance display name, 'Unnamed' is displayed by default.
- Up to 60 characters (including pattern strings) are supported.
- start
Time String - Start time of the RI.
- status String
- Status of the RI at the time of purchase.
Import
Reserved instance can be imported using the id, e.g.
$ pulumi import tencentcloud:index/reservedInstance:ReservedInstance foo 6cc16e7c-47d7-4fae-9b44-ce5c0f59a920
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.