vultr.User
Explore with Pulumi AI
Provides a Vultr User resource. This can be used to create, read, modify, and delete Users.
Example Usage
Create a new User without any ACLs
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myUser = new vultr.User("myUser", {
apiEnabled: true,
email: "user@vultr.com",
password: "myP@ssw0rd",
});
import pulumi
import ediri_vultr as vultr
my_user = vultr.User("myUser",
api_enabled=True,
email="user@vultr.com",
password="myP@ssw0rd")
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.NewUser(ctx, "myUser", &vultr.UserArgs{
ApiEnabled: pulumi.Bool(true),
Email: pulumi.String("user@vultr.com"),
Password: pulumi.String("myP@ssw0rd"),
})
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 myUser = new Vultr.User("myUser", new()
{
ApiEnabled = true,
Email = "user@vultr.com",
Password = "myP@ssw0rd",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.User;
import com.pulumi.vultr.UserArgs;
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 myUser = new User("myUser", UserArgs.builder()
.apiEnabled(true)
.email("user@vultr.com")
.password("myP@ssw0rd")
.build());
}
}
resources:
myUser:
type: vultr:User
properties:
apiEnabled: true
email: user@vultr.com
password: myP@ssw0rd
Create a new User with all ACLs
import * as pulumi from "@pulumi/pulumi";
import * as vultr from "@ediri/vultr";
const myUser = new vultr.User("myUser", {
acls: [
"manage_users",
"subscriptions",
"provisioning",
"billing",
"support",
"abuse",
"dns",
"upgrade",
],
apiEnabled: true,
email: "user@vultr.com",
password: "myP@ssw0rd",
});
import pulumi
import ediri_vultr as vultr
my_user = vultr.User("myUser",
acls=[
"manage_users",
"subscriptions",
"provisioning",
"billing",
"support",
"abuse",
"dns",
"upgrade",
],
api_enabled=True,
email="user@vultr.com",
password="myP@ssw0rd")
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.NewUser(ctx, "myUser", &vultr.UserArgs{
Acls: pulumi.StringArray{
pulumi.String("manage_users"),
pulumi.String("subscriptions"),
pulumi.String("provisioning"),
pulumi.String("billing"),
pulumi.String("support"),
pulumi.String("abuse"),
pulumi.String("dns"),
pulumi.String("upgrade"),
},
ApiEnabled: pulumi.Bool(true),
Email: pulumi.String("user@vultr.com"),
Password: pulumi.String("myP@ssw0rd"),
})
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 myUser = new Vultr.User("myUser", new()
{
Acls = new[]
{
"manage_users",
"subscriptions",
"provisioning",
"billing",
"support",
"abuse",
"dns",
"upgrade",
},
ApiEnabled = true,
Email = "user@vultr.com",
Password = "myP@ssw0rd",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vultr.User;
import com.pulumi.vultr.UserArgs;
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 myUser = new User("myUser", UserArgs.builder()
.acls(
"manage_users",
"subscriptions",
"provisioning",
"billing",
"support",
"abuse",
"dns",
"upgrade")
.apiEnabled(true)
.email("user@vultr.com")
.password("myP@ssw0rd")
.build());
}
}
resources:
myUser:
type: vultr:User
properties:
acls:
- manage_users
- subscriptions
- provisioning
- billing
- support
- abuse
- dns
- upgrade
apiEnabled: true
email: user@vultr.com
password: myP@ssw0rd
Create User Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def User(resource_name: str,
opts: Optional[ResourceOptions] = None,
email: Optional[str] = None,
password: Optional[str] = None,
acls: Optional[Sequence[str]] = None,
api_enabled: Optional[bool] = None,
name: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: vultr:User
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 UserArgs
- 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 UserArgs
- 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 UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserArgs
- 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 userResource = new Vultr.User("userResource", new()
{
Email = "string",
Password = "string",
Acls = new[]
{
"string",
},
ApiEnabled = false,
Name = "string",
});
example, err := vultr.NewUser(ctx, "userResource", &vultr.UserArgs{
Email: pulumi.String("string"),
Password: pulumi.String("string"),
Acls: pulumi.StringArray{
pulumi.String("string"),
},
ApiEnabled: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var userResource = new User("userResource", UserArgs.builder()
.email("string")
.password("string")
.acls("string")
.apiEnabled(false)
.name("string")
.build());
user_resource = vultr.User("userResource",
email="string",
password="string",
acls=["string"],
api_enabled=False,
name="string")
const userResource = new vultr.User("userResource", {
email: "string",
password: "string",
acls: ["string"],
apiEnabled: false,
name: "string",
});
type: vultr:User
properties:
acls:
- string
apiEnabled: false
email: string
name: string
password: string
User 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 User resource accepts the following input properties:
- Email string
- Email for this user.
- Password string
- Password for this user.
- Acls List<string>
- The access control list for the user.
- Api
Enabled bool - Whether API is enabled for the user. Default behavior is set to enabled.
- Name string
- Name for this user.
- Email string
- Email for this user.
- Password string
- Password for this user.
- Acls []string
- The access control list for the user.
- Api
Enabled bool - Whether API is enabled for the user. Default behavior is set to enabled.
- Name string
- Name for this user.
- email String
- Email for this user.
- password String
- Password for this user.
- acls List<String>
- The access control list for the user.
- api
Enabled Boolean - Whether API is enabled for the user. Default behavior is set to enabled.
- name String
- Name for this user.
- email string
- Email for this user.
- password string
- Password for this user.
- acls string[]
- The access control list for the user.
- api
Enabled boolean - Whether API is enabled for the user. Default behavior is set to enabled.
- name string
- Name for this user.
- email str
- Email for this user.
- password str
- Password for this user.
- acls Sequence[str]
- The access control list for the user.
- api_
enabled bool - Whether API is enabled for the user. Default behavior is set to enabled.
- name str
- Name for this user.
- email String
- Email for this user.
- password String
- Password for this user.
- acls List<String>
- The access control list for the user.
- api
Enabled Boolean - Whether API is enabled for the user. Default behavior is set to enabled.
- name String
- Name for this user.
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
Look up Existing User Resource
Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
acls: Optional[Sequence[str]] = None,
api_enabled: Optional[bool] = None,
api_key: Optional[str] = None,
email: Optional[str] = None,
name: Optional[str] = None,
password: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState 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.
Import
Users can be imported using the User ID
, e.g.
$ pulumi import vultr:index/user:User myuser 1345fef0-8ed3-4a66-bd8c-822a7b7bd05a
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- vultr dirien/pulumi-vultr
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vultr
Terraform Provider.