AWS Classic

v5.16.2 published on Tuesday, Oct 4, 2022 by Pulumi

getRandomPassword

Generate a random password.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = Aws.SecretsManager.GetRandomPassword.Invoke(new()
    {
        ExcludeNumbers = true,
        PasswordLength = 50,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/secretsmanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := secretsmanager.GetRandomPassword(ctx, &secretsmanager.GetRandomPasswordArgs{
			ExcludeNumbers: pulumi.BoolRef(true),
			PasswordLength: pulumi.IntRef(50),
		}, nil)
		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.aws.secretsmanager.SecretsmanagerFunctions;
import com.pulumi.aws.secretsmanager.inputs.GetRandomPasswordArgs;
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) {
        final var test = SecretsmanagerFunctions.getRandomPassword(GetRandomPasswordArgs.builder()
            .excludeNumbers(true)
            .passwordLength(50)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test = aws.secretsmanager.get_random_password(exclude_numbers=True,
    password_length=50)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = pulumi.output(aws.secretsmanager.getRandomPassword({
    excludeNumbers: true,
    passwordLength: 50,
}));
variables:
  test:
    Fn::Invoke:
      Function: aws:secretsmanager:getRandomPassword
      Arguments:
        excludeNumbers: true
        passwordLength: 50

Using getRandomPassword

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRandomPassword(args: GetRandomPasswordArgs, opts?: InvokeOptions): Promise<GetRandomPasswordResult>
function getRandomPasswordOutput(args: GetRandomPasswordOutputArgs, opts?: InvokeOptions): Output<GetRandomPasswordResult>
def get_random_password(exclude_characters: Optional[str] = None,
                        exclude_lowercase: Optional[bool] = None,
                        exclude_numbers: Optional[bool] = None,
                        exclude_punctuation: Optional[bool] = None,
                        exclude_uppercase: Optional[bool] = None,
                        include_space: Optional[bool] = None,
                        password_length: Optional[int] = None,
                        random_password: Optional[str] = None,
                        require_each_included_type: Optional[bool] = None,
                        opts: Optional[InvokeOptions] = None) -> GetRandomPasswordResult
def get_random_password_output(exclude_characters: Optional[pulumi.Input[str]] = None,
                        exclude_lowercase: Optional[pulumi.Input[bool]] = None,
                        exclude_numbers: Optional[pulumi.Input[bool]] = None,
                        exclude_punctuation: Optional[pulumi.Input[bool]] = None,
                        exclude_uppercase: Optional[pulumi.Input[bool]] = None,
                        include_space: Optional[pulumi.Input[bool]] = None,
                        password_length: Optional[pulumi.Input[int]] = None,
                        random_password: Optional[pulumi.Input[str]] = None,
                        require_each_included_type: Optional[pulumi.Input[bool]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetRandomPasswordResult]
func GetRandomPassword(ctx *Context, args *GetRandomPasswordArgs, opts ...InvokeOption) (*GetRandomPasswordResult, error)
func GetRandomPasswordOutput(ctx *Context, args *GetRandomPasswordOutputArgs, opts ...InvokeOption) GetRandomPasswordResultOutput

> Note: This function is named GetRandomPassword in the Go SDK.

public static class GetRandomPassword 
{
    public static Task<GetRandomPasswordResult> InvokeAsync(GetRandomPasswordArgs args, InvokeOptions? opts = null)
    public static Output<GetRandomPasswordResult> Invoke(GetRandomPasswordInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRandomPasswordResult> getRandomPassword(GetRandomPasswordArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:secretsmanager/getRandomPassword:getRandomPassword
  Arguments:
    # Arguments dictionary

The following arguments are supported:

ExcludeCharacters string

String of the characters that you don't want in the password.

ExcludeLowercase bool

Specifies whether to exclude lowercase letters from the password.

ExcludeNumbers bool

Specifies whether to exclude numbers from the password.

ExcludePunctuation bool

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

ExcludeUppercase bool

Specifies whether to exclude uppercase letters from the password.

IncludeSpace bool

Specifies whether to include the space character.

PasswordLength int

Length of the password.

RandomPassword string

Random password.

RequireEachIncludedType bool

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

ExcludeCharacters string

String of the characters that you don't want in the password.

ExcludeLowercase bool

Specifies whether to exclude lowercase letters from the password.

ExcludeNumbers bool

Specifies whether to exclude numbers from the password.

ExcludePunctuation bool

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

ExcludeUppercase bool

Specifies whether to exclude uppercase letters from the password.

IncludeSpace bool

Specifies whether to include the space character.

PasswordLength int

Length of the password.

RandomPassword string

Random password.

RequireEachIncludedType bool

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

excludeCharacters String

String of the characters that you don't want in the password.

excludeLowercase Boolean

Specifies whether to exclude lowercase letters from the password.

excludeNumbers Boolean

Specifies whether to exclude numbers from the password.

excludePunctuation Boolean

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

excludeUppercase Boolean

Specifies whether to exclude uppercase letters from the password.

includeSpace Boolean

Specifies whether to include the space character.

passwordLength Integer

Length of the password.

randomPassword String

Random password.

requireEachIncludedType Boolean

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

excludeCharacters string

String of the characters that you don't want in the password.

excludeLowercase boolean

Specifies whether to exclude lowercase letters from the password.

excludeNumbers boolean

Specifies whether to exclude numbers from the password.

excludePunctuation boolean

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

excludeUppercase boolean

Specifies whether to exclude uppercase letters from the password.

includeSpace boolean

Specifies whether to include the space character.

passwordLength number

Length of the password.

randomPassword string

Random password.

requireEachIncludedType boolean

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

exclude_characters str

String of the characters that you don't want in the password.

exclude_lowercase bool

Specifies whether to exclude lowercase letters from the password.

exclude_numbers bool

Specifies whether to exclude numbers from the password.

exclude_punctuation bool

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

exclude_uppercase bool

Specifies whether to exclude uppercase letters from the password.

include_space bool

Specifies whether to include the space character.

password_length int

Length of the password.

random_password str

Random password.

require_each_included_type bool

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

excludeCharacters String

String of the characters that you don't want in the password.

excludeLowercase Boolean

Specifies whether to exclude lowercase letters from the password.

excludeNumbers Boolean

Specifies whether to exclude numbers from the password.

excludePunctuation Boolean

Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .

excludeUppercase Boolean

Specifies whether to exclude uppercase letters from the password.

includeSpace Boolean

Specifies whether to include the space character.

passwordLength Number

Length of the password.

randomPassword String

Random password.

requireEachIncludedType Boolean

Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.

getRandomPassword Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

RandomPassword string

Random password.

ExcludeCharacters string
ExcludeLowercase bool
ExcludeNumbers bool
ExcludePunctuation bool
ExcludeUppercase bool
IncludeSpace bool
PasswordLength int
RequireEachIncludedType bool
Id string

The provider-assigned unique ID for this managed resource.

RandomPassword string

Random password.

ExcludeCharacters string
ExcludeLowercase bool
ExcludeNumbers bool
ExcludePunctuation bool
ExcludeUppercase bool
IncludeSpace bool
PasswordLength int
RequireEachIncludedType bool
id String

The provider-assigned unique ID for this managed resource.

randomPassword String

Random password.

excludeCharacters String
excludeLowercase Boolean
excludeNumbers Boolean
excludePunctuation Boolean
excludeUppercase Boolean
includeSpace Boolean
passwordLength Integer
requireEachIncludedType Boolean
id string

The provider-assigned unique ID for this managed resource.

randomPassword string

Random password.

excludeCharacters string
excludeLowercase boolean
excludeNumbers boolean
excludePunctuation boolean
excludeUppercase boolean
includeSpace boolean
passwordLength number
requireEachIncludedType boolean
id str

The provider-assigned unique ID for this managed resource.

random_password str

Random password.

exclude_characters str
exclude_lowercase bool
exclude_numbers bool
exclude_punctuation bool
exclude_uppercase bool
include_space bool
password_length int
require_each_included_type bool
id String

The provider-assigned unique ID for this managed resource.

randomPassword String

Random password.

excludeCharacters String
excludeLowercase Boolean
excludeNumbers Boolean
excludePunctuation Boolean
excludeUppercase Boolean
includeSpace Boolean
passwordLength Number
requireEachIncludedType Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.