vultr.DatabaseUser
Explore with Pulumi AI
Provides a Vultr database user resource. This can be used to create, read, modify, and delete users for a managed database on your Vultr account.
Example Usage
Create a new database user:
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myDatabaseUser = new vultr.DatabaseUser("myDatabaseUser", {
databaseId: vultr_database.my_database.id,
username: "my_database_user",
password: "randomTestPW40298",
});
import pulumi
import ediri_vultr as vultr
my_database_user = vultr.DatabaseUser("myDatabaseUser",
database_id=vultr_database["my_database"]["id"],
username="my_database_user",
password="randomTestPW40298")
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.NewDatabaseUser(ctx, "myDatabaseUser", &vultr.DatabaseUserArgs{
DatabaseId: pulumi.Any(vultr_database.My_database.Id),
Username: pulumi.String("my_database_user"),
Password: pulumi.String("randomTestPW40298"),
})
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 myDatabaseUser = new Vultr.DatabaseUser("myDatabaseUser", new()
{
DatabaseId = vultr_database.My_database.Id,
Username = "my_database_user",
Password = "randomTestPW40298",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.DatabaseUser;
import com.pulumi.vultr.DatabaseUserArgs;
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 myDatabaseUser = new DatabaseUser("myDatabaseUser", DatabaseUserArgs.builder()
.databaseId(vultr_database.my_database().id())
.username("my_database_user")
.password("randomTestPW40298")
.build());
}
}
resources:
myDatabaseUser:
type: vultr:DatabaseUser
properties:
databaseId: ${vultr_database.my_database.id}
username: my_database_user
password: randomTestPW40298
Create DatabaseUser Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new DatabaseUser(name: string, args: DatabaseUserArgs, opts?: CustomResourceOptions);
@overload
def DatabaseUser(resource_name: str,
args: DatabaseUserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def DatabaseUser(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_id: Optional[str] = None,
username: Optional[str] = None,
access_control: Optional[DatabaseUserAccessControlArgs] = None,
encryption: Optional[str] = None,
password: Optional[str] = None,
permission: Optional[str] = None)
func NewDatabaseUser(ctx *Context, name string, args DatabaseUserArgs, opts ...ResourceOption) (*DatabaseUser, error)
public DatabaseUser(string name, DatabaseUserArgs args, CustomResourceOptions? opts = null)
public DatabaseUser(String name, DatabaseUserArgs args)
public DatabaseUser(String name, DatabaseUserArgs args, CustomResourceOptions options)
type: vultr:DatabaseUser
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 DatabaseUserArgs
- 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 DatabaseUserArgs
- 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 DatabaseUserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseUserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseUserArgs
- 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 databaseUserResource = new Vultr.DatabaseUser("databaseUserResource", new()
{
DatabaseId = "string",
Username = "string",
AccessControl = new Vultr.Inputs.DatabaseUserAccessControlArgs
{
AclCategories = new[]
{
"string",
},
AclChannels = new[]
{
"string",
},
AclCommands = new[]
{
"string",
},
AclKeys = new[]
{
"string",
},
},
Encryption = "string",
Password = "string",
Permission = "string",
});
example, err := vultr.NewDatabaseUser(ctx, "databaseUserResource", &vultr.DatabaseUserArgs{
DatabaseId: pulumi.String("string"),
Username: pulumi.String("string"),
AccessControl: &vultr.DatabaseUserAccessControlArgs{
AclCategories: pulumi.StringArray{
pulumi.String("string"),
},
AclChannels: pulumi.StringArray{
pulumi.String("string"),
},
AclCommands: pulumi.StringArray{
pulumi.String("string"),
},
AclKeys: pulumi.StringArray{
pulumi.String("string"),
},
},
Encryption: pulumi.String("string"),
Password: pulumi.String("string"),
Permission: pulumi.String("string"),
})
var databaseUserResource = new DatabaseUser("databaseUserResource", DatabaseUserArgs.builder()
.databaseId("string")
.username("string")
.accessControl(DatabaseUserAccessControlArgs.builder()
.aclCategories("string")
.aclChannels("string")
.aclCommands("string")
.aclKeys("string")
.build())
.encryption("string")
.password("string")
.permission("string")
.build());
database_user_resource = vultr.DatabaseUser("databaseUserResource",
database_id="string",
username="string",
access_control={
"acl_categories": ["string"],
"acl_channels": ["string"],
"acl_commands": ["string"],
"acl_keys": ["string"],
},
encryption="string",
password="string",
permission="string")
const databaseUserResource = new vultr.DatabaseUser("databaseUserResource", {
databaseId: "string",
username: "string",
accessControl: {
aclCategories: ["string"],
aclChannels: ["string"],
aclCommands: ["string"],
aclKeys: ["string"],
},
encryption: "string",
password: "string",
permission: "string",
});
type: vultr:DatabaseUser
properties:
accessControl:
aclCategories:
- string
aclChannels:
- string
aclCommands:
- string
aclKeys:
- string
databaseId: string
encryption: string
password: string
permission: string
username: string
DatabaseUser 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 DatabaseUser resource accepts the following input properties:
- Database
Id string - The managed database ID you want to attach this user to.
- Username string
- The username of the new managed database user.
- Access
Control ediri.Vultr. Inputs. Database User Access Control - Encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - Password string
- The password of the new managed database user.
- Permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
- Database
Id string - The managed database ID you want to attach this user to.
- Username string
- The username of the new managed database user.
- Access
Control DatabaseUser Access Control Args - Encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - Password string
- The password of the new managed database user.
- Permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
- database
Id String - The managed database ID you want to attach this user to.
- username String
- The username of the new managed database user.
- access
Control DatabaseUser Access Control - encryption String
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password String
- The password of the new managed database user.
- permission String
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
- database
Id string - The managed database ID you want to attach this user to.
- username string
- The username of the new managed database user.
- access
Control DatabaseUser Access Control - encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password string
- The password of the new managed database user.
- permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
- database_
id str - The managed database ID you want to attach this user to.
- username str
- The username of the new managed database user.
- access_
control DatabaseUser Access Control Args - encryption str
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password str
- The password of the new managed database user.
- permission str
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
- database
Id String - The managed database ID you want to attach this user to.
- username String
- The username of the new managed database user.
- access
Control Property Map - encryption String
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password String
- The password of the new managed database user.
- permission String
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
).
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseUser resource produces the following output properties:
- Access
Cert string - Access
Key string - Id string
- The provider-assigned unique ID for this managed resource.
- Access
Cert string - Access
Key string - Id string
- The provider-assigned unique ID for this managed resource.
- access
Cert String - access
Key String - id String
- The provider-assigned unique ID for this managed resource.
- access
Cert string - access
Key string - id string
- The provider-assigned unique ID for this managed resource.
- access_
cert str - access_
key str - id str
- The provider-assigned unique ID for this managed resource.
- access
Cert String - access
Key String - id String
- The provider-assigned unique ID for this managed resource.
Look up Existing DatabaseUser Resource
Get an existing DatabaseUser 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?: DatabaseUserState, opts?: CustomResourceOptions): DatabaseUser
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_cert: Optional[str] = None,
access_control: Optional[DatabaseUserAccessControlArgs] = None,
access_key: Optional[str] = None,
database_id: Optional[str] = None,
encryption: Optional[str] = None,
password: Optional[str] = None,
permission: Optional[str] = None,
username: Optional[str] = None) -> DatabaseUser
func GetDatabaseUser(ctx *Context, name string, id IDInput, state *DatabaseUserState, opts ...ResourceOption) (*DatabaseUser, error)
public static DatabaseUser Get(string name, Input<string> id, DatabaseUserState? state, CustomResourceOptions? opts = null)
public static DatabaseUser get(String name, Output<String> id, DatabaseUserState state, CustomResourceOptions options)
resources: _: type: vultr:DatabaseUser get: id: ${id}
- 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.
- Access
Cert string - Access
Control ediri.Vultr. Inputs. Database User Access Control - Access
Key string - Database
Id string - The managed database ID you want to attach this user to.
- Encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - Password string
- The password of the new managed database user.
- Permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - Username string
- The username of the new managed database user.
- Access
Cert string - Access
Control DatabaseUser Access Control Args - Access
Key string - Database
Id string - The managed database ID you want to attach this user to.
- Encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - Password string
- The password of the new managed database user.
- Permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - Username string
- The username of the new managed database user.
- access
Cert String - access
Control DatabaseUser Access Control - access
Key String - database
Id String - The managed database ID you want to attach this user to.
- encryption String
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password String
- The password of the new managed database user.
- permission String
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - username String
- The username of the new managed database user.
- access
Cert string - access
Control DatabaseUser Access Control - access
Key string - database
Id string - The managed database ID you want to attach this user to.
- encryption string
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password string
- The password of the new managed database user.
- permission string
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - username string
- The username of the new managed database user.
- access_
cert str - access_
control DatabaseUser Access Control Args - access_
key str - database_
id str - The managed database ID you want to attach this user to.
- encryption str
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password str
- The password of the new managed database user.
- permission str
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - username str
- The username of the new managed database user.
- access
Cert String - access
Control Property Map - access
Key String - database
Id String - The managed database ID you want to attach this user to.
- encryption String
- The encryption type of the new managed database user's password (MySQL engine types only -
caching_sha2_password
,mysql_native_password
). - password String
- The password of the new managed database user.
- permission String
- The permission level for the database user (Kafka engine types only -
admin
,read
,write
,readwrite
). - username String
- The username of the new managed database user.
Supporting Types
DatabaseUserAccessControl, DatabaseUserAccessControlArgs
- Acl
Categories List<string> - List of command category rules for this managed database user (Redis engine types only).
- Acl
Channels List<string> - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- Acl
Commands List<string> - List of individual command rules for this managed database user (Redis engine types only).
- Acl
Keys List<string> - List of access rules for this managed database user (Redis engine types only).
- Acl
Categories []string - List of command category rules for this managed database user (Redis engine types only).
- Acl
Channels []string - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- Acl
Commands []string - List of individual command rules for this managed database user (Redis engine types only).
- Acl
Keys []string - List of access rules for this managed database user (Redis engine types only).
- acl
Categories List<String> - List of command category rules for this managed database user (Redis engine types only).
- acl
Channels List<String> - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- acl
Commands List<String> - List of individual command rules for this managed database user (Redis engine types only).
- acl
Keys List<String> - List of access rules for this managed database user (Redis engine types only).
- acl
Categories string[] - List of command category rules for this managed database user (Redis engine types only).
- acl
Channels string[] - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- acl
Commands string[] - List of individual command rules for this managed database user (Redis engine types only).
- acl
Keys string[] - List of access rules for this managed database user (Redis engine types only).
- acl_
categories Sequence[str] - List of command category rules for this managed database user (Redis engine types only).
- acl_
channels Sequence[str] - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- acl_
commands Sequence[str] - List of individual command rules for this managed database user (Redis engine types only).
- acl_
keys Sequence[str] - List of access rules for this managed database user (Redis engine types only).
- acl
Categories List<String> - List of command category rules for this managed database user (Redis engine types only).
- acl
Channels List<String> - List of publish/subscribe channel patterns for this managed database user (Redis engine types only).
- acl
Commands List<String> - List of individual command rules for this managed database user (Redis engine types only).
- acl
Keys List<String> - List of access rules for this managed database user (Redis engine types only).
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.