github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/secretsmanager/getRandomPassword.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package secretsmanager 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Generate a random password. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/secretsmanager" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := secretsmanager.GetRandomPassword(ctx, &secretsmanager.GetRandomPasswordArgs{ 32 // PasswordLength: pulumi.IntRef(50), 33 // ExcludeNumbers: pulumi.BoolRef(true), 34 // }, nil) 35 // if err != nil { 36 // return err 37 // } 38 // return nil 39 // }) 40 // } 41 // 42 // ``` 43 // <!--End PulumiCodeChooser --> 44 func GetRandomPassword(ctx *pulumi.Context, args *GetRandomPasswordArgs, opts ...pulumi.InvokeOption) (*GetRandomPasswordResult, error) { 45 opts = internal.PkgInvokeDefaultOpts(opts) 46 var rv GetRandomPasswordResult 47 err := ctx.Invoke("aws:secretsmanager/getRandomPassword:getRandomPassword", args, &rv, opts...) 48 if err != nil { 49 return nil, err 50 } 51 return &rv, nil 52 } 53 54 // A collection of arguments for invoking getRandomPassword. 55 type GetRandomPasswordArgs struct { 56 // String of the characters that you don't want in the password. 57 ExcludeCharacters *string `pulumi:"excludeCharacters"` 58 // Specifies whether to exclude lowercase letters from the password. 59 ExcludeLowercase *bool `pulumi:"excludeLowercase"` 60 // Specifies whether to exclude numbers from the password. 61 ExcludeNumbers *bool `pulumi:"excludeNumbers"` 62 // Specifies whether to exclude the following punctuation characters from the password: ``! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .`` 63 ExcludePunctuation *bool `pulumi:"excludePunctuation"` 64 // Specifies whether to exclude uppercase letters from the password. 65 ExcludeUppercase *bool `pulumi:"excludeUppercase"` 66 // Specifies whether to include the space character. 67 IncludeSpace *bool `pulumi:"includeSpace"` 68 // Length of the password. 69 PasswordLength *int `pulumi:"passwordLength"` 70 // Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. 71 RequireEachIncludedType *bool `pulumi:"requireEachIncludedType"` 72 } 73 74 // A collection of values returned by getRandomPassword. 75 type GetRandomPasswordResult struct { 76 ExcludeCharacters *string `pulumi:"excludeCharacters"` 77 ExcludeLowercase *bool `pulumi:"excludeLowercase"` 78 ExcludeNumbers *bool `pulumi:"excludeNumbers"` 79 ExcludePunctuation *bool `pulumi:"excludePunctuation"` 80 ExcludeUppercase *bool `pulumi:"excludeUppercase"` 81 // The provider-assigned unique ID for this managed resource. 82 Id string `pulumi:"id"` 83 IncludeSpace *bool `pulumi:"includeSpace"` 84 PasswordLength *int `pulumi:"passwordLength"` 85 // Random password. 86 RandomPassword string `pulumi:"randomPassword"` 87 RequireEachIncludedType *bool `pulumi:"requireEachIncludedType"` 88 } 89 90 func GetRandomPasswordOutput(ctx *pulumi.Context, args GetRandomPasswordOutputArgs, opts ...pulumi.InvokeOption) GetRandomPasswordResultOutput { 91 return pulumi.ToOutputWithContext(context.Background(), args). 92 ApplyT(func(v interface{}) (GetRandomPasswordResult, error) { 93 args := v.(GetRandomPasswordArgs) 94 r, err := GetRandomPassword(ctx, &args, opts...) 95 var s GetRandomPasswordResult 96 if r != nil { 97 s = *r 98 } 99 return s, err 100 }).(GetRandomPasswordResultOutput) 101 } 102 103 // A collection of arguments for invoking getRandomPassword. 104 type GetRandomPasswordOutputArgs struct { 105 // String of the characters that you don't want in the password. 106 ExcludeCharacters pulumi.StringPtrInput `pulumi:"excludeCharacters"` 107 // Specifies whether to exclude lowercase letters from the password. 108 ExcludeLowercase pulumi.BoolPtrInput `pulumi:"excludeLowercase"` 109 // Specifies whether to exclude numbers from the password. 110 ExcludeNumbers pulumi.BoolPtrInput `pulumi:"excludeNumbers"` 111 // Specifies whether to exclude the following punctuation characters from the password: ``! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ .`` 112 ExcludePunctuation pulumi.BoolPtrInput `pulumi:"excludePunctuation"` 113 // Specifies whether to exclude uppercase letters from the password. 114 ExcludeUppercase pulumi.BoolPtrInput `pulumi:"excludeUppercase"` 115 // Specifies whether to include the space character. 116 IncludeSpace pulumi.BoolPtrInput `pulumi:"includeSpace"` 117 // Length of the password. 118 PasswordLength pulumi.IntPtrInput `pulumi:"passwordLength"` 119 // Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. 120 RequireEachIncludedType pulumi.BoolPtrInput `pulumi:"requireEachIncludedType"` 121 } 122 123 func (GetRandomPasswordOutputArgs) ElementType() reflect.Type { 124 return reflect.TypeOf((*GetRandomPasswordArgs)(nil)).Elem() 125 } 126 127 // A collection of values returned by getRandomPassword. 128 type GetRandomPasswordResultOutput struct{ *pulumi.OutputState } 129 130 func (GetRandomPasswordResultOutput) ElementType() reflect.Type { 131 return reflect.TypeOf((*GetRandomPasswordResult)(nil)).Elem() 132 } 133 134 func (o GetRandomPasswordResultOutput) ToGetRandomPasswordResultOutput() GetRandomPasswordResultOutput { 135 return o 136 } 137 138 func (o GetRandomPasswordResultOutput) ToGetRandomPasswordResultOutputWithContext(ctx context.Context) GetRandomPasswordResultOutput { 139 return o 140 } 141 142 func (o GetRandomPasswordResultOutput) ExcludeCharacters() pulumi.StringPtrOutput { 143 return o.ApplyT(func(v GetRandomPasswordResult) *string { return v.ExcludeCharacters }).(pulumi.StringPtrOutput) 144 } 145 146 func (o GetRandomPasswordResultOutput) ExcludeLowercase() pulumi.BoolPtrOutput { 147 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.ExcludeLowercase }).(pulumi.BoolPtrOutput) 148 } 149 150 func (o GetRandomPasswordResultOutput) ExcludeNumbers() pulumi.BoolPtrOutput { 151 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.ExcludeNumbers }).(pulumi.BoolPtrOutput) 152 } 153 154 func (o GetRandomPasswordResultOutput) ExcludePunctuation() pulumi.BoolPtrOutput { 155 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.ExcludePunctuation }).(pulumi.BoolPtrOutput) 156 } 157 158 func (o GetRandomPasswordResultOutput) ExcludeUppercase() pulumi.BoolPtrOutput { 159 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.ExcludeUppercase }).(pulumi.BoolPtrOutput) 160 } 161 162 // The provider-assigned unique ID for this managed resource. 163 func (o GetRandomPasswordResultOutput) Id() pulumi.StringOutput { 164 return o.ApplyT(func(v GetRandomPasswordResult) string { return v.Id }).(pulumi.StringOutput) 165 } 166 167 func (o GetRandomPasswordResultOutput) IncludeSpace() pulumi.BoolPtrOutput { 168 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.IncludeSpace }).(pulumi.BoolPtrOutput) 169 } 170 171 func (o GetRandomPasswordResultOutput) PasswordLength() pulumi.IntPtrOutput { 172 return o.ApplyT(func(v GetRandomPasswordResult) *int { return v.PasswordLength }).(pulumi.IntPtrOutput) 173 } 174 175 // Random password. 176 func (o GetRandomPasswordResultOutput) RandomPassword() pulumi.StringOutput { 177 return o.ApplyT(func(v GetRandomPasswordResult) string { return v.RandomPassword }).(pulumi.StringOutput) 178 } 179 180 func (o GetRandomPasswordResultOutput) RequireEachIncludedType() pulumi.BoolPtrOutput { 181 return o.ApplyT(func(v GetRandomPasswordResult) *bool { return v.RequireEachIncludedType }).(pulumi.BoolPtrOutput) 182 } 183 184 func init() { 185 pulumi.RegisterOutputType(GetRandomPasswordResultOutput{}) 186 }