1. Packages
  2. HashiCorp Vault
  3. API Docs
  4. QuotaRateLimit
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

vault.QuotaRateLimit

Explore with Pulumi AI

vault logo
HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi

    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

    import * as pulumi from "@pulumi/pulumi";
    import * as vault from "@pulumi/vault";
    
    const global = new vault.QuotaRateLimit("global", {
        path: "",
        rate: 100,
    });
    
    import pulumi
    import pulumi_vault as vault
    
    global_ = vault.QuotaRateLimit("global",
        path="",
        rate=100)
    
    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{
    			Path: pulumi.String(""),
    			Rate: pulumi.Float64(100),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vault = Pulumi.Vault;
    
    return await Deployment.RunAsync(() => 
    {
        var @global = new Vault.QuotaRateLimit("global", new()
        {
            Path = "",
            Rate = 100,
        });
    
    });
    
    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()        
                .path("")
                .rate(100)
                .build());
    
        }
    }
    
    resources:
      global:
        type: vault:QuotaRateLimit
        properties:
          path:
          rate: 100
    

    Create QuotaRateLimit Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new QuotaRateLimit(name: string, args: QuotaRateLimitArgs, opts?: CustomResourceOptions);
    @overload
    def QuotaRateLimit(resource_name: str,
                       args: QuotaRateLimitArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def QuotaRateLimit(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       rate: Optional[float] = None,
                       block_interval: Optional[int] = None,
                       interval: Optional[int] = None,
                       name: Optional[str] = None,
                       namespace: Optional[str] = None,
                       path: Optional[str] = None,
                       role: Optional[str] = None)
    func NewQuotaRateLimit(ctx *Context, name string, args QuotaRateLimitArgs, opts ...ResourceOption) (*QuotaRateLimit, error)
    public QuotaRateLimit(string name, QuotaRateLimitArgs args, CustomResourceOptions? opts = null)
    public QuotaRateLimit(String name, QuotaRateLimitArgs args)
    public QuotaRateLimit(String name, QuotaRateLimitArgs args, CustomResourceOptions options)
    
    type: vault:QuotaRateLimit
    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 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.
    args QuotaRateLimitArgs
    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 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.
    name String
    The unique name of the resource.
    args QuotaRateLimitArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var quotaRateLimitResource = new Vault.QuotaRateLimit("quotaRateLimitResource", new()
    {
        Rate = 0,
        BlockInterval = 0,
        Interval = 0,
        Name = "string",
        Namespace = "string",
        Path = "string",
        Role = "string",
    });
    
    example, err := vault.NewQuotaRateLimit(ctx, "quotaRateLimitResource", &vault.QuotaRateLimitArgs{
    	Rate:          pulumi.Float64(0),
    	BlockInterval: pulumi.Int(0),
    	Interval:      pulumi.Int(0),
    	Name:          pulumi.String("string"),
    	Namespace:     pulumi.String("string"),
    	Path:          pulumi.String("string"),
    	Role:          pulumi.String("string"),
    })
    
    var quotaRateLimitResource = new QuotaRateLimit("quotaRateLimitResource", QuotaRateLimitArgs.builder()        
        .rate(0)
        .blockInterval(0)
        .interval(0)
        .name("string")
        .namespace("string")
        .path("string")
        .role("string")
        .build());
    
    quota_rate_limit_resource = vault.QuotaRateLimit("quotaRateLimitResource",
        rate=0,
        block_interval=0,
        interval=0,
        name="string",
        namespace="string",
        path="string",
        role="string")
    
    const quotaRateLimitResource = new vault.QuotaRateLimit("quotaRateLimitResource", {
        rate: 0,
        blockInterval: 0,
        interval: 0,
        name: "string",
        namespace: "string",
        path: "string",
        role: "string",
    });
    
    type: vault:QuotaRateLimit
    properties:
        blockInterval: 0
        interval: 0
        name: string
        namespace: string
        path: string
        rate: 0
        role: string
    

    QuotaRateLimit 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 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.
    BlockInterval int
    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.
    Interval int
    The duration in seconds to enforce rate limiting for.
    Name string
    Name of the rate limit quota
    Namespace string
    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.
    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.
    Role string
    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.
    Rate float64
    The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.
    BlockInterval int
    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.
    Interval int
    The duration in seconds to enforce rate limiting for.
    Name string
    Name of the rate limit quota
    Namespace string
    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.
    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.
    Role string
    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.
    rate Double
    The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.
    blockInterval Integer
    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.
    interval Integer
    The duration in seconds to enforce rate limiting for.
    name String
    Name of the rate limit quota
    namespace String
    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.
    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.
    role String
    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.
    rate number
    The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.
    blockInterval number
    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.
    interval number
    The duration in seconds to enforce rate limiting for.
    name string
    Name of the rate limit quota
    namespace string
    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.
    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.
    role string
    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.
    rate float
    The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.
    block_interval int
    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.
    interval int
    The duration in seconds to enforce rate limiting for.
    name str
    Name of the rate limit quota
    namespace str
    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.
    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.
    role str
    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.
    rate Number
    The maximum number of requests at any given second to be allowed by the quota rule. The rate must be positive.
    blockInterval Number
    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.
    interval Number
    The duration in seconds to enforce rate limiting for.
    name String
    Name of the rate limit quota
    namespace String
    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.
    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.
    role String
    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.

    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 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 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,
            block_interval: Optional[int] = None,
            interval: Optional[int] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            path: Optional[str] = None,
            rate: Optional[float] = None,
            role: Optional[str] = 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)
    public static QuotaRateLimit get(String name, Output<String> id, QuotaRateLimitState 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.
    The following state arguments are supported:
    BlockInterval int
    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.
    Interval int
    The duration in seconds to enforce rate limiting for.
    Name string
    Name of the rate limit quota
    Namespace string
    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.
    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.
    Role string
    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.
    BlockInterval int
    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.
    Interval int
    The duration in seconds to enforce rate limiting for.
    Name string
    Name of the rate limit quota
    Namespace string
    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.
    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.
    Role string
    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.
    blockInterval Integer
    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.
    interval Integer
    The duration in seconds to enforce rate limiting for.
    name String
    Name of the rate limit quota
    namespace String
    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.
    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.
    role String
    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.
    blockInterval number
    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.
    interval number
    The duration in seconds to enforce rate limiting for.
    name string
    Name of the rate limit quota
    namespace string
    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.
    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.
    role string
    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.
    block_interval int
    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.
    interval int
    The duration in seconds to enforce rate limiting for.
    name str
    Name of the rate limit quota
    namespace str
    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.
    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.
    role str
    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.
    blockInterval Number
    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.
    interval Number
    The duration in seconds to enforce rate limiting for.
    name String
    Name of the rate limit quota
    namespace String
    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.
    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.
    role String
    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.

    Import

    Rate limit quotas can be imported using their names

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Vault pulumi/pulumi-vault
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vault Terraform Provider.
    vault logo
    HashiCorp Vault v6.1.0 published on Thursday, Apr 4, 2024 by Pulumi