nomad.QuoteSpecification
Explore with Pulumi AI
Manages a quota specification in a Nomad cluster.
Example Usage
Registering a quota specification:
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";
const prodApi = new nomad.QuoteSpecification("prod_api", {
name: "prod-api",
description: "Production instances of backend API servers",
limits: [{
region: "global",
regionLimit: {
cpu: 2400,
memoryMb: 1200,
},
}],
});
import pulumi
import pulumi_nomad as nomad
prod_api = nomad.QuoteSpecification("prod_api",
name="prod-api",
description="Production instances of backend API servers",
limits=[{
"region": "global",
"region_limit": {
"cpu": 2400,
"memory_mb": 1200,
},
}])
package main
import (
"github.com/pulumi/pulumi-nomad/sdk/v2/go/nomad"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := nomad.NewQuoteSpecification(ctx, "prod_api", &nomad.QuoteSpecificationArgs{
Name: pulumi.String("prod-api"),
Description: pulumi.String("Production instances of backend API servers"),
Limits: nomad.QuoteSpecificationLimitArray{
&nomad.QuoteSpecificationLimitArgs{
Region: pulumi.String("global"),
RegionLimit: &nomad.QuoteSpecificationLimitRegionLimitArgs{
Cpu: pulumi.Int(2400),
MemoryMb: pulumi.Int(1200),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nomad = Pulumi.Nomad;
return await Deployment.RunAsync(() =>
{
var prodApi = new Nomad.QuoteSpecification("prod_api", new()
{
Name = "prod-api",
Description = "Production instances of backend API servers",
Limits = new[]
{
new Nomad.Inputs.QuoteSpecificationLimitArgs
{
Region = "global",
RegionLimit = new Nomad.Inputs.QuoteSpecificationLimitRegionLimitArgs
{
Cpu = 2400,
MemoryMb = 1200,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nomad.QuoteSpecification;
import com.pulumi.nomad.QuoteSpecificationArgs;
import com.pulumi.nomad.inputs.QuoteSpecificationLimitArgs;
import com.pulumi.nomad.inputs.QuoteSpecificationLimitRegionLimitArgs;
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 prodApi = new QuoteSpecification("prodApi", QuoteSpecificationArgs.builder()
.name("prod-api")
.description("Production instances of backend API servers")
.limits(QuoteSpecificationLimitArgs.builder()
.region("global")
.regionLimit(QuoteSpecificationLimitRegionLimitArgs.builder()
.cpu(2400)
.memoryMb(1200)
.build())
.build())
.build());
}
}
resources:
prodApi:
type: nomad:QuoteSpecification
name: prod_api
properties:
name: prod-api
description: Production instances of backend API servers
limits:
- region: global
regionLimit:
cpu: 2400
memoryMb: 1200
Create QuoteSpecification Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new QuoteSpecification(name: string, args: QuoteSpecificationArgs, opts?: CustomResourceOptions);
@overload
def QuoteSpecification(resource_name: str,
args: QuoteSpecificationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def QuoteSpecification(resource_name: str,
opts: Optional[ResourceOptions] = None,
limits: Optional[Sequence[QuoteSpecificationLimitArgs]] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewQuoteSpecification(ctx *Context, name string, args QuoteSpecificationArgs, opts ...ResourceOption) (*QuoteSpecification, error)
public QuoteSpecification(string name, QuoteSpecificationArgs args, CustomResourceOptions? opts = null)
public QuoteSpecification(String name, QuoteSpecificationArgs args)
public QuoteSpecification(String name, QuoteSpecificationArgs args, CustomResourceOptions options)
type: nomad:QuoteSpecification
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 QuoteSpecificationArgs
- 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 QuoteSpecificationArgs
- 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 QuoteSpecificationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args QuoteSpecificationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args QuoteSpecificationArgs
- 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 quoteSpecificationResource = new Nomad.QuoteSpecification("quoteSpecificationResource", new()
{
Limits = new[]
{
new Nomad.Inputs.QuoteSpecificationLimitArgs
{
Region = "string",
RegionLimit = new Nomad.Inputs.QuoteSpecificationLimitRegionLimitArgs
{
Cpu = 0,
MemoryMb = 0,
},
},
},
Description = "string",
Name = "string",
});
example, err := nomad.NewQuoteSpecification(ctx, "quoteSpecificationResource", &nomad.QuoteSpecificationArgs{
Limits: nomad.QuoteSpecificationLimitArray{
&nomad.QuoteSpecificationLimitArgs{
Region: pulumi.String("string"),
RegionLimit: &nomad.QuoteSpecificationLimitRegionLimitArgs{
Cpu: pulumi.Int(0),
MemoryMb: pulumi.Int(0),
},
},
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var quoteSpecificationResource = new QuoteSpecification("quoteSpecificationResource", QuoteSpecificationArgs.builder()
.limits(QuoteSpecificationLimitArgs.builder()
.region("string")
.regionLimit(QuoteSpecificationLimitRegionLimitArgs.builder()
.cpu(0)
.memoryMb(0)
.build())
.build())
.description("string")
.name("string")
.build());
quote_specification_resource = nomad.QuoteSpecification("quoteSpecificationResource",
limits=[{
"region": "string",
"region_limit": {
"cpu": 0,
"memory_mb": 0,
},
}],
description="string",
name="string")
const quoteSpecificationResource = new nomad.QuoteSpecification("quoteSpecificationResource", {
limits: [{
region: "string",
regionLimit: {
cpu: 0,
memoryMb: 0,
},
}],
description: "string",
name: "string",
});
type: nomad:QuoteSpecification
properties:
description: string
limits:
- region: string
regionLimit:
cpu: 0
memoryMb: 0
name: string
QuoteSpecification 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 QuoteSpecification resource accepts the following input properties:
- Limits
List<Quote
Specification Limit> (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- Description string
(string: "")
- A description of the quota specification.- Name string
(string: <required>)
- A unique name for the quota specification.
- Limits
[]Quote
Specification Limit Args (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- Description string
(string: "")
- A description of the quota specification.- Name string
(string: <required>)
- A unique name for the quota specification.
- limits
List<Quote
Specification Limit> (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- description String
(string: "")
- A description of the quota specification.- name String
(string: <required>)
- A unique name for the quota specification.
- limits
Quote
Specification Limit[] (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- description string
(string: "")
- A description of the quota specification.- name string
(string: <required>)
- A unique name for the quota specification.
- limits
Sequence[Quote
Specification Limit Args] (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- description str
(string: "")
- A description of the quota specification.- name str
(string: <required>)
- A unique name for the quota specification.
- limits List<Property Map>
(block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- description String
(string: "")
- A description of the quota specification.- name String
(string: <required>)
- A unique name for the quota specification.
Outputs
All input properties are implicitly available as output properties. Additionally, the QuoteSpecification 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 QuoteSpecification Resource
Get an existing QuoteSpecification 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?: QuoteSpecificationState, opts?: CustomResourceOptions): QuoteSpecification
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
limits: Optional[Sequence[QuoteSpecificationLimitArgs]] = None,
name: Optional[str] = None) -> QuoteSpecification
func GetQuoteSpecification(ctx *Context, name string, id IDInput, state *QuoteSpecificationState, opts ...ResourceOption) (*QuoteSpecification, error)
public static QuoteSpecification Get(string name, Input<string> id, QuoteSpecificationState? state, CustomResourceOptions? opts = null)
public static QuoteSpecification get(String name, Output<String> id, QuoteSpecificationState 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.
- Description string
(string: "")
- A description of the quota specification.- Limits
List<Quote
Specification Limit> (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- Name string
(string: <required>)
- A unique name for the quota specification.
- Description string
(string: "")
- A description of the quota specification.- Limits
[]Quote
Specification Limit Args (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- Name string
(string: <required>)
- A unique name for the quota specification.
- description String
(string: "")
- A description of the quota specification.- limits
List<Quote
Specification Limit> (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- name String
(string: <required>)
- A unique name for the quota specification.
- description string
(string: "")
- A description of the quota specification.- limits
Quote
Specification Limit[] (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- name string
(string: <required>)
- A unique name for the quota specification.
- description str
(string: "")
- A description of the quota specification.- limits
Sequence[Quote
Specification Limit Args] (block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- name str
(string: <required>)
- A unique name for the quota specification.
- description String
(string: "")
- A description of the quota specification.- limits List<Property Map>
(block: <required>)
- A block of quota limits to enforce. Can be repeated. See below for the structure of this block.- name String
(string: <required>)
- A unique name for the quota specification.
Supporting Types
QuoteSpecificationLimit, QuoteSpecificationLimitArgs
- Region string
(string: <required>)
- The region these limits should apply to.- Region
Limit QuoteSpecification Limit Region Limit (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
- Region string
(string: <required>)
- The region these limits should apply to.- Region
Limit QuoteSpecification Limit Region Limit (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
- region String
(string: <required>)
- The region these limits should apply to.- region
Limit QuoteSpecification Limit Region Limit (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
- region string
(string: <required>)
- The region these limits should apply to.- region
Limit QuoteSpecification Limit Region Limit (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
- region str
(string: <required>)
- The region these limits should apply to.- region_
limit QuoteSpecification Limit Region Limit (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
- region String
(string: <required>)
- The region these limits should apply to.- region
Limit Property Map (block: <required>)
- The limits to enforce. This block may only be specified once in thelimits
block. Its structure is documented below.
QuoteSpecificationLimitRegionLimit, QuoteSpecificationLimitRegionLimitArgs
- Cpu int
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- Memory
Mb int (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
- Cpu int
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- Memory
Mb int (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
- cpu Integer
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- memory
Mb Integer (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
- cpu number
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- memory
Mb number (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
- cpu int
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- memory_
mb int (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
- cpu Number
(int: 0)
- The amount of CPU to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.- memory
Mb Number (int: 0)
- The amount of memory (in megabytes) to limit allocations to. A value of zero is treated as unlimited, and a negative value is treated as fully disallowed.
Package Details
- Repository
- HashiCorp Nomad pulumi/pulumi-nomad
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nomad
Terraform Provider.