AuthBackendLogin

Logs into Vault using the AppRole auth backend. See the Vault documentation for more information.

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var approle = new Vault.AuthBackend("approle", new Vault.AuthBackendArgs
        {
            Type = "approle",
        });
        var example = new Vault.AppRole.AuthBackendRole("example", new Vault.AppRole.AuthBackendRoleArgs
        {
            Backend = approle.Path,
            Policies = 
            {
                "default",
                "dev",
                "prod",
            },
            RoleName = "test-role",
        });
        var id = new Vault.AppRole.AuthBackendRoleSecretID("id", new Vault.AppRole.AuthBackendRoleSecretIDArgs
        {
            Backend = approle.Path,
            RoleName = example.RoleName,
        });
        var login = new Vault.AppRole.AuthBackendLogin("login", new Vault.AppRole.AuthBackendLoginArgs
        {
            Backend = approle.Path,
            RoleId = example.RoleId,
            SecretId = id.SecretId,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		approle, err := vault.NewAuthBackend(ctx, "approle", &vault.AuthBackendArgs{
			Type: pulumi.String("approle"),
		})
		if err != nil {
			return err
		}
		example, err := appRole.NewAuthBackendRole(ctx, "example", &appRole.AuthBackendRoleArgs{
			Backend: approle.Path,
			Policies: pulumi.StringArray{
				pulumi.String("default"),
				pulumi.String("dev"),
				pulumi.String("prod"),
			},
			RoleName: pulumi.String("test-role"),
		})
		if err != nil {
			return err
		}
		id, err := appRole.NewAuthBackendRoleSecretID(ctx, "id", &appRole.AuthBackendRoleSecretIDArgs{
			Backend:  approle.Path,
			RoleName: example.RoleName,
		})
		if err != nil {
			return err
		}
		_, err = appRole.NewAuthBackendLogin(ctx, "login", &appRole.AuthBackendLoginArgs{
			Backend:  approle.Path,
			RoleId:   example.RoleId,
			SecretId: id.SecretId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

approle = vault.AuthBackend("approle", type="approle")
example = vault.app_role.AuthBackendRole("example",
    backend=approle.path,
    policies=[
        "default",
        "dev",
        "prod",
    ],
    role_name="test-role")
id = vault.app_role.AuthBackendRoleSecretID("id",
    backend=approle.path,
    role_name=example.role_name)
login = vault.app_role.AuthBackendLogin("login",
    backend=approle.path,
    role_id=example.role_id,
    secret_id=id.secret_id)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const approle = new vault.AuthBackend("approle", {
    type: "approle",
});
const example = new vault.appRole.AuthBackendRole("example", {
    backend: approle.path,
    policies: [
        "default",
        "dev",
        "prod",
    ],
    roleName: "test-role",
});
const id = new vault.appRole.AuthBackendRoleSecretID("id", {
    backend: approle.path,
    roleName: example.roleName,
});
const login = new vault.appRole.AuthBackendLogin("login", {
    backend: approle.path,
    roleId: example.roleId,
    secretId: id.secretId,
});

Create a AuthBackendLogin Resource

new AuthBackendLogin(name: string, args: AuthBackendLoginArgs, opts?: CustomResourceOptions);
@overload
def AuthBackendLogin(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     backend: Optional[str] = None,
                     role_id: Optional[str] = None,
                     secret_id: Optional[str] = None)
@overload
def AuthBackendLogin(resource_name: str,
                     args: AuthBackendLoginArgs,
                     opts: Optional[ResourceOptions] = None)
func NewAuthBackendLogin(ctx *Context, name string, args AuthBackendLoginArgs, opts ...ResourceOption) (*AuthBackendLogin, error)
public AuthBackendLogin(string name, AuthBackendLoginArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AuthBackendLoginArgs
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 AuthBackendLoginArgs
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 AuthBackendLoginArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AuthBackendLoginArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AuthBackendLogin Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AuthBackendLogin resource accepts the following input properties:

RoleId string
The ID of the role to log in with.
Backend string
The unique path of the Vault backend to log in with.
SecretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
RoleId string
The ID of the role to log in with.
Backend string
The unique path of the Vault backend to log in with.
SecretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
roleId string
The ID of the role to log in with.
backend string
The unique path of the Vault backend to log in with.
secretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
role_id str
The ID of the role to log in with.
backend str
The unique path of the Vault backend to log in with.
secret_id str
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.

Outputs

All input properties are implicitly available as output properties. Additionally, the AuthBackendLogin resource produces the following output properties:

Accessor string
The accessor for the token.
ClientToken string
The Vault token created.
Id string
The provider-assigned unique ID for this managed resource.
LeaseDuration int
How long the token is valid for, in seconds.
LeaseStarted string
The date and time the lease started, in RFC 3339 format.
Metadata Dictionary<string, string>
The metadata associated with the token.
Policies List<string>
A list of policies applied to the token.
Renewable bool
Whether the token is renewable or not.
Accessor string
The accessor for the token.
ClientToken string
The Vault token created.
Id string
The provider-assigned unique ID for this managed resource.
LeaseDuration int
How long the token is valid for, in seconds.
LeaseStarted string
The date and time the lease started, in RFC 3339 format.
Metadata map[string]string
The metadata associated with the token.
Policies []string
A list of policies applied to the token.
Renewable bool
Whether the token is renewable or not.
accessor string
The accessor for the token.
clientToken string
The Vault token created.
id string
The provider-assigned unique ID for this managed resource.
leaseDuration number
How long the token is valid for, in seconds.
leaseStarted string
The date and time the lease started, in RFC 3339 format.
metadata {[key: string]: string}
The metadata associated with the token.
policies string[]
A list of policies applied to the token.
renewable boolean
Whether the token is renewable or not.
accessor str
The accessor for the token.
client_token str
The Vault token created.
id str
The provider-assigned unique ID for this managed resource.
lease_duration int
How long the token is valid for, in seconds.
lease_started str
The date and time the lease started, in RFC 3339 format.
metadata Mapping[str, str]
The metadata associated with the token.
policies Sequence[str]
A list of policies applied to the token.
renewable bool
Whether the token is renewable or not.

Look up an Existing AuthBackendLogin Resource

Get an existing AuthBackendLogin 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?: AuthBackendLoginState, opts?: CustomResourceOptions): AuthBackendLogin
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        accessor: Optional[str] = None,
        backend: Optional[str] = None,
        client_token: Optional[str] = None,
        lease_duration: Optional[int] = None,
        lease_started: Optional[str] = None,
        metadata: Optional[Mapping[str, str]] = None,
        policies: Optional[Sequence[str]] = None,
        renewable: Optional[bool] = None,
        role_id: Optional[str] = None,
        secret_id: Optional[str] = None) -> AuthBackendLogin
func GetAuthBackendLogin(ctx *Context, name string, id IDInput, state *AuthBackendLoginState, opts ...ResourceOption) (*AuthBackendLogin, error)
public static AuthBackendLogin Get(string name, Input<string> id, AuthBackendLoginState? 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:

Accessor string
The accessor for the token.
Backend string
The unique path of the Vault backend to log in with.
ClientToken string
The Vault token created.
LeaseDuration int
How long the token is valid for, in seconds.
LeaseStarted string
The date and time the lease started, in RFC 3339 format.
Metadata Dictionary<string, string>
The metadata associated with the token.
Policies List<string>
A list of policies applied to the token.
Renewable bool
Whether the token is renewable or not.
RoleId string
The ID of the role to log in with.
SecretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
Accessor string
The accessor for the token.
Backend string
The unique path of the Vault backend to log in with.
ClientToken string
The Vault token created.
LeaseDuration int
How long the token is valid for, in seconds.
LeaseStarted string
The date and time the lease started, in RFC 3339 format.
Metadata map[string]string
The metadata associated with the token.
Policies []string
A list of policies applied to the token.
Renewable bool
Whether the token is renewable or not.
RoleId string
The ID of the role to log in with.
SecretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
accessor string
The accessor for the token.
backend string
The unique path of the Vault backend to log in with.
clientToken string
The Vault token created.
leaseDuration number
How long the token is valid for, in seconds.
leaseStarted string
The date and time the lease started, in RFC 3339 format.
metadata {[key: string]: string}
The metadata associated with the token.
policies string[]
A list of policies applied to the token.
renewable boolean
Whether the token is renewable or not.
roleId string
The ID of the role to log in with.
secretId string
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.
accessor str
The accessor for the token.
backend str
The unique path of the Vault backend to log in with.
client_token str
The Vault token created.
lease_duration int
How long the token is valid for, in seconds.
lease_started str
The date and time the lease started, in RFC 3339 format.
metadata Mapping[str, str]
The metadata associated with the token.
policies Sequence[str]
A list of policies applied to the token.
renewable bool
Whether the token is renewable or not.
role_id str
The ID of the role to log in with.
secret_id str
The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.

Package Details

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