AuthBackendLoginArgs

data class AuthBackendLoginArgs(val backend: Output<String>? = null, val namespace: Output<String>? = null, val roleId: Output<String>? = null, val secretId: Output<String>? = null) : ConvertibleToJava<AuthBackendLoginArgs>

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}

Constructors

Link copied to clipboard
constructor(backend: Output<String>? = null, namespace: Output<String>? = null, roleId: Output<String>? = null, secretId: Output<String>? = null)

Properties

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

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

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

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 roleId: Output<String>? = null

The ID of the role to log in with.

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

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

Functions

Link copied to clipboard
open override fun toJava(): AuthBackendLoginArgs