1. Packages
  2. Vultr
  3. API Docs
  4. DatabaseQuota
Vultr v2.23.1 published on Tuesday, Dec 10, 2024 by dirien

vultr.DatabaseQuota

Explore with Pulumi AI

Provides a Vultr database quota resource. This can be used to create, read, and delete quotas for a managed database on your Vultr account.

Example Usage

Create a new database quota:

import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";

const myDatabaseQuota = new vultr.DatabaseQuota("myDatabaseQuota", {
    databaseId: vultr_database.my_database.id,
    clientId: "my_database_quota",
    consumerByteRate: 3,
    producerByteRate: 2,
    requestPercentage: 120,
    user: "my_database_user",
});
Copy
import pulumi
import ediri_vultr as vultr

my_database_quota = vultr.DatabaseQuota("myDatabaseQuota",
    database_id=vultr_database["my_database"]["id"],
    client_id="my_database_quota",
    consumer_byte_rate=3,
    producer_byte_rate=2,
    request_percentage=120,
    user="my_database_user")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vultr.NewDatabaseQuota(ctx, "myDatabaseQuota", &vultr.DatabaseQuotaArgs{
			DatabaseId:        pulumi.Any(vultr_database.My_database.Id),
			ClientId:          pulumi.String("my_database_quota"),
			ConsumerByteRate:  pulumi.Int(3),
			ProducerByteRate:  pulumi.Int(2),
			RequestPercentage: pulumi.Int(120),
			User:              pulumi.String("my_database_user"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vultr = ediri.Vultr;

return await Deployment.RunAsync(() => 
{
    var myDatabaseQuota = new Vultr.DatabaseQuota("myDatabaseQuota", new()
    {
        DatabaseId = vultr_database.My_database.Id,
        ClientId = "my_database_quota",
        ConsumerByteRate = 3,
        ProducerByteRate = 2,
        RequestPercentage = 120,
        User = "my_database_user",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.DatabaseQuota;
import com.pulumi.vultr.DatabaseQuotaArgs;
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 myDatabaseQuota = new DatabaseQuota("myDatabaseQuota", DatabaseQuotaArgs.builder()
            .databaseId(vultr_database.my_database().id())
            .clientId("my_database_quota")
            .consumerByteRate("3")
            .producerByteRate("2")
            .requestPercentage("120")
            .user("my_database_user")
            .build());

    }
}
Copy
resources:
  myDatabaseQuota:
    type: vultr:DatabaseQuota
    properties:
      databaseId: ${vultr_database.my_database.id}
      clientId: my_database_quota
      consumerByteRate: '3'
      producerByteRate: '2'
      requestPercentage: '120'
      user: my_database_user
Copy

Create DatabaseQuota Resource

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

Constructor syntax

new DatabaseQuota(name: string, args: DatabaseQuotaArgs, opts?: CustomResourceOptions);
@overload
def DatabaseQuota(resource_name: str,
                  args: DatabaseQuotaArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def DatabaseQuota(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  client_id: Optional[str] = None,
                  consumer_byte_rate: Optional[int] = None,
                  database_id: Optional[str] = None,
                  producer_byte_rate: Optional[int] = None,
                  request_percentage: Optional[int] = None,
                  user: Optional[str] = None)
func NewDatabaseQuota(ctx *Context, name string, args DatabaseQuotaArgs, opts ...ResourceOption) (*DatabaseQuota, error)
public DatabaseQuota(string name, DatabaseQuotaArgs args, CustomResourceOptions? opts = null)
public DatabaseQuota(String name, DatabaseQuotaArgs args)
public DatabaseQuota(String name, DatabaseQuotaArgs args, CustomResourceOptions options)
type: vultr:DatabaseQuota
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DatabaseQuotaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DatabaseQuotaArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseQuotaArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DatabaseQuotaArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DatabaseQuotaArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

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

var databaseQuotaResource = new Vultr.DatabaseQuota("databaseQuotaResource", new()
{
    ClientId = "string",
    ConsumerByteRate = 0,
    DatabaseId = "string",
    ProducerByteRate = 0,
    RequestPercentage = 0,
    User = "string",
});
Copy
example, err := vultr.NewDatabaseQuota(ctx, "databaseQuotaResource", &vultr.DatabaseQuotaArgs{
	ClientId:          pulumi.String("string"),
	ConsumerByteRate:  pulumi.Int(0),
	DatabaseId:        pulumi.String("string"),
	ProducerByteRate:  pulumi.Int(0),
	RequestPercentage: pulumi.Int(0),
	User:              pulumi.String("string"),
})
Copy
var databaseQuotaResource = new DatabaseQuota("databaseQuotaResource", DatabaseQuotaArgs.builder()
    .clientId("string")
    .consumerByteRate(0)
    .databaseId("string")
    .producerByteRate(0)
    .requestPercentage(0)
    .user("string")
    .build());
Copy
database_quota_resource = vultr.DatabaseQuota("databaseQuotaResource",
    client_id="string",
    consumer_byte_rate=0,
    database_id="string",
    producer_byte_rate=0,
    request_percentage=0,
    user="string")
Copy
const databaseQuotaResource = new vultr.DatabaseQuota("databaseQuotaResource", {
    clientId: "string",
    consumerByteRate: 0,
    databaseId: "string",
    producerByteRate: 0,
    requestPercentage: 0,
    user: "string",
});
Copy
type: vultr:DatabaseQuota
properties:
    clientId: string
    consumerByteRate: 0
    databaseId: string
    producerByteRate: 0
    requestPercentage: 0
    user: string
Copy

DatabaseQuota Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The DatabaseQuota resource accepts the following input properties:

ClientId
This property is required.
Changes to this property will trigger replacement.
string
The client ID for the new database quota.
ConsumerByteRate
This property is required.
Changes to this property will trigger replacement.
int
The consumer byte rate for the new managed database quota.
DatabaseId
This property is required.
Changes to this property will trigger replacement.
string
The managed database ID you want to attach this quota to.
ProducerByteRate
This property is required.
Changes to this property will trigger replacement.
int
The producer byte rate for the new managed database quota.
RequestPercentage
This property is required.
Changes to this property will trigger replacement.
int
The CPU request percentage for the new managed database quota.
User
This property is required.
Changes to this property will trigger replacement.
string
The user for the new managed database quota.
ClientId
This property is required.
Changes to this property will trigger replacement.
string
The client ID for the new database quota.
ConsumerByteRate
This property is required.
Changes to this property will trigger replacement.
int
The consumer byte rate for the new managed database quota.
DatabaseId
This property is required.
Changes to this property will trigger replacement.
string
The managed database ID you want to attach this quota to.
ProducerByteRate
This property is required.
Changes to this property will trigger replacement.
int
The producer byte rate for the new managed database quota.
RequestPercentage
This property is required.
Changes to this property will trigger replacement.
int
The CPU request percentage for the new managed database quota.
User
This property is required.
Changes to this property will trigger replacement.
string
The user for the new managed database quota.
clientId
This property is required.
Changes to this property will trigger replacement.
String
The client ID for the new database quota.
consumerByteRate
This property is required.
Changes to this property will trigger replacement.
Integer
The consumer byte rate for the new managed database quota.
databaseId
This property is required.
Changes to this property will trigger replacement.
String
The managed database ID you want to attach this quota to.
producerByteRate
This property is required.
Changes to this property will trigger replacement.
Integer
The producer byte rate for the new managed database quota.
requestPercentage
This property is required.
Changes to this property will trigger replacement.
Integer
The CPU request percentage for the new managed database quota.
user
This property is required.
Changes to this property will trigger replacement.
String
The user for the new managed database quota.
clientId
This property is required.
Changes to this property will trigger replacement.
string
The client ID for the new database quota.
consumerByteRate
This property is required.
Changes to this property will trigger replacement.
number
The consumer byte rate for the new managed database quota.
databaseId
This property is required.
Changes to this property will trigger replacement.
string
The managed database ID you want to attach this quota to.
producerByteRate
This property is required.
Changes to this property will trigger replacement.
number
The producer byte rate for the new managed database quota.
requestPercentage
This property is required.
Changes to this property will trigger replacement.
number
The CPU request percentage for the new managed database quota.
user
This property is required.
Changes to this property will trigger replacement.
string
The user for the new managed database quota.
client_id
This property is required.
Changes to this property will trigger replacement.
str
The client ID for the new database quota.
consumer_byte_rate
This property is required.
Changes to this property will trigger replacement.
int
The consumer byte rate for the new managed database quota.
database_id
This property is required.
Changes to this property will trigger replacement.
str
The managed database ID you want to attach this quota to.
producer_byte_rate
This property is required.
Changes to this property will trigger replacement.
int
The producer byte rate for the new managed database quota.
request_percentage
This property is required.
Changes to this property will trigger replacement.
int
The CPU request percentage for the new managed database quota.
user
This property is required.
Changes to this property will trigger replacement.
str
The user for the new managed database quota.
clientId
This property is required.
Changes to this property will trigger replacement.
String
The client ID for the new database quota.
consumerByteRate
This property is required.
Changes to this property will trigger replacement.
Number
The consumer byte rate for the new managed database quota.
databaseId
This property is required.
Changes to this property will trigger replacement.
String
The managed database ID you want to attach this quota to.
producerByteRate
This property is required.
Changes to this property will trigger replacement.
Number
The producer byte rate for the new managed database quota.
requestPercentage
This property is required.
Changes to this property will trigger replacement.
Number
The CPU request percentage for the new managed database quota.
user
This property is required.
Changes to this property will trigger replacement.
String
The user for the new managed database quota.

Outputs

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

Get an existing DatabaseQuota 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?: DatabaseQuotaState, opts?: CustomResourceOptions): DatabaseQuota
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        client_id: Optional[str] = None,
        consumer_byte_rate: Optional[int] = None,
        database_id: Optional[str] = None,
        producer_byte_rate: Optional[int] = None,
        request_percentage: Optional[int] = None,
        user: Optional[str] = None) -> DatabaseQuota
func GetDatabaseQuota(ctx *Context, name string, id IDInput, state *DatabaseQuotaState, opts ...ResourceOption) (*DatabaseQuota, error)
public static DatabaseQuota Get(string name, Input<string> id, DatabaseQuotaState? state, CustomResourceOptions? opts = null)
public static DatabaseQuota get(String name, Output<String> id, DatabaseQuotaState state, CustomResourceOptions options)
resources:  _:    type: vultr:DatabaseQuota    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ClientId Changes to this property will trigger replacement. string
The client ID for the new database quota.
ConsumerByteRate Changes to this property will trigger replacement. int
The consumer byte rate for the new managed database quota.
DatabaseId Changes to this property will trigger replacement. string
The managed database ID you want to attach this quota to.
ProducerByteRate Changes to this property will trigger replacement. int
The producer byte rate for the new managed database quota.
RequestPercentage Changes to this property will trigger replacement. int
The CPU request percentage for the new managed database quota.
User Changes to this property will trigger replacement. string
The user for the new managed database quota.
ClientId Changes to this property will trigger replacement. string
The client ID for the new database quota.
ConsumerByteRate Changes to this property will trigger replacement. int
The consumer byte rate for the new managed database quota.
DatabaseId Changes to this property will trigger replacement. string
The managed database ID you want to attach this quota to.
ProducerByteRate Changes to this property will trigger replacement. int
The producer byte rate for the new managed database quota.
RequestPercentage Changes to this property will trigger replacement. int
The CPU request percentage for the new managed database quota.
User Changes to this property will trigger replacement. string
The user for the new managed database quota.
clientId Changes to this property will trigger replacement. String
The client ID for the new database quota.
consumerByteRate Changes to this property will trigger replacement. Integer
The consumer byte rate for the new managed database quota.
databaseId Changes to this property will trigger replacement. String
The managed database ID you want to attach this quota to.
producerByteRate Changes to this property will trigger replacement. Integer
The producer byte rate for the new managed database quota.
requestPercentage Changes to this property will trigger replacement. Integer
The CPU request percentage for the new managed database quota.
user Changes to this property will trigger replacement. String
The user for the new managed database quota.
clientId Changes to this property will trigger replacement. string
The client ID for the new database quota.
consumerByteRate Changes to this property will trigger replacement. number
The consumer byte rate for the new managed database quota.
databaseId Changes to this property will trigger replacement. string
The managed database ID you want to attach this quota to.
producerByteRate Changes to this property will trigger replacement. number
The producer byte rate for the new managed database quota.
requestPercentage Changes to this property will trigger replacement. number
The CPU request percentage for the new managed database quota.
user Changes to this property will trigger replacement. string
The user for the new managed database quota.
client_id Changes to this property will trigger replacement. str
The client ID for the new database quota.
consumer_byte_rate Changes to this property will trigger replacement. int
The consumer byte rate for the new managed database quota.
database_id Changes to this property will trigger replacement. str
The managed database ID you want to attach this quota to.
producer_byte_rate Changes to this property will trigger replacement. int
The producer byte rate for the new managed database quota.
request_percentage Changes to this property will trigger replacement. int
The CPU request percentage for the new managed database quota.
user Changes to this property will trigger replacement. str
The user for the new managed database quota.
clientId Changes to this property will trigger replacement. String
The client ID for the new database quota.
consumerByteRate Changes to this property will trigger replacement. Number
The consumer byte rate for the new managed database quota.
databaseId Changes to this property will trigger replacement. String
The managed database ID you want to attach this quota to.
producerByteRate Changes to this property will trigger replacement. Number
The producer byte rate for the new managed database quota.
requestPercentage Changes to this property will trigger replacement. Number
The CPU request percentage for the new managed database quota.
user Changes to this property will trigger replacement. String
The user for the new managed database quota.

Package Details

Repository
vultr dirien/pulumi-vultr
License
Apache-2.0
Notes
This Pulumi package is based on the vultr Terraform Provider.