HashiCorp Vault
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,
RoleName = "test-role",
TokenPolicies =
{
"default",
"dev",
"prod",
},
});
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/v5/go/vault"
"github.com/pulumi/pulumi-vault/sdk/v5/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
})
}
Coming soon!
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)
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,
});
Coming soon!
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)
public AuthBackendLogin(String name, AuthBackendLoginArgs args)
public AuthBackendLogin(String name, AuthBackendLoginArgs args, CustomResourceOptions options)
type: vault:appRole:AuthBackendLogin
properties: # The arguments to resource properties.
options: # 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.
- 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.
- name String
- The unique name of the resource.
- args AuthBackendLoginArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts docs.
Inputs
The AuthBackendLogin resource accepts the following input properties:
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.
- Client
Token string The Vault token created.
- Id string
The provider-assigned unique ID for this managed resource.
- Lease
Duration int How long the token is valid for, in seconds.
- Lease
Started 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.
- Client
Token string The Vault token created.
- Id string
The provider-assigned unique ID for this managed resource.
- Lease
Duration int How long the token is valid for, in seconds.
- Lease
Started 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.
- client
Token String The Vault token created.
- id String
The provider-assigned unique ID for this managed resource.
- lease
Duration Integer How long the token is valid for, in seconds.
- lease
Started String The date and time the lease started, in RFC 3339 format.
- metadata Map<String,String>
The metadata associated with the token.
- policies List<String>
A list of policies applied to the token.
- renewable Boolean
Whether the token is renewable or not.
- accessor string
The accessor for the token.
- client
Token string The Vault token created.
- id string
The provider-assigned unique ID for this managed resource.
- lease
Duration number How long the token is valid for, in seconds.
- lease
Started 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.
- accessor String
The accessor for the token.
- client
Token String The Vault token created.
- id String
The provider-assigned unique ID for this managed resource.
- lease
Duration Number How long the token is valid for, in seconds.
- lease
Started String The date and time the lease started, in RFC 3339 format.
- metadata Map<String>
The metadata associated with the token.
- policies List<String>
A list of policies applied to the token.
- renewable Boolean
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)
public static AuthBackendLogin get(String name, Output<String> id, AuthBackendLoginState 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.
- Accessor string
The accessor for the token.
- Backend string
The unique path of the Vault backend to log in with.
- Client
Token string The Vault token created.
- Lease
Duration int How long the token is valid for, in seconds.
- Lease
Started 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.
- Role
Id string The ID of the role to log in with.
- Secret
Id 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.
- Client
Token string The Vault token created.
- Lease
Duration int How long the token is valid for, in seconds.
- Lease
Started 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.
- Role
Id string The ID of the role to log in with.
- Secret
Id 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.
- client
Token String The Vault token created.
- lease
Duration Integer How long the token is valid for, in seconds.
- lease
Started String The date and time the lease started, in RFC 3339 format.
- metadata Map<String,String>
The metadata associated with the token.
- policies List<String>
A list of policies applied to the token.
- renewable Boolean
Whether the token is renewable or not.
- role
Id String The ID of the role to log in with.
- secret
Id 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.
- client
Token string The Vault token created.
- lease
Duration number How long the token is valid for, in seconds.
- lease
Started 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.
- role
Id string The ID of the role to log in with.
- secret
Id 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.
- accessor String
The accessor for the token.
- backend String
The unique path of the Vault backend to log in with.
- client
Token String The Vault token created.
- lease
Duration Number How long the token is valid for, in seconds.
- lease
Started String The date and time the lease started, in RFC 3339 format.
- metadata Map<String>
The metadata associated with the token.
- policies List<String>
A list of policies applied to the token.
- renewable Boolean
Whether the token is renewable or not.
- role
Id String The ID of the role to log in with.
- secret
Id String 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.