Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

QuotaRateLimit

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 for more information.

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var @global = new Vault.QuotaRateLimit("global", new Vault.QuotaRateLimitArgs
        {
            Path = "",
            Rate = 100,
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := vault.NewQuotaRateLimit(ctx, "global", &vault.QuotaRateLimitArgs{
            Path: pulumi.String(""),
            Rate: pulumi.Float64(100),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_vault as vault

global_ = vault.QuotaRateLimit("global",
    path="",
    rate=100)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const global = new vault.QuotaRateLimit("global", {
    path: "",
    rate: 100,
});

Create a QuotaRateLimit Resource

new QuotaRateLimit(name: string, args: QuotaRateLimitArgs, opts?: CustomResourceOptions);
def QuotaRateLimit(resource_name: str, opts: Optional[ResourceOptions] = None, name: Optional[str] = None, path: Optional[str] = None, rate: Optional[float] = None)
func NewQuotaRateLimit(ctx *Context, name string, args QuotaRateLimitArgs, opts ...ResourceOption) (*QuotaRateLimit, error)
public QuotaRateLimit(string name, QuotaRateLimitArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args QuotaRateLimitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args QuotaRateLimitArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args QuotaRateLimitArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

QuotaRateLimit Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The QuotaRateLimit resource accepts the following input properties:

Rate double

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

Name string

Name of the rate limit quota

Path string

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.

Rate float64

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

Name string

Name of the rate limit quota

Path string

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.

rate number

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

name string

Name of the rate limit quota

path string

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.

rate float

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

name str

Name of the rate limit quota

path str

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the QuotaRateLimit 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 QuotaRateLimit Resource

Get an existing QuotaRateLimit 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?: QuotaRateLimitState, opts?: CustomResourceOptions): QuotaRateLimit
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, name: Optional[str] = None, path: Optional[str] = None, rate: Optional[float] = None) -> QuotaRateLimit
func GetQuotaRateLimit(ctx *Context, name string, id IDInput, state *QuotaRateLimitState, opts ...ResourceOption) (*QuotaRateLimit, error)
public static QuotaRateLimit Get(string name, Input<string> id, QuotaRateLimitState? 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:

Name string

Name of the rate limit quota

Path string

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.

Rate double

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

Name string

Name of the rate limit quota

Path string

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.

Rate float64

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

name string

Name of the rate limit quota

path string

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.

rate number

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

name str

Name of the rate limit quota

path str

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.

rate float

The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.

Import

Rate limit quotas can be imported using their names

 $ pulumi import vault:index/quotaRateLimit:QuotaRateLimit global global

Package Details

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