AuthBackendLogin

class AuthBackendLogin : KotlinCustomResource

Logs into Vault using the AppRole auth backend. See the [Vault

  • documentation](https://www.vaultproject.io/docs/auth/approle) for more information.

Example Usage

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,
roleName: "test-role",
tokenPolicies: [
"default",
"dev",
"prod",
],
});
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,
});
import pulumi
import pulumi_vault as vault
approle = vault.AuthBackend("approle", type="approle")
example = vault.app_role.AuthBackendRole("example",
backend=approle.path,
role_name="test-role",
token_policies=[
"default",
"dev",
"prod",
])
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)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;
return await Deployment.RunAsync(() =>
{
var approle = new Vault.AuthBackend("approle", new()
{
Type = "approle",
});
var example = new Vault.AppRole.AuthBackendRole("example", new()
{
Backend = approle.Path,
RoleName = "test-role",
TokenPolicies = new[]
{
"default",
"dev",
"prod",
},
});
var id = new Vault.AppRole.AuthBackendRoleSecretId("id", new()
{
Backend = approle.Path,
RoleName = example.RoleName,
});
var login = new Vault.AppRole.AuthBackendLogin("login", new()
{
Backend = approle.Path,
RoleId = example.RoleId,
SecretId = id.SecretId,
});
});
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
"github.com/pulumi/pulumi-vault/sdk/v6/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,
RoleName: pulumi.String("test-role"),
TokenPolicies: pulumi.StringArray{
pulumi.String("default"),
pulumi.String("dev"),
pulumi.String("prod"),
},
})
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
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.AuthBackend;
import com.pulumi.vault.AuthBackendArgs;
import com.pulumi.vault.appRole.AuthBackendRole;
import com.pulumi.vault.appRole.AuthBackendRoleArgs;
import com.pulumi.vault.appRole.AuthBackendRoleSecretId;
import com.pulumi.vault.appRole.AuthBackendRoleSecretIdArgs;
import com.pulumi.vault.appRole.AuthBackendLogin;
import com.pulumi.vault.appRole.AuthBackendLoginArgs;
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 approle = new AuthBackend("approle", AuthBackendArgs.builder()
.type("approle")
.build());
var example = new AuthBackendRole("example", AuthBackendRoleArgs.builder()
.backend(approle.path())
.roleName("test-role")
.tokenPolicies(
"default",
"dev",
"prod")
.build());
var id = new AuthBackendRoleSecretId("id", AuthBackendRoleSecretIdArgs.builder()
.backend(approle.path())
.roleName(example.roleName())
.build());
var login = new AuthBackendLogin("login", AuthBackendLoginArgs.builder()
.backend(approle.path())
.roleId(example.roleId())
.secretId(id.secretId())
.build());
}
}
resources:
approle:
type: vault:AuthBackend
properties:
type: approle
example:
type: vault:appRole:AuthBackendRole
properties:
backend: ${approle.path}
roleName: test-role
tokenPolicies:
- default
- dev
- prod
id:
type: vault:appRole:AuthBackendRoleSecretId
properties:
backend: ${approle.path}
roleName: ${example.roleName}
login:
type: vault:appRole:AuthBackendLogin
properties:
backend: ${approle.path}
roleId: ${example.roleId}
secretId: ${id.secretId}

Properties

Link copied to clipboard
val accessor: Output<String>

The accessor for the token.

Link copied to clipboard
val backend: Output<String>?

The unique path of the Vault backend to log in with.

Link copied to clipboard
val clientToken: Output<String>

The Vault token created.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val leaseDuration: Output<Int>

How long the token is valid for, in seconds.

Link copied to clipboard
val leaseStarted: Output<String>

The date and time the lease started, in RFC 3339 format.

Link copied to clipboard
val metadata: Output<Map<String, String>>

The metadata associated with the token.

Link copied to clipboard
val namespace: Output<String>?

The namespace to provision the resource in. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

Link copied to clipboard
val policies: Output<List<String>>

A list of policies applied to the token.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val renewable: Output<Boolean>

Whether the token is renewable or not.

Link copied to clipboard
val roleId: Output<String>

The ID of the role to log in with.

Link copied to clipboard
val secretId: Output<String>?

The secret ID of the role to log in with. Required unless bind_secret_id is set to false on the role.

Link copied to clipboard
val urn: Output<String>