AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
aws.secretsmanager.getRandomPassword
Explore with Pulumi AI
Generate a random password.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = aws.secretsmanager.getRandomPassword({
passwordLength: 50,
excludeNumbers: true,
});
import pulumi
import pulumi_aws as aws
test = aws.secretsmanager.get_random_password(password_length=50,
exclude_numbers=True)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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{
PasswordLength: pulumi.IntRef(50),
ExcludeNumbers: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = Aws.SecretsManager.GetRandomPassword.Invoke(new()
{
PasswordLength = 50,
ExcludeNumbers = true,
});
});
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()
.passwordLength(50)
.excludeNumbers(true)
.build());
}
}
variables:
test:
fn::invoke:
Function: aws:secretsmanager:getRandomPassword
Arguments:
passwordLength: 50
excludeNumbers: true
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,
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,
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:
- Exclude
Characters string - 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.
- Require
Each boolIncluded Type - Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
- Exclude
Characters string - 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.
- Require
Each boolIncluded Type - Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
- exclude
Characters String - String of the characters that you don't want in the password.
- exclude
Lowercase Boolean - Specifies whether to exclude lowercase letters from the password.
- exclude
Numbers Boolean - Specifies whether to exclude numbers from the password.
- exclude
Punctuation Boolean - Specifies whether to exclude the following punctuation characters from the password:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .
- exclude
Uppercase Boolean - Specifies whether to exclude uppercase letters from the password.
- include
Space Boolean - Specifies whether to include the space character.
- password
Length Integer - Length of the password.
- require
Each BooleanIncluded Type - Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
- exclude
Characters string - String of the characters that you don't want in the password.
- exclude
Lowercase boolean - Specifies whether to exclude lowercase letters from the password.
- exclude
Numbers boolean - Specifies whether to exclude numbers from the password.
- exclude
Punctuation boolean - Specifies whether to exclude the following punctuation characters from the password:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .
- exclude
Uppercase boolean - Specifies whether to exclude uppercase letters from the password.
- include
Space boolean - Specifies whether to include the space character.
- password
Length number - Length of the password.
- require
Each booleanIncluded Type - 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.
- require_
each_ boolincluded_ type - Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation.
- exclude
Characters String - String of the characters that you don't want in the password.
- exclude
Lowercase Boolean - Specifies whether to exclude lowercase letters from the password.
- exclude
Numbers Boolean - Specifies whether to exclude numbers from the password.
- exclude
Punctuation Boolean - Specifies whether to exclude the following punctuation characters from the password:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .
- exclude
Uppercase Boolean - Specifies whether to exclude uppercase letters from the password.
- include
Space Boolean - Specifies whether to include the space character.
- password
Length Number - Length of the password.
- require
Each BooleanIncluded Type - 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.
- Random
Password string - Random password.
- Exclude
Characters string - Exclude
Lowercase bool - Exclude
Numbers bool - Exclude
Punctuation bool - Exclude
Uppercase bool - Include
Space bool - Password
Length int - Require
Each boolIncluded Type
- Id string
- The provider-assigned unique ID for this managed resource.
- Random
Password string - Random password.
- Exclude
Characters string - Exclude
Lowercase bool - Exclude
Numbers bool - Exclude
Punctuation bool - Exclude
Uppercase bool - Include
Space bool - Password
Length int - Require
Each boolIncluded Type
- id String
- The provider-assigned unique ID for this managed resource.
- random
Password String - Random password.
- exclude
Characters String - exclude
Lowercase Boolean - exclude
Numbers Boolean - exclude
Punctuation Boolean - exclude
Uppercase Boolean - include
Space Boolean - password
Length Integer - require
Each BooleanIncluded Type
- id string
- The provider-assigned unique ID for this managed resource.
- random
Password string - Random password.
- exclude
Characters string - exclude
Lowercase boolean - exclude
Numbers boolean - exclude
Punctuation boolean - exclude
Uppercase boolean - include
Space boolean - password
Length number - require
Each booleanIncluded Type
- 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_ boolincluded_ type
- id String
- The provider-assigned unique ID for this managed resource.
- random
Password String - Random password.
- exclude
Characters String - exclude
Lowercase Boolean - exclude
Numbers Boolean - exclude
Punctuation Boolean - exclude
Uppercase Boolean - include
Space Boolean - password
Length Number - require
Each BooleanIncluded Type
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.