ibm.ComputeReservedCapacity
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const reserved = new ibm.ComputeReservedCapacity("reserved", {
datacenter: "lon02",
flavor: "B1_4X16_1_YEAR_TERM",
instances: 6,
pod: "pod01",
});
import pulumi
import pulumi_ibm as ibm
reserved = ibm.ComputeReservedCapacity("reserved",
datacenter="lon02",
flavor="B1_4X16_1_YEAR_TERM",
instances=6,
pod="pod01")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewComputeReservedCapacity(ctx, "reserved", &ibm.ComputeReservedCapacityArgs{
Datacenter: pulumi.String("lon02"),
Flavor: pulumi.String("B1_4X16_1_YEAR_TERM"),
Instances: pulumi.Float64(6),
Pod: pulumi.String("pod01"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var reserved = new Ibm.ComputeReservedCapacity("reserved", new()
{
Datacenter = "lon02",
Flavor = "B1_4X16_1_YEAR_TERM",
Instances = 6,
Pod = "pod01",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.ComputeReservedCapacity;
import com.pulumi.ibm.ComputeReservedCapacityArgs;
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 reserved = new ComputeReservedCapacity("reserved", ComputeReservedCapacityArgs.builder()
.datacenter("lon02")
.flavor("B1_4X16_1_YEAR_TERM")
.instances(6)
.pod("pod01")
.build());
}
}
resources:
reserved:
type: ibm:ComputeReservedCapacity
properties:
datacenter: lon02
flavor: B1_4X16_1_YEAR_TERM
instances: 6
pod: pod01
Create ComputeReservedCapacity Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ComputeReservedCapacity(name: string, args: ComputeReservedCapacityArgs, opts?: CustomResourceOptions);
@overload
def ComputeReservedCapacity(resource_name: str,
args: ComputeReservedCapacityArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ComputeReservedCapacity(resource_name: str,
opts: Optional[ResourceOptions] = None,
datacenter: Optional[str] = None,
flavor: Optional[str] = None,
instances: Optional[float] = None,
pod: Optional[str] = None,
compute_reserved_capacity_id: Optional[str] = None,
force_create: Optional[bool] = None,
name: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
timeouts: Optional[ComputeReservedCapacityTimeoutsArgs] = None)
func NewComputeReservedCapacity(ctx *Context, name string, args ComputeReservedCapacityArgs, opts ...ResourceOption) (*ComputeReservedCapacity, error)
public ComputeReservedCapacity(string name, ComputeReservedCapacityArgs args, CustomResourceOptions? opts = null)
public ComputeReservedCapacity(String name, ComputeReservedCapacityArgs args)
public ComputeReservedCapacity(String name, ComputeReservedCapacityArgs args, CustomResourceOptions options)
type: ibm:ComputeReservedCapacity
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 ComputeReservedCapacityArgs
- 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 ComputeReservedCapacityArgs
- 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 ComputeReservedCapacityArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ComputeReservedCapacityArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ComputeReservedCapacityArgs
- 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 computeReservedCapacityResource = new Ibm.ComputeReservedCapacity("computeReservedCapacityResource", new()
{
Datacenter = "string",
Flavor = "string",
Instances = 0,
Pod = "string",
ComputeReservedCapacityId = "string",
ForceCreate = false,
Name = "string",
Tags = new[]
{
"string",
},
Timeouts = new Ibm.Inputs.ComputeReservedCapacityTimeoutsArgs
{
Create = "string",
},
});
example, err := ibm.NewComputeReservedCapacity(ctx, "computeReservedCapacityResource", &ibm.ComputeReservedCapacityArgs{
Datacenter: pulumi.String("string"),
Flavor: pulumi.String("string"),
Instances: pulumi.Float64(0),
Pod: pulumi.String("string"),
ComputeReservedCapacityId: pulumi.String("string"),
ForceCreate: pulumi.Bool(false),
Name: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
Timeouts: &ibm.ComputeReservedCapacityTimeoutsArgs{
Create: pulumi.String("string"),
},
})
var computeReservedCapacityResource = new ComputeReservedCapacity("computeReservedCapacityResource", ComputeReservedCapacityArgs.builder()
.datacenter("string")
.flavor("string")
.instances(0)
.pod("string")
.computeReservedCapacityId("string")
.forceCreate(false)
.name("string")
.tags("string")
.timeouts(ComputeReservedCapacityTimeoutsArgs.builder()
.create("string")
.build())
.build());
compute_reserved_capacity_resource = ibm.ComputeReservedCapacity("computeReservedCapacityResource",
datacenter="string",
flavor="string",
instances=0,
pod="string",
compute_reserved_capacity_id="string",
force_create=False,
name="string",
tags=["string"],
timeouts={
"create": "string",
})
const computeReservedCapacityResource = new ibm.ComputeReservedCapacity("computeReservedCapacityResource", {
datacenter: "string",
flavor: "string",
instances: 0,
pod: "string",
computeReservedCapacityId: "string",
forceCreate: false,
name: "string",
tags: ["string"],
timeouts: {
create: "string",
},
});
type: ibm:ComputeReservedCapacity
properties:
computeReservedCapacityId: string
datacenter: string
flavor: string
forceCreate: false
instances: 0
name: string
pod: string
tags:
- string
timeouts:
create: string
ComputeReservedCapacity 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 ComputeReservedCapacity resource accepts the following input properties:
- Datacenter string
- The datacenter in which you want to provision the reserved capacity.
- Flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- Instances double
- Number of VSI instances this capacity reservation can support.
- Pod string
- The data center pod where you want to create the reserved capacity.
- Compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- Force
Create bool - Force the creation of reserved capacity with same name.
- Name string
- The descriptive that is used to identify a reserved capacity.
- List<string>
- List of tags
- Timeouts
Compute
Reserved Capacity Timeouts
- Datacenter string
- The datacenter in which you want to provision the reserved capacity.
- Flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- Instances float64
- Number of VSI instances this capacity reservation can support.
- Pod string
- The data center pod where you want to create the reserved capacity.
- Compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- Force
Create bool - Force the creation of reserved capacity with same name.
- Name string
- The descriptive that is used to identify a reserved capacity.
- []string
- List of tags
- Timeouts
Compute
Reserved Capacity Timeouts Args
- datacenter String
- The datacenter in which you want to provision the reserved capacity.
- flavor String
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- instances Double
- Number of VSI instances this capacity reservation can support.
- pod String
- The data center pod where you want to create the reserved capacity.
- compute
Reserved StringCapacity Id - (String) The unique identifier of the new reserved capacity.
- force
Create Boolean - Force the creation of reserved capacity with same name.
- name String
- The descriptive that is used to identify a reserved capacity.
- List<String>
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts
- datacenter string
- The datacenter in which you want to provision the reserved capacity.
- flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- instances number
- Number of VSI instances this capacity reservation can support.
- pod string
- The data center pod where you want to create the reserved capacity.
- compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- force
Create boolean - Force the creation of reserved capacity with same name.
- name string
- The descriptive that is used to identify a reserved capacity.
- string[]
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts
- datacenter str
- The datacenter in which you want to provision the reserved capacity.
- flavor str
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- instances float
- Number of VSI instances this capacity reservation can support.
- pod str
- The data center pod where you want to create the reserved capacity.
- compute_
reserved_ strcapacity_ id - (String) The unique identifier of the new reserved capacity.
- force_
create bool - Force the creation of reserved capacity with same name.
- name str
- The descriptive that is used to identify a reserved capacity.
- Sequence[str]
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts Args
- datacenter String
- The datacenter in which you want to provision the reserved capacity.
- flavor String
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- instances Number
- Number of VSI instances this capacity reservation can support.
- pod String
- The data center pod where you want to create the reserved capacity.
- compute
Reserved StringCapacity Id - (String) The unique identifier of the new reserved capacity.
- force
Create Boolean - Force the creation of reserved capacity with same name.
- name String
- The descriptive that is used to identify a reserved capacity.
- List<String>
- List of tags
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the ComputeReservedCapacity resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ComputeReservedCapacity Resource
Get an existing ComputeReservedCapacity 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?: ComputeReservedCapacityState, opts?: CustomResourceOptions): ComputeReservedCapacity
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
compute_reserved_capacity_id: Optional[str] = None,
datacenter: Optional[str] = None,
flavor: Optional[str] = None,
force_create: Optional[bool] = None,
instances: Optional[float] = None,
name: Optional[str] = None,
pod: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
timeouts: Optional[ComputeReservedCapacityTimeoutsArgs] = None) -> ComputeReservedCapacity
func GetComputeReservedCapacity(ctx *Context, name string, id IDInput, state *ComputeReservedCapacityState, opts ...ResourceOption) (*ComputeReservedCapacity, error)
public static ComputeReservedCapacity Get(string name, Input<string> id, ComputeReservedCapacityState? state, CustomResourceOptions? opts = null)
public static ComputeReservedCapacity get(String name, Output<String> id, ComputeReservedCapacityState state, CustomResourceOptions options)
resources: _: type: ibm:ComputeReservedCapacity 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.
- Compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- Datacenter string
- The datacenter in which you want to provision the reserved capacity.
- Flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- Force
Create bool - Force the creation of reserved capacity with same name.
- Instances double
- Number of VSI instances this capacity reservation can support.
- Name string
- The descriptive that is used to identify a reserved capacity.
- Pod string
- The data center pod where you want to create the reserved capacity.
- List<string>
- List of tags
- Timeouts
Compute
Reserved Capacity Timeouts
- Compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- Datacenter string
- The datacenter in which you want to provision the reserved capacity.
- Flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- Force
Create bool - Force the creation of reserved capacity with same name.
- Instances float64
- Number of VSI instances this capacity reservation can support.
- Name string
- The descriptive that is used to identify a reserved capacity.
- Pod string
- The data center pod where you want to create the reserved capacity.
- []string
- List of tags
- Timeouts
Compute
Reserved Capacity Timeouts Args
- compute
Reserved StringCapacity Id - (String) The unique identifier of the new reserved capacity.
- datacenter String
- The datacenter in which you want to provision the reserved capacity.
- flavor String
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- force
Create Boolean - Force the creation of reserved capacity with same name.
- instances Double
- Number of VSI instances this capacity reservation can support.
- name String
- The descriptive that is used to identify a reserved capacity.
- pod String
- The data center pod where you want to create the reserved capacity.
- List<String>
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts
- compute
Reserved stringCapacity Id - (String) The unique identifier of the new reserved capacity.
- datacenter string
- The datacenter in which you want to provision the reserved capacity.
- flavor string
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- force
Create boolean - Force the creation of reserved capacity with same name.
- instances number
- Number of VSI instances this capacity reservation can support.
- name string
- The descriptive that is used to identify a reserved capacity.
- pod string
- The data center pod where you want to create the reserved capacity.
- string[]
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts
- compute_
reserved_ strcapacity_ id - (String) The unique identifier of the new reserved capacity.
- datacenter str
- The datacenter in which you want to provision the reserved capacity.
- flavor str
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- force_
create bool - Force the creation of reserved capacity with same name.
- instances float
- Number of VSI instances this capacity reservation can support.
- name str
- The descriptive that is used to identify a reserved capacity.
- pod str
- The data center pod where you want to create the reserved capacity.
- Sequence[str]
- List of tags
- timeouts
Compute
Reserved Capacity Timeouts Args
- compute
Reserved StringCapacity Id - (String) The unique identifier of the new reserved capacity.
- datacenter String
- The datacenter in which you want to provision the reserved capacity.
- flavor String
- Capacity keyname. For example, C1_2X2_1_YEAR_TERM.
- force
Create Boolean - Force the creation of reserved capacity with same name.
- instances Number
- Number of VSI instances this capacity reservation can support.
- name String
- The descriptive that is used to identify a reserved capacity.
- pod String
- The data center pod where you want to create the reserved capacity.
- List<String>
- List of tags
- timeouts Property Map
Supporting Types
ComputeReservedCapacityTimeouts, ComputeReservedCapacityTimeoutsArgs
- Create string
- Create string
- create String
- create string
- create str
- create String
Import
The ibm_compute_reserved_capacity
resource can be imported by using reserved capacity ID.
Example
$ pulumi import ibm:index/computeReservedCapacity:ComputeReservedCapacity example 88205074
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.