PasswordPolicy

Provides a resource to manage Password Policies

Note this feature is available only Vault 1.5+

Example Usage

using Pulumi;
using Vault = Pulumi.Vault;

class MyStack : Stack
{
    public MyStack()
    {
        var alphanumeric = new Vault.PasswordPolicy("alphanumeric", new Vault.PasswordPolicyArgs
        {
            Policy = @"length = 20
rule ""charset"" {
	  charset = ""abcdefghijklmnopqrstuvwxyz0123456789""
}

",
        });
    }

}
package main

import (
	"fmt"

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := vault.NewPasswordPolicy(ctx, "alphanumeric", &vault.PasswordPolicyArgs{
			Policy: pulumi.String(fmt.Sprintf("%v%v%v%v%v", "length = 20\n", "rule \"charset\" {\n", "	  charset = \"abcdefghijklmnopqrstuvwxyz0123456789\"\n", "}\n", "\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_vault as vault

alphanumeric = vault.PasswordPolicy("alphanumeric", policy="""length = 20
rule "charset" {
	  charset = "abcdefghijklmnopqrstuvwxyz0123456789"
}

""")
import * as pulumi from "@pulumi/pulumi";
import * as vault from "@pulumi/vault";

const alphanumeric = new vault.PasswordPolicy("alphanumeric", {
    policy: `length = 20
rule "charset" {
	  charset = "abcdefghijklmnopqrstuvwxyz0123456789"
}
`,
});

Create a PasswordPolicy Resource

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

PasswordPolicy Resource Properties

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

Inputs

The PasswordPolicy resource accepts the following input properties:

Policy string
String containing a password policy.
Name string
The name of the password policy.
Policy string
String containing a password policy.
Name string
The name of the password policy.
policy string
String containing a password policy.
name string
The name of the password policy.
policy str
String containing a password policy.
name str
The name of the password policy.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing PasswordPolicy Resource

Get an existing PasswordPolicy 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?: PasswordPolicyState, opts?: CustomResourceOptions): PasswordPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        policy: Optional[str] = None) -> PasswordPolicy
func GetPasswordPolicy(ctx *Context, name string, id IDInput, state *PasswordPolicyState, opts ...ResourceOption) (*PasswordPolicy, error)
public static PasswordPolicy Get(string name, Input<string> id, PasswordPolicyState? 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:

Name string
The name of the password policy.
Policy string
String containing a password policy.
Name string
The name of the password policy.
Policy string
String containing a password policy.
name string
The name of the password policy.
policy string
String containing a password policy.
name str
The name of the password policy.
policy str
String containing a password policy.

Import

Password policies can be imported using the name, e.g.

 $ pulumi import vault:index/passwordPolicy:PasswordPolicy alphanumeric alphanumeric

Package Details

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