HashiCorp Vault
SecretRole
Import
AD secret backend roles can be imported using the path
, e.g.
$ pulumi import vault:ad/secretRole:SecretRole role ad/roles/bob
Example Usage
using Pulumi;
using Vault = Pulumi.Vault;
class MyStack : Stack
{
public MyStack()
{
var config = new Vault.AD.SecretBackend("config", new Vault.AD.SecretBackendArgs
{
Backend = "ad",
Binddn = "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
Bindpass = "SuperSecretPassw0rd",
Url = "ldaps://ad",
InsecureTls = true,
Userdn = "CN=Users,DC=corp,DC=example,DC=net",
});
var role = new Vault.AD.SecretRole("role", new Vault.AD.SecretRoleArgs
{
Backend = config.Backend,
Role = "bob",
ServiceAccountName = "Bob",
Ttl = 60,
});
}
}
package main
import (
"github.com/pulumi/pulumi-vault/sdk/v5/go/vault/ad"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
config, err := ad.NewSecretBackend(ctx, "config", &ad.SecretBackendArgs{
Backend: pulumi.String("ad"),
Binddn: pulumi.String("CN=Administrator,CN=Users,DC=corp,DC=example,DC=net"),
Bindpass: pulumi.String("SuperSecretPassw0rd"),
Url: pulumi.String("ldaps://ad"),
InsecureTls: pulumi.Bool(true),
Userdn: pulumi.String("CN=Users,DC=corp,DC=example,DC=net"),
})
if err != nil {
return err
}
_, err = ad.NewSecretRole(ctx, "role", &ad.SecretRoleArgs{
Backend: config.Backend,
Role: pulumi.String("bob"),
ServiceAccountName: pulumi.String("Bob"),
Ttl: pulumi.Int(60),
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_vault as vault
config = vault.ad.SecretBackend("config",
backend="ad",
binddn="CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
bindpass="SuperSecretPassw0rd",
url="ldaps://ad",
insecure_tls=True,
userdn="CN=Users,DC=corp,DC=example,DC=net")
role = vault.ad.SecretRole("role",
backend=config.backend,
role="bob",
service_account_name="Bob",
ttl=60)
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";
const config = new vault.ad.SecretBackend("config", {
backend: "ad",
binddn: "CN=Administrator,CN=Users,DC=corp,DC=example,DC=net",
bindpass: "SuperSecretPassw0rd",
url: "ldaps://ad",
insecureTls: true,
userdn: "CN=Users,DC=corp,DC=example,DC=net",
});
const role = new vault.ad.SecretRole("role", {
backend: config.backend,
role: "bob",
serviceAccountName: "Bob",
ttl: 60,
});
Coming soon!
Create a SecretRole Resource
new SecretRole(name: string, args: SecretRoleArgs, opts?: CustomResourceOptions);
@overload
def SecretRole(resource_name: str,
opts: Optional[ResourceOptions] = None,
backend: Optional[str] = None,
role: Optional[str] = None,
service_account_name: Optional[str] = None,
ttl: Optional[int] = None)
@overload
def SecretRole(resource_name: str,
args: SecretRoleArgs,
opts: Optional[ResourceOptions] = None)
func NewSecretRole(ctx *Context, name string, args SecretRoleArgs, opts ...ResourceOption) (*SecretRole, error)
public SecretRole(string name, SecretRoleArgs args, CustomResourceOptions? opts = null)
public SecretRole(String name, SecretRoleArgs args)
public SecretRole(String name, SecretRoleArgs args, CustomResourceOptions options)
type: vault:ad:SecretRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretRoleArgs
- 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 SecretRoleArgs
- 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 SecretRoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SecretRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SecretRoleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
SecretRole 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 SecretRole resource accepts the following input properties:
- Backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- Role string
The name to identify this role within the backend. Must be unique within the backend.
- Service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- Ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- Backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- Role string
The name to identify this role within the backend. Must be unique within the backend.
- Service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- Ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend String
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- role String
The name to identify this role within the backend. Must be unique within the backend.
- service
Account StringName Specifies the name of the Active Directory service account mapped to this role.
- ttl Integer
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- role string
The name to identify this role within the backend. Must be unique within the backend.
- service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- ttl number
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend str
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- role str
The name to identify this role within the backend. Must be unique within the backend.
- service_
account_ strname Specifies the name of the Active Directory service account mapped to this role.
- ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend String
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- role String
The name to identify this role within the backend. Must be unique within the backend.
- service
Account StringName Specifies the name of the Active Directory service account mapped to this role.
- ttl Number
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
Outputs
All input properties are implicitly available as output properties. Additionally, the SecretRole resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Vault stringRotation Timestamp of the last password rotation by Vault.
- Password
Last stringSet Timestamp of the last password set by Vault.
- Id string
The provider-assigned unique ID for this managed resource.
- Last
Vault stringRotation Timestamp of the last password rotation by Vault.
- Password
Last stringSet Timestamp of the last password set by Vault.
- id String
The provider-assigned unique ID for this managed resource.
- last
Vault StringRotation Timestamp of the last password rotation by Vault.
- password
Last StringSet Timestamp of the last password set by Vault.
- id string
The provider-assigned unique ID for this managed resource.
- last
Vault stringRotation Timestamp of the last password rotation by Vault.
- password
Last stringSet Timestamp of the last password set by Vault.
- id str
The provider-assigned unique ID for this managed resource.
- last_
vault_ strrotation Timestamp of the last password rotation by Vault.
- password_
last_ strset Timestamp of the last password set by Vault.
- id String
The provider-assigned unique ID for this managed resource.
- last
Vault StringRotation Timestamp of the last password rotation by Vault.
- password
Last StringSet Timestamp of the last password set by Vault.
Look up an Existing SecretRole Resource
Get an existing SecretRole 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?: SecretRoleState, opts?: CustomResourceOptions): SecretRole
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backend: Optional[str] = None,
last_vault_rotation: Optional[str] = None,
password_last_set: Optional[str] = None,
role: Optional[str] = None,
service_account_name: Optional[str] = None,
ttl: Optional[int] = None) -> SecretRole
func GetSecretRole(ctx *Context, name string, id IDInput, state *SecretRoleState, opts ...ResourceOption) (*SecretRole, error)
public static SecretRole Get(string name, Input<string> id, SecretRoleState? state, CustomResourceOptions? opts = null)
public static SecretRole get(String name, Output<String> id, SecretRoleState 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.
- Backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- Last
Vault stringRotation Timestamp of the last password rotation by Vault.
- Password
Last stringSet Timestamp of the last password set by Vault.
- Role string
The name to identify this role within the backend. Must be unique within the backend.
- Service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- Ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- Backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- Last
Vault stringRotation Timestamp of the last password rotation by Vault.
- Password
Last stringSet Timestamp of the last password set by Vault.
- Role string
The name to identify this role within the backend. Must be unique within the backend.
- Service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- Ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend String
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- last
Vault StringRotation Timestamp of the last password rotation by Vault.
- password
Last StringSet Timestamp of the last password set by Vault.
- role String
The name to identify this role within the backend. Must be unique within the backend.
- service
Account StringName Specifies the name of the Active Directory service account mapped to this role.
- ttl Integer
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend string
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- last
Vault stringRotation Timestamp of the last password rotation by Vault.
- password
Last stringSet Timestamp of the last password set by Vault.
- role string
The name to identify this role within the backend. Must be unique within the backend.
- service
Account stringName Specifies the name of the Active Directory service account mapped to this role.
- ttl number
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend str
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- last_
vault_ strrotation Timestamp of the last password rotation by Vault.
- password_
last_ strset Timestamp of the last password set by Vault.
- role str
The name to identify this role within the backend. Must be unique within the backend.
- service_
account_ strname Specifies the name of the Active Directory service account mapped to this role.
- ttl int
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
- backend String
The path the AD secret backend is mounted at, with no leading or trailing
/
s.- last
Vault StringRotation Timestamp of the last password rotation by Vault.
- password
Last StringSet Timestamp of the last password set by Vault.
- role String
The name to identify this role within the backend. Must be unique within the backend.
- service
Account StringName Specifies the name of the Active Directory service account mapped to this role.
- ttl Number
The password time-to-live in seconds. Defaults to the configuration ttl if not provided.
Package Details
- Repository
- https://github.com/pulumi/pulumi-vault
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
vault
Terraform Provider.