packet.SpotMarketRequest
Explore with Pulumi AI
Provides a Packet Spot Market Request resource to allow you to manage spot market requests on your account. For more detail on Spot Market, see this article in Packet documentaion.
Example Usage
using Pulumi;
using Packet = Pulumi.Packet;
class MyStack : Stack
{
public MyStack()
{
// Create a spot market request
var req = new Packet.SpotMarketRequest("req", new Packet.SpotMarketRequestArgs
{
ProjectId = local.Project_id,
MaxBidPrice = 0.03,
Facilities =
{
"ewr1",
},
DevicesMin = 1,
DevicesMax = 1,
InstanceParameters = new Packet.Inputs.SpotMarketRequestInstanceParametersArgs
{
Hostname = "testspot",
BillingCycle = "hourly",
OperatingSystem = "coreos_stable",
Plan = "t1.small.x86",
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-packet/sdk/v3/go/packet"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := packet.NewSpotMarketRequest(ctx, "req", &packet.SpotMarketRequestArgs{
ProjectId: pulumi.Any(local.Project_id),
MaxBidPrice: pulumi.Float64(0.03),
Facilities: pulumi.StringArray{
pulumi.String("ewr1"),
},
DevicesMin: pulumi.Int(1),
DevicesMax: pulumi.Int(1),
InstanceParameters: &packet.SpotMarketRequestInstanceParametersArgs{
Hostname: pulumi.String("testspot"),
BillingCycle: pulumi.String("hourly"),
OperatingSystem: pulumi.String("coreos_stable"),
Plan: pulumi.String("t1.small.x86"),
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_packet as packet
# Create a spot market request
req = packet.SpotMarketRequest("req",
project_id=local["project_id"],
max_bid_price=0.03,
facilities=["ewr1"],
devices_min=1,
devices_max=1,
instance_parameters=packet.SpotMarketRequestInstanceParametersArgs(
hostname="testspot",
billing_cycle="hourly",
operating_system="coreos_stable",
plan="t1.small.x86",
))
import * as pulumi from "@pulumi/pulumi";
import * as packet from "@pulumi/packet";
// Create a spot market request
const req = new packet.SpotMarketRequest("req", {
projectId: local.project_id,
maxBidPrice: 0.03,
facilities: ["ewr1"],
devicesMin: 1,
devicesMax: 1,
instanceParameters: {
hostname: "testspot",
billingCycle: "hourly",
operatingSystem: "coreos_stable",
plan: "t1.small.x86",
},
});
Coming soon!
Create SpotMarketRequest Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SpotMarketRequest(name: string, args: SpotMarketRequestArgs, opts?: CustomResourceOptions);
@overload
def SpotMarketRequest(resource_name: str,
args: SpotMarketRequestArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SpotMarketRequest(resource_name: str,
opts: Optional[ResourceOptions] = None,
devices_max: Optional[int] = None,
devices_min: Optional[int] = None,
facilities: Optional[Sequence[str]] = None,
instance_parameters: Optional[SpotMarketRequestInstanceParametersArgs] = None,
max_bid_price: Optional[float] = None,
project_id: Optional[str] = None,
wait_for_devices: Optional[bool] = None)
func NewSpotMarketRequest(ctx *Context, name string, args SpotMarketRequestArgs, opts ...ResourceOption) (*SpotMarketRequest, error)
public SpotMarketRequest(string name, SpotMarketRequestArgs args, CustomResourceOptions? opts = null)
public SpotMarketRequest(String name, SpotMarketRequestArgs args)
public SpotMarketRequest(String name, SpotMarketRequestArgs args, CustomResourceOptions options)
type: packet:SpotMarketRequest
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 SpotMarketRequestArgs
- 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 SpotMarketRequestArgs
- 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 SpotMarketRequestArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SpotMarketRequestArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SpotMarketRequestArgs
- 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 spotMarketRequestResource = new Packet.SpotMarketRequest("spotMarketRequestResource", new()
{
DevicesMax = 0,
DevicesMin = 0,
Facilities = new[]
{
"string",
},
InstanceParameters = new Packet.Inputs.SpotMarketRequestInstanceParametersArgs
{
BillingCycle = "string",
Hostname = "string",
OperatingSystem = "string",
Plan = "string",
AlwaysPxe = "string",
Description = "string",
Features = new[]
{
"string",
},
Locked = "string",
ProjectSshKeys = new[]
{
"string",
},
TermintationTime = "string",
UserSshKeys = new[]
{
"string",
},
Userdata = "string",
},
MaxBidPrice = 0,
ProjectId = "string",
WaitForDevices = false,
});
example, err := packet.NewSpotMarketRequest(ctx, "spotMarketRequestResource", &packet.SpotMarketRequestArgs{
DevicesMax: pulumi.Int(0),
DevicesMin: pulumi.Int(0),
Facilities: pulumi.StringArray{
pulumi.String("string"),
},
InstanceParameters: &packet.SpotMarketRequestInstanceParametersArgs{
BillingCycle: pulumi.String("string"),
Hostname: pulumi.String("string"),
OperatingSystem: pulumi.String("string"),
Plan: pulumi.String("string"),
AlwaysPxe: pulumi.String("string"),
Description: pulumi.String("string"),
Features: pulumi.StringArray{
pulumi.String("string"),
},
Locked: pulumi.String("string"),
ProjectSshKeys: pulumi.StringArray{
pulumi.String("string"),
},
TermintationTime: pulumi.String("string"),
UserSshKeys: pulumi.StringArray{
pulumi.String("string"),
},
Userdata: pulumi.String("string"),
},
MaxBidPrice: pulumi.Float64(0),
ProjectId: pulumi.String("string"),
WaitForDevices: pulumi.Bool(false),
})
var spotMarketRequestResource = new SpotMarketRequest("spotMarketRequestResource", SpotMarketRequestArgs.builder()
.devicesMax(0)
.devicesMin(0)
.facilities("string")
.instanceParameters(SpotMarketRequestInstanceParametersArgs.builder()
.billingCycle("string")
.hostname("string")
.operatingSystem("string")
.plan("string")
.alwaysPxe("string")
.description("string")
.features("string")
.locked("string")
.projectSshKeys("string")
.termintationTime("string")
.userSshKeys("string")
.userdata("string")
.build())
.maxBidPrice(0)
.projectId("string")
.waitForDevices(false)
.build());
spot_market_request_resource = packet.SpotMarketRequest("spotMarketRequestResource",
devices_max=0,
devices_min=0,
facilities=["string"],
instance_parameters={
"billing_cycle": "string",
"hostname": "string",
"operating_system": "string",
"plan": "string",
"always_pxe": "string",
"description": "string",
"features": ["string"],
"locked": "string",
"project_ssh_keys": ["string"],
"termintation_time": "string",
"user_ssh_keys": ["string"],
"userdata": "string",
},
max_bid_price=0,
project_id="string",
wait_for_devices=False)
const spotMarketRequestResource = new packet.SpotMarketRequest("spotMarketRequestResource", {
devicesMax: 0,
devicesMin: 0,
facilities: ["string"],
instanceParameters: {
billingCycle: "string",
hostname: "string",
operatingSystem: "string",
plan: "string",
alwaysPxe: "string",
description: "string",
features: ["string"],
locked: "string",
projectSshKeys: ["string"],
termintationTime: "string",
userSshKeys: ["string"],
userdata: "string",
},
maxBidPrice: 0,
projectId: "string",
waitForDevices: false,
});
type: packet:SpotMarketRequest
properties:
devicesMax: 0
devicesMin: 0
facilities:
- string
instanceParameters:
alwaysPxe: string
billingCycle: string
description: string
features:
- string
hostname: string
locked: string
operatingSystem: string
plan: string
projectSshKeys:
- string
termintationTime: string
userSshKeys:
- string
userdata: string
maxBidPrice: 0
projectId: string
waitForDevices: false
SpotMarketRequest 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 SpotMarketRequest resource accepts the following input properties:
- Devices
Max int - Maximum number devices to be created
- Devices
Min int - Miniumum number devices to be created
- Facilities List<string>
- Facility IDs where devices should be created
- Instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- Max
Bid doublePrice - Maximum price user is willing to pay per hour per device
- Project
Id string - Project ID
- Wait
For boolDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- Devices
Max int - Maximum number devices to be created
- Devices
Min int - Miniumum number devices to be created
- Facilities []string
- Facility IDs where devices should be created
- Instance
Parameters SpotMarket Request Instance Parameters Args - Device parameters. See device resource for details
- Max
Bid float64Price - Maximum price user is willing to pay per hour per device
- Project
Id string - Project ID
- Wait
For boolDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max Integer - Maximum number devices to be created
- devices
Min Integer - Miniumum number devices to be created
- facilities List<String>
- Facility IDs where devices should be created
- instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- max
Bid DoublePrice - Maximum price user is willing to pay per hour per device
- project
Id String - Project ID
- wait
For BooleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max number - Maximum number devices to be created
- devices
Min number - Miniumum number devices to be created
- facilities string[]
- Facility IDs where devices should be created
- instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- max
Bid numberPrice - Maximum price user is willing to pay per hour per device
- project
Id string - Project ID
- wait
For booleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices_
max int - Maximum number devices to be created
- devices_
min int - Miniumum number devices to be created
- facilities Sequence[str]
- Facility IDs where devices should be created
- instance_
parameters SpotMarket Request Instance Parameters Args - Device parameters. See device resource for details
- max_
bid_ floatprice - Maximum price user is willing to pay per hour per device
- project_
id str - Project ID
- wait_
for_ booldevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max Number - Maximum number devices to be created
- devices
Min Number - Miniumum number devices to be created
- facilities List<String>
- Facility IDs where devices should be created
- instance
Parameters Property Map - Device parameters. See device resource for details
- max
Bid NumberPrice - Maximum price user is willing to pay per hour per device
- project
Id String - Project ID
- wait
For BooleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
Outputs
All input properties are implicitly available as output properties. Additionally, the SpotMarketRequest 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 SpotMarketRequest Resource
Get an existing SpotMarketRequest 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?: SpotMarketRequestState, opts?: CustomResourceOptions): SpotMarketRequest
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
devices_max: Optional[int] = None,
devices_min: Optional[int] = None,
facilities: Optional[Sequence[str]] = None,
instance_parameters: Optional[SpotMarketRequestInstanceParametersArgs] = None,
max_bid_price: Optional[float] = None,
project_id: Optional[str] = None,
wait_for_devices: Optional[bool] = None) -> SpotMarketRequest
func GetSpotMarketRequest(ctx *Context, name string, id IDInput, state *SpotMarketRequestState, opts ...ResourceOption) (*SpotMarketRequest, error)
public static SpotMarketRequest Get(string name, Input<string> id, SpotMarketRequestState? state, CustomResourceOptions? opts = null)
public static SpotMarketRequest get(String name, Output<String> id, SpotMarketRequestState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Devices
Max int - Maximum number devices to be created
- Devices
Min int - Miniumum number devices to be created
- Facilities List<string>
- Facility IDs where devices should be created
- Instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- Max
Bid doublePrice - Maximum price user is willing to pay per hour per device
- Project
Id string - Project ID
- Wait
For boolDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- Devices
Max int - Maximum number devices to be created
- Devices
Min int - Miniumum number devices to be created
- Facilities []string
- Facility IDs where devices should be created
- Instance
Parameters SpotMarket Request Instance Parameters Args - Device parameters. See device resource for details
- Max
Bid float64Price - Maximum price user is willing to pay per hour per device
- Project
Id string - Project ID
- Wait
For boolDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max Integer - Maximum number devices to be created
- devices
Min Integer - Miniumum number devices to be created
- facilities List<String>
- Facility IDs where devices should be created
- instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- max
Bid DoublePrice - Maximum price user is willing to pay per hour per device
- project
Id String - Project ID
- wait
For BooleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max number - Maximum number devices to be created
- devices
Min number - Miniumum number devices to be created
- facilities string[]
- Facility IDs where devices should be created
- instance
Parameters SpotMarket Request Instance Parameters - Device parameters. See device resource for details
- max
Bid numberPrice - Maximum price user is willing to pay per hour per device
- project
Id string - Project ID
- wait
For booleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices_
max int - Maximum number devices to be created
- devices_
min int - Miniumum number devices to be created
- facilities Sequence[str]
- Facility IDs where devices should be created
- instance_
parameters SpotMarket Request Instance Parameters Args - Device parameters. See device resource for details
- max_
bid_ floatprice - Maximum price user is willing to pay per hour per device
- project_
id str - Project ID
- wait_
for_ booldevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
- devices
Max Number - Maximum number devices to be created
- devices
Min Number - Miniumum number devices to be created
- facilities List<String>
- Facility IDs where devices should be created
- instance
Parameters Property Map - Device parameters. See device resource for details
- max
Bid NumberPrice - Maximum price user is willing to pay per hour per device
- project
Id String - Project ID
- wait
For BooleanDevices - On resource creation - wait until all desired devices are active, on resource destruction - wait until devices are removed
Supporting Types
SpotMarketRequestInstanceParameters, SpotMarketRequestInstanceParametersArgs
- Billing
Cycle string - Hostname string
- Operating
System string - Plan string
- Always
Pxe string - Description string
- Features List<string>
- Locked string
- Project
Ssh List<string>Keys - Termintation
Time string - User
Ssh List<string>Keys - Userdata string
- Billing
Cycle string - Hostname string
- Operating
System string - Plan string
- Always
Pxe string - Description string
- Features []string
- Locked string
- Project
Ssh []stringKeys - Termintation
Time string - User
Ssh []stringKeys - Userdata string
- billing
Cycle String - hostname String
- operating
System String - plan String
- always
Pxe String - description String
- features List<String>
- locked String
- project
Ssh List<String>Keys - termintation
Time String - user
Ssh List<String>Keys - userdata String
- billing
Cycle string - hostname string
- operating
System string - plan string
- always
Pxe string - description string
- features string[]
- locked string
- project
Ssh string[]Keys - termintation
Time string - user
Ssh string[]Keys - userdata string
- billing_
cycle str - hostname str
- operating_
system str - plan str
- always_
pxe str - description str
- features Sequence[str]
- locked str
- project_
ssh_ Sequence[str]keys - termintation_
time str - user_
ssh_ Sequence[str]keys - userdata str
- billing
Cycle String - hostname String
- operating
System String - plan String
- always
Pxe String - description String
- features List<String>
- locked String
- project
Ssh List<String>Keys - termintation
Time String - user
Ssh List<String>Keys - userdata String
Package Details
- Repository
- Packet pulumi/pulumi-packet
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
packet
Terraform Provider.