
com.pulumi.vault.kotlin.QuotaRateLimitArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-vault-kotlin Show documentation
Show all versions of pulumi-vault-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.vault.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.vault.QuotaRateLimitArgs.builder
import kotlin.Boolean
import kotlin.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manage rate limit quotas which enforce API rate limiting using a token bucket algorithm.
* A rate limit quota can be created at the root level or defined on a namespace or mount by
* specifying a path when creating the quota.
* See [Vault's Documentation](https://www.vaultproject.io/docs/concepts/resource-quotas) for more
* information.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vault from "@pulumi/vault";
* const global = new vault.QuotaRateLimit("global", {
* name: "global",
* path: "",
* rate: 100,
* });
* ```
* ```python
* import pulumi
* import pulumi_vault as vault
* global_ = vault.QuotaRateLimit("global",
* name="global",
* path="",
* rate=100)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Vault = Pulumi.Vault;
* return await Deployment.RunAsync(() =>
* {
* var @global = new Vault.QuotaRateLimit("global", new()
* {
* Name = "global",
* Path = "",
* Rate = 100,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := vault.NewQuotaRateLimit(ctx, "global", &vault.QuotaRateLimitArgs{
* Name: pulumi.String("global"),
* Path: pulumi.String(""),
* Rate: pulumi.Float64(100),
* })
* 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.vault.QuotaRateLimit;
* import com.pulumi.vault.QuotaRateLimitArgs;
* 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 global = new QuotaRateLimit("global", QuotaRateLimitArgs.builder()
* .name("global")
* .path("")
* .rate(100)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* global:
* type: vault:QuotaRateLimit
* properties:
* name: global
* path:
* rate: 100
* ```
*
* ## Import
* Rate limit quotas can be imported using their names
* ```sh
* $ pulumi import vault:index/quotaRateLimit:QuotaRateLimit global global
* ```
* @property blockInterval If set, when a client reaches a rate limit threshold, the client will
* be prohibited from any further requests until after the 'block_interval' in seconds has elapsed.
* @property inheritable If set to `true` on a quota where path is set to a namespace, the same quota will be cumulatively applied to all child namespace. The inheritable parameter cannot be set to `true` if the path does not specify a namespace. Only the quotas associated with the root namespace are inheritable by default. Requires Vault 1.15+.
* @property interval The duration in seconds to enforce rate limiting for.
* @property name Name of the rate limit quota
* @property namespace The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured namespace.
* *Available only for Vault Enterprise*.
* @property path Path of the mount or namespace to apply the quota. A blank path configures a
* global rate limit quota. For example `namespace1/` adds a quota to a full namespace,
* `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`.
* Updating this field on an existing quota can have "moving" effects. For example, updating
* `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to
* a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.**
* @property rate The maximum number of requests at any given second to be allowed by the quota
* rule. The `rate` must be positive.
* @property role If set on a quota where `path` is set to an auth mount with a concept of roles (such as /auth/approle/), this will make the quota restrict login requests to that mount that are made with the specified role.
*/
public data class QuotaRateLimitArgs(
public val blockInterval: Output? = null,
public val inheritable: Output? = null,
public val interval: Output? = null,
public val name: Output? = null,
public val namespace: Output? = null,
public val path: Output? = null,
public val rate: Output? = null,
public val role: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.vault.QuotaRateLimitArgs =
com.pulumi.vault.QuotaRateLimitArgs.builder()
.blockInterval(blockInterval?.applyValue({ args0 -> args0 }))
.inheritable(inheritable?.applyValue({ args0 -> args0 }))
.interval(interval?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.namespace(namespace?.applyValue({ args0 -> args0 }))
.path(path?.applyValue({ args0 -> args0 }))
.rate(rate?.applyValue({ args0 -> args0 }))
.role(role?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [QuotaRateLimitArgs].
*/
@PulumiTagMarker
public class QuotaRateLimitArgsBuilder internal constructor() {
private var blockInterval: Output? = null
private var inheritable: Output? = null
private var interval: Output? = null
private var name: Output? = null
private var namespace: Output? = null
private var path: Output? = null
private var rate: Output? = null
private var role: Output? = null
/**
* @param value If set, when a client reaches a rate limit threshold, the client will
* be prohibited from any further requests until after the 'block_interval' in seconds has elapsed.
*/
@JvmName("omqmwwdcojgttfas")
public suspend fun blockInterval(`value`: Output) {
this.blockInterval = value
}
/**
* @param value If set to `true` on a quota where path is set to a namespace, the same quota will be cumulatively applied to all child namespace. The inheritable parameter cannot be set to `true` if the path does not specify a namespace. Only the quotas associated with the root namespace are inheritable by default. Requires Vault 1.15+.
*/
@JvmName("kmfsceamnxmvyulp")
public suspend fun inheritable(`value`: Output) {
this.inheritable = value
}
/**
* @param value The duration in seconds to enforce rate limiting for.
*/
@JvmName("sseugoeywvmsqrhy")
public suspend fun interval(`value`: Output) {
this.interval = value
}
/**
* @param value Name of the rate limit quota
*/
@JvmName("qsnafkwxtvcnchmg")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured namespace.
* *Available only for Vault Enterprise*.
*/
@JvmName("qktfksaofxkbrfgt")
public suspend fun namespace(`value`: Output) {
this.namespace = value
}
/**
* @param value Path of the mount or namespace to apply the quota. A blank path configures a
* global rate limit quota. For example `namespace1/` adds a quota to a full namespace,
* `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`.
* Updating this field on an existing quota can have "moving" effects. For example, updating
* `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to
* a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.**
*/
@JvmName("brhtbvjayvkogtal")
public suspend fun path(`value`: Output) {
this.path = value
}
/**
* @param value The maximum number of requests at any given second to be allowed by the quota
* rule. The `rate` must be positive.
*/
@JvmName("palxkvqfkcdtuxfm")
public suspend fun rate(`value`: Output) {
this.rate = value
}
/**
* @param value If set on a quota where `path` is set to an auth mount with a concept of roles (such as /auth/approle/), this will make the quota restrict login requests to that mount that are made with the specified role.
*/
@JvmName("pjjkgfwjyhgjxgsh")
public suspend fun role(`value`: Output) {
this.role = value
}
/**
* @param value If set, when a client reaches a rate limit threshold, the client will
* be prohibited from any further requests until after the 'block_interval' in seconds has elapsed.
*/
@JvmName("ygmnxavsgoowiwfu")
public suspend fun blockInterval(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.blockInterval = mapped
}
/**
* @param value If set to `true` on a quota where path is set to a namespace, the same quota will be cumulatively applied to all child namespace. The inheritable parameter cannot be set to `true` if the path does not specify a namespace. Only the quotas associated with the root namespace are inheritable by default. Requires Vault 1.15+.
*/
@JvmName("cpqwcbtsilxsnlci")
public suspend fun inheritable(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.inheritable = mapped
}
/**
* @param value The duration in seconds to enforce rate limiting for.
*/
@JvmName("ystbxxrpowbptgiy")
public suspend fun interval(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.interval = mapped
}
/**
* @param value Name of the rate limit quota
*/
@JvmName("wrdllshugcsmhrqk")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The namespace to provision the resource in.
* The value should not contain leading or trailing forward slashes.
* The `namespace` is always relative to the provider's configured namespace.
* *Available only for Vault Enterprise*.
*/
@JvmName("pnbamelylaqhgbay")
public suspend fun namespace(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespace = mapped
}
/**
* @param value Path of the mount or namespace to apply the quota. A blank path configures a
* global rate limit quota. For example `namespace1/` adds a quota to a full namespace,
* `namespace1/auth/userpass` adds a `quota` to `userpass` in `namespace1`.
* Updating this field on an existing quota can have "moving" effects. For example, updating
* `auth/userpass` to `namespace1/auth/userpass` moves this quota from being a global mount quota to
* a namespace specific mount quota. **Note, namespaces are supported in Enterprise only.**
*/
@JvmName("josuiapicpiptfsc")
public suspend fun path(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.path = mapped
}
/**
* @param value The maximum number of requests at any given second to be allowed by the quota
* rule. The `rate` must be positive.
*/
@JvmName("chqlxhhhyyjwcwev")
public suspend fun rate(`value`: Double?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rate = mapped
}
/**
* @param value If set on a quota where `path` is set to an auth mount with a concept of roles (such as /auth/approle/), this will make the quota restrict login requests to that mount that are made with the specified role.
*/
@JvmName("eqqdmajrvwgkfogc")
public suspend fun role(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.role = mapped
}
internal fun build(): QuotaRateLimitArgs = QuotaRateLimitArgs(
blockInterval = blockInterval,
inheritable = inheritable,
interval = interval,
name = name,
namespace = namespace,
path = path,
rate = rate,
role = role,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy