HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

QuoteSpecification

Manages a quota specification in a Nomad cluster.

Example Usage

using Pulumi;
using Nomad = Pulumi.Nomad;

class MyStack : Stack
{
    public MyStack()
    {
        var prodApi = new Nomad.QuoteSpecification("prodApi", new Nomad.QuoteSpecificationArgs
        {
            Description = "Production instances of backend API servers",
            Limits = 
            {
                new Nomad.Inputs.QuoteSpecificationLimitArgs
                {
                    Region = "global",
                    RegionLimit = new Nomad.Inputs.QuoteSpecificationLimitRegionLimitArgs
                    {
                        Cpu = 2400,
                        MemoryMb = 1200,
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-nomad/sdk/go/nomad"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nomad.NewQuoteSpecification(ctx, "prodApi", &nomad.QuoteSpecificationArgs{
			Description: pulumi.String("Production instances of backend API servers"),
			Limits: QuoteSpecificationLimitArray{
				&QuoteSpecificationLimitArgs{
					Region: pulumi.String("global"),
					RegionLimit: &QuoteSpecificationLimitRegionLimitArgs{
						Cpu:      pulumi.Int(2400),
						MemoryMb: pulumi.Int(1200),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_nomad as nomad

prod_api = nomad.QuoteSpecification("prodApi",
    description="Production instances of backend API servers",
    limits=[nomad.QuoteSpecificationLimitArgs(
        region="global",
        region_limit=nomad.QuoteSpecificationLimitRegionLimitArgs(
            cpu=2400,
            memory_mb=1200,
        ),
    )])
import * as pulumi from "@pulumi/pulumi";
import * as nomad from "@pulumi/nomad";

const prodApi = new nomad.QuoteSpecification("prod_api", {
    description: "Production instances of backend API servers",
    limits: [{
        region: "global",
        regionLimit: {
            cpu: 2400,
            memoryMb: 1200,
        },
    }],
});

Create a QuoteSpecification Resource

new QuoteSpecification(name: string, args: QuoteSpecificationArgs, opts?: CustomResourceOptions);
@overload
def QuoteSpecification(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       description: Optional[str] = None,
                       limits: Optional[Sequence[QuoteSpecificationLimitArgs]] = None,
                       name: Optional[str] = None)
@overload
def QuoteSpecification(resource_name: str,
                       args: QuoteSpecificationArgs,
                       opts: Optional[ResourceOptions] = None)
func NewQuoteSpecification(ctx *Context, name string, args QuoteSpecificationArgs, opts ...ResourceOption) (*QuoteSpecification, error)
public QuoteSpecification(string name, QuoteSpecificationArgs args, CustomResourceOptions? opts = null)
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.

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

The QuoteSpecification resource accepts the following input properties:

Limits List<QuoteSpecificationLimitArgs>
(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 []QuoteSpecificationLimitArgs
(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 QuoteSpecificationLimitArgs[]
(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[QuoteSpecificationLimitArgs]
(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.

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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.

The following state arguments are supported:

Description string
(string: "") - A description of the quota specification.
Limits List<QuoteSpecificationLimitArgs>
(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 []QuoteSpecificationLimitArgs
(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 QuoteSpecificationLimitArgs[]
(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[QuoteSpecificationLimitArgs]
(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.

Supporting Types

QuoteSpecificationLimit

Region string
(string: <required>) - The region these limits should apply to.
RegionLimit QuoteSpecificationLimitRegionLimit
(block: <required>) - The limits to enforce. This block may only be specified once in the limits block. Its structure is documented below.
Region string
(string: <required>) - The region these limits should apply to.
RegionLimit QuoteSpecificationLimitRegionLimit
(block: <required>) - The limits to enforce. This block may only be specified once in the limits block. Its structure is documented below.
region string
(string: <required>) - The region these limits should apply to.
regionLimit QuoteSpecificationLimitRegionLimit
(block: <required>) - The limits to enforce. This block may only be specified once in the limits block. Its structure is documented below.
region str
(string: <required>) - The region these limits should apply to.
region_limit QuoteSpecificationLimitRegionLimit
(block: <required>) - The limits to enforce. This block may only be specified once in the limits block. Its structure is documented below.

QuoteSpecificationLimitRegionLimit

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.
MemoryMb 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.
MemoryMb 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.
memoryMb 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.

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.