All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.nomad.kotlin.QuoteSpecificationArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.4.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.nomad.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import com.pulumi.nomad.QuoteSpecificationArgs.builder
import com.pulumi.nomad.kotlin.inputs.QuoteSpecificationLimitArgs
import com.pulumi.nomad.kotlin.inputs.QuoteSpecificationLimitArgsBuilder
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a quota specification in a Nomad cluster.
 * ## Example Usage
 * Registering a quota specification:
 * 
 * ```typescript
 * 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,
 *         },
 *     }],
 * });
 * ```
 * ```python
 * 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,
 *         },
 *     }])
 * ```
 * ```csharp
 * 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,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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
 * ```
 * 
 * @property description `(string: "")` - A description of the quota specification.
 * @property limits `(block: )` - A block of quota limits to enforce. Can
 * be repeated. See below for the structure of this block.
 * @property name `(string: )` - A unique name for the quota specification.
 */
public data class QuoteSpecificationArgs(
    public val description: Output? = null,
    public val limits: Output>? = null,
    public val name: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.nomad.QuoteSpecificationArgs =
        com.pulumi.nomad.QuoteSpecificationArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .limits(limits?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .name(name?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [QuoteSpecificationArgs].
 */
@PulumiTagMarker
public class QuoteSpecificationArgsBuilder internal constructor() {
    private var description: Output? = null

    private var limits: Output>? = null

    private var name: Output? = null

    /**
     * @param value `(string: "")` - A description of the quota specification.
     */
    @JvmName("twhmvrgyhitsdrgy")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("coiukepihefgvpef")
    public suspend fun limits(`value`: Output>) {
        this.limits = value
    }

    @JvmName("cgknmroxvhvisogl")
    public suspend fun limits(vararg values: Output) {
        this.limits = Output.all(values.asList())
    }

    /**
     * @param values `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("vgagenyriemdaeru")
    public suspend fun limits(values: List>) {
        this.limits = Output.all(values)
    }

    /**
     * @param value `(string: )` - A unique name for the quota specification.
     */
    @JvmName("auukychudhhktgye")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value `(string: "")` - A description of the quota specification.
     */
    @JvmName("fhplrrpqmdokbydl")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("gtpgwfmooyoremef")
    public suspend fun limits(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.limits = mapped
    }

    /**
     * @param argument `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("rsisspiwssfbpsgs")
    public suspend fun limits(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            QuoteSpecificationLimitArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.limits = mapped
    }

    /**
     * @param argument `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("okgvfjehxxwqvcok")
    public suspend fun limits(vararg argument: suspend QuoteSpecificationLimitArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            QuoteSpecificationLimitArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.limits = mapped
    }

    /**
     * @param argument `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("entoyyodlnqgufyi")
    public suspend fun limits(argument: suspend QuoteSpecificationLimitArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            QuoteSpecificationLimitArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.limits = mapped
    }

    /**
     * @param values `(block: )` - A block of quota limits to enforce. Can
     * be repeated. See below for the structure of this block.
     */
    @JvmName("vfamklshtfcepbjg")
    public suspend fun limits(vararg values: QuoteSpecificationLimitArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.limits = mapped
    }

    /**
     * @param value `(string: )` - A unique name for the quota specification.
     */
    @JvmName("ppahurqtnbqaujpw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    internal fun build(): QuoteSpecificationArgs = QuoteSpecificationArgs(
        description = description,
        limits = limits,
        name = name,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy