HashiCorp Vault

v5.0.0 published on Tuesday, Nov 30, 2021 by Pulumi

User

Manages policy mappings for Github Users authenticated via Github. See the Vault documentation for more information.

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Vault.GitHub.AuthBackend("example", new Vault.GitHub.AuthBackendArgs
        {
            Organization = "myorg",
        });
        var tfUser = new Vault.GitHub.User("tfUser", new Vault.GitHub.UserArgs
        {
            Backend = example.Id,
            User = "john.doe",
            Policies = 
            {
                "developer",
                "read-only",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v5/go/vault/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := github.NewAuthBackend(ctx, "example", &github.AuthBackendArgs{
			Organization: pulumi.String("myorg"),
		})
		if err != nil {
			return err
		}
		_, err = github.NewUser(ctx, "tfUser", &github.UserArgs{
			Backend: example.ID(),
			User:    pulumi.String("john.doe"),
			Policies: pulumi.StringArray{
				pulumi.String("developer"),
				pulumi.String("read-only"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

example = vault.github.AuthBackend("example", organization="myorg")
tf_user = vault.github.User("tfUser",
    backend=example.id,
    user="john.doe",
    policies=[
        "developer",
        "read-only",
    ])
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const example = new vault.github.AuthBackend("example", {organization: "myorg"});
const tfUser = new vault.github.User("tfUser", {
    backend: example.id,
    user: "john.doe",
    policies: [
        "developer",
        "read-only",
    ],
});

Create a User Resource

new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         backend: Optional[str] = None,
         policies: Optional[Sequence[str]] = None,
         user: Optional[str] = None)
@overload
def User(resource_name: str,
         args: UserArgs,
         opts: Optional[ResourceOptions] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
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.

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

The User resource accepts the following input properties:

UserName string
GitHub user name.
Backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
Policies List<string>
An array of strings specifying the policies to be set on tokens issued using this role.
User string
GitHub user name.
Backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
Policies []string
An array of strings specifying the policies to be set on tokens issued using this role.
user string
GitHub user name.
backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
policies string[]
An array of strings specifying the policies to be set on tokens issued using this role.
user str
GitHub user name.
backend str
Path where the github auth backend is mounted. Defaults to github if not specified.
policies Sequence[str]
An array of strings specifying the policies to be set on tokens issued using this role.

Outputs

All input properties are implicitly available as output properties. Additionally, the User 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 str
The provider-assigned unique ID for this managed resource.

Look up an 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,
        backend: Optional[str] = None,
        policies: Optional[Sequence[str]] = None,
        user: 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)
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.

The following state arguments are supported:

Backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
Policies List<string>
An array of strings specifying the policies to be set on tokens issued using this role.
UserName string
GitHub user name.
Backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
Policies []string
An array of strings specifying the policies to be set on tokens issued using this role.
User string
GitHub user name.
backend string
Path where the github auth backend is mounted. Defaults to github if not specified.
policies string[]
An array of strings specifying the policies to be set on tokens issued using this role.
user string
GitHub user name.
backend str
Path where the github auth backend is mounted. Defaults to github if not specified.
policies Sequence[str]
An array of strings specifying the policies to be set on tokens issued using this role.
user str
GitHub user name.

Import

Github user mappings can be imported using the path, e.g.

 $ pulumi import vault:github/user:User tf_user auth/github/map/users/john.doe

Package Details

Repository
https://github.com/pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.