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)
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
{
RedisAclCategories = new[]
{
"string",
},
RedisAclChannels = new[]
{
"string",
},
RedisAclCommands = new[]
{
"string",
},
RedisAclKeys = new[]
{
"string",
},
},
Encryption = "string",
Password = "string",
});
example, err := vultr.NewDatabaseUser(ctx, "databaseUserResource", &vultr.DatabaseUserArgs{
DatabaseId: pulumi.String("string"),
Username: pulumi.String("string"),
AccessControl: &vultr.DatabaseUserAccessControlArgs{
RedisAclCategories: pulumi.StringArray{
pulumi.String("string"),
},
RedisAclChannels: pulumi.StringArray{
pulumi.String("string"),
},
RedisAclCommands: pulumi.StringArray{
pulumi.String("string"),
},
RedisAclKeys: pulumi.StringArray{
pulumi.String("string"),
},
},
Encryption: pulumi.String("string"),
Password: pulumi.String("string"),
})
var databaseUserResource = new DatabaseUser("databaseUserResource", DatabaseUserArgs.builder()
.databaseId("string")
.username("string")
.accessControl(DatabaseUserAccessControlArgs.builder()
.redisAclCategories("string")
.redisAclChannels("string")
.redisAclCommands("string")
.redisAclKeys("string")
.build())
.encryption("string")
.password("string")
.build());
database_user_resource = vultr.DatabaseUser("databaseUserResource",
database_id="string",
username="string",
access_control=vultr.DatabaseUserAccessControlArgs(
redis_acl_categories=["string"],
redis_acl_channels=["string"],
redis_acl_commands=["string"],
redis_acl_keys=["string"],
),
encryption="string",
password="string")
const databaseUserResource = new vultr.DatabaseUser("databaseUserResource", {
databaseId: "string",
username: "string",
accessControl: {
redisAclCategories: ["string"],
redisAclChannels: ["string"],
redisAclCommands: ["string"],
redisAclKeys: ["string"],
},
encryption: "string",
password: "string",
});
type: vultr:DatabaseUser
properties:
accessControl:
redisAclCategories:
- string
redisAclChannels:
- string
redisAclCommands:
- string
redisAclKeys:
- string
databaseId: string
encryption: string
password: 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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseUser 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 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_control: Optional[DatabaseUserAccessControlArgs] = None,
database_id: Optional[str] = None,
encryption: Optional[str] = None,
password: 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)
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.
- Access
Control ediri.Vultr. Inputs. Database User Access Control - 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.
- Username string
- The username of the new managed database user.
- Access
Control DatabaseUser Access Control Args - 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.
- Username string
- The username of the new managed database user.
- access
Control DatabaseUser Access Control - 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.
- username String
- The username of the new managed database user.
- access
Control DatabaseUser Access Control - 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.
- username string
- The username of the new managed database user.
- access_
control DatabaseUser Access Control Args - 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.
- username str
- The username of the new managed database user.
- access
Control Property Map - 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.
- username String
- The username of the new managed database user.
Supporting Types
DatabaseUserAccessControl, DatabaseUserAccessControlArgs
- Redis
Acl List<string>Categories - The list of command category rules for this managed database user.
- Redis
Acl List<string>Channels - The list of publish/subscribe channel patterns for this managed database user.
- Redis
Acl List<string>Commands - The list of individual command rules for this managed database user.
- Redis
Acl List<string>Keys - The list of access rules for this managed database user.
- Redis
Acl []stringCategories - The list of command category rules for this managed database user.
- Redis
Acl []stringChannels - The list of publish/subscribe channel patterns for this managed database user.
- Redis
Acl []stringCommands - The list of individual command rules for this managed database user.
- Redis
Acl []stringKeys - The list of access rules for this managed database user.
- redis
Acl List<String>Categories - The list of command category rules for this managed database user.
- redis
Acl List<String>Channels - The list of publish/subscribe channel patterns for this managed database user.
- redis
Acl List<String>Commands - The list of individual command rules for this managed database user.
- redis
Acl List<String>Keys - The list of access rules for this managed database user.
- redis
Acl string[]Categories - The list of command category rules for this managed database user.
- redis
Acl string[]Channels - The list of publish/subscribe channel patterns for this managed database user.
- redis
Acl string[]Commands - The list of individual command rules for this managed database user.
- redis
Acl string[]Keys - The list of access rules for this managed database user.
- redis_
acl_ Sequence[str]categories - The list of command category rules for this managed database user.
- redis_
acl_ Sequence[str]channels - The list of publish/subscribe channel patterns for this managed database user.
- redis_
acl_ Sequence[str]commands - The list of individual command rules for this managed database user.
- redis_
acl_ Sequence[str]keys - The list of access rules for this managed database user.
- redis
Acl List<String>Categories - The list of command category rules for this managed database user.
- redis
Acl List<String>Channels - The list of publish/subscribe channel patterns for this managed database user.
- redis
Acl List<String>Commands - The list of individual command rules for this managed database user.
- redis
Acl List<String>Keys - The list of access rules for this managed database user.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.