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",
});
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")
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
})
}
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",
});
});
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());
}
}
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
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 string
- The unique name of the resource.
- args DatabaseQuotaArgs
- 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 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 string
- The unique name of the resource.
- args DatabaseQuotaArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseQuotaArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
var databaseQuotaResource = new DatabaseQuota("databaseQuotaResource", DatabaseQuotaArgs.builder()
.clientId("string")
.consumerByteRate(0)
.databaseId("string")
.producerByteRate(0)
.requestPercentage(0)
.user("string")
.build());
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")
const databaseQuotaResource = new vultr.DatabaseQuota("databaseQuotaResource", {
clientId: "string",
consumerByteRate: 0,
databaseId: "string",
producerByteRate: 0,
requestPercentage: 0,
user: "string",
});
type: vultr:DatabaseQuota
properties:
clientId: string
consumerByteRate: 0
databaseId: string
producerByteRate: 0
requestPercentage: 0
user: string
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:
- Client
Id string - The client ID for the new database quota.
- Consumer
Byte intRate - The consumer byte rate for the new managed database quota.
- Database
Id string - The managed database ID you want to attach this quota to.
- Producer
Byte intRate - The producer byte rate for the new managed database quota.
- Request
Percentage int - The CPU request percentage for the new managed database quota.
- User string
- The user for the new managed database quota.
- Client
Id string - The client ID for the new database quota.
- Consumer
Byte intRate - The consumer byte rate for the new managed database quota.
- Database
Id string - The managed database ID you want to attach this quota to.
- Producer
Byte intRate - The producer byte rate for the new managed database quota.
- Request
Percentage int - The CPU request percentage for the new managed database quota.
- User string
- The user for the new managed database quota.
- client
Id String - The client ID for the new database quota.
- consumer
Byte IntegerRate - The consumer byte rate for the new managed database quota.
- database
Id String - The managed database ID you want to attach this quota to.
- producer
Byte IntegerRate - The producer byte rate for the new managed database quota.
- request
Percentage Integer - The CPU request percentage for the new managed database quota.
- user String
- The user for the new managed database quota.
- client
Id string - The client ID for the new database quota.
- consumer
Byte numberRate - The consumer byte rate for the new managed database quota.
- database
Id string - The managed database ID you want to attach this quota to.
- producer
Byte numberRate - The producer byte rate for the new managed database quota.
- request
Percentage number - The CPU request percentage for the new managed database quota.
- user string
- The user for the new managed database quota.
- client_
id str - The client ID for the new database quota.
- consumer_
byte_ intrate - The consumer byte rate for the new managed database quota.
- database_
id str - The managed database ID you want to attach this quota to.
- producer_
byte_ intrate - The producer byte rate for the new managed database quota.
- request_
percentage int - The CPU request percentage for the new managed database quota.
- user str
- The user for the new managed database quota.
- client
Id String - The client ID for the new database quota.
- consumer
Byte NumberRate - The consumer byte rate for the new managed database quota.
- database
Id String - The managed database ID you want to attach this quota to.
- producer
Byte NumberRate - The producer byte rate for the new managed database quota.
- request
Percentage Number - The CPU request percentage for the new managed database quota.
- user 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)
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.
- Client
Id string - The client ID for the new database quota.
- Consumer
Byte intRate - The consumer byte rate for the new managed database quota.
- Database
Id string - The managed database ID you want to attach this quota to.
- Producer
Byte intRate - The producer byte rate for the new managed database quota.
- Request
Percentage int - The CPU request percentage for the new managed database quota.
- User string
- The user for the new managed database quota.
- Client
Id string - The client ID for the new database quota.
- Consumer
Byte intRate - The consumer byte rate for the new managed database quota.
- Database
Id string - The managed database ID you want to attach this quota to.
- Producer
Byte intRate - The producer byte rate for the new managed database quota.
- Request
Percentage int - The CPU request percentage for the new managed database quota.
- User string
- The user for the new managed database quota.
- client
Id String - The client ID for the new database quota.
- consumer
Byte IntegerRate - The consumer byte rate for the new managed database quota.
- database
Id String - The managed database ID you want to attach this quota to.
- producer
Byte IntegerRate - The producer byte rate for the new managed database quota.
- request
Percentage Integer - The CPU request percentage for the new managed database quota.
- user String
- The user for the new managed database quota.
- client
Id string - The client ID for the new database quota.
- consumer
Byte numberRate - The consumer byte rate for the new managed database quota.
- database
Id string - The managed database ID you want to attach this quota to.
- producer
Byte numberRate - The producer byte rate for the new managed database quota.
- request
Percentage number - The CPU request percentage for the new managed database quota.
- user string
- The user for the new managed database quota.
- client_
id str - The client ID for the new database quota.
- consumer_
byte_ intrate - The consumer byte rate for the new managed database quota.
- database_
id str - The managed database ID you want to attach this quota to.
- producer_
byte_ intrate - The producer byte rate for the new managed database quota.
- request_
percentage int - The CPU request percentage for the new managed database quota.
- user str
- The user for the new managed database quota.
- client
Id String - The client ID for the new database quota.
- consumer
Byte NumberRate - The consumer byte rate for the new managed database quota.
- database
Id String - The managed database ID you want to attach this quota to.
- producer
Byte NumberRate - The producer byte rate for the new managed database quota.
- request
Percentage Number - The CPU request percentage for the new managed database quota.
- user 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.