1. Packages
  2. AWS Classic
  3. API Docs
  4. iam
  5. AccountPasswordPolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

aws.iam.AccountPasswordPolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

    Note: There is only a single policy allowed per AWS account. An existing policy will be lost when using this resource as an effect of this limitation.

    Manages Password Policy for the AWS Account. See more about Account Password Policy in the official AWS docs.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var strict = new Aws.Iam.AccountPasswordPolicy("strict", new()
        {
            AllowUsersToChangePassword = true,
            MinimumPasswordLength = 8,
            RequireLowercaseCharacters = true,
            RequireNumbers = true,
            RequireSymbols = true,
            RequireUppercaseCharacters = true,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/iam"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := iam.NewAccountPasswordPolicy(ctx, "strict", &iam.AccountPasswordPolicyArgs{
    			AllowUsersToChangePassword: pulumi.Bool(true),
    			MinimumPasswordLength:      pulumi.Int(8),
    			RequireLowercaseCharacters: pulumi.Bool(true),
    			RequireNumbers:             pulumi.Bool(true),
    			RequireSymbols:             pulumi.Bool(true),
    			RequireUppercaseCharacters: pulumi.Bool(true),
    		})
    		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.iam.AccountPasswordPolicy;
    import com.pulumi.aws.iam.AccountPasswordPolicyArgs;
    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) {
            var strict = new AccountPasswordPolicy("strict", AccountPasswordPolicyArgs.builder()        
                .allowUsersToChangePassword(true)
                .minimumPasswordLength(8)
                .requireLowercaseCharacters(true)
                .requireNumbers(true)
                .requireSymbols(true)
                .requireUppercaseCharacters(true)
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    strict = aws.iam.AccountPasswordPolicy("strict",
        allow_users_to_change_password=True,
        minimum_password_length=8,
        require_lowercase_characters=True,
        require_numbers=True,
        require_symbols=True,
        require_uppercase_characters=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const strict = new aws.iam.AccountPasswordPolicy("strict", {
        allowUsersToChangePassword: true,
        minimumPasswordLength: 8,
        requireLowercaseCharacters: true,
        requireNumbers: true,
        requireSymbols: true,
        requireUppercaseCharacters: true,
    });
    
    resources:
      strict:
        type: aws:iam:AccountPasswordPolicy
        properties:
          allowUsersToChangePassword: true
          minimumPasswordLength: 8
          requireLowercaseCharacters: true
          requireNumbers: true
          requireSymbols: true
          requireUppercaseCharacters: true
    

    Create AccountPasswordPolicy Resource

    new AccountPasswordPolicy(name: string, args?: AccountPasswordPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def AccountPasswordPolicy(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              allow_users_to_change_password: Optional[bool] = None,
                              hard_expiry: Optional[bool] = None,
                              max_password_age: Optional[int] = None,
                              minimum_password_length: Optional[int] = None,
                              password_reuse_prevention: Optional[int] = None,
                              require_lowercase_characters: Optional[bool] = None,
                              require_numbers: Optional[bool] = None,
                              require_symbols: Optional[bool] = None,
                              require_uppercase_characters: Optional[bool] = None)
    @overload
    def AccountPasswordPolicy(resource_name: str,
                              args: Optional[AccountPasswordPolicyArgs] = None,
                              opts: Optional[ResourceOptions] = None)
    func NewAccountPasswordPolicy(ctx *Context, name string, args *AccountPasswordPolicyArgs, opts ...ResourceOption) (*AccountPasswordPolicy, error)
    public AccountPasswordPolicy(string name, AccountPasswordPolicyArgs? args = null, CustomResourceOptions? opts = null)
    public AccountPasswordPolicy(String name, AccountPasswordPolicyArgs args)
    public AccountPasswordPolicy(String name, AccountPasswordPolicyArgs args, CustomResourceOptions options)
    
    type: aws:iam:AccountPasswordPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args AccountPasswordPolicyArgs
    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 AccountPasswordPolicyArgs
    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 AccountPasswordPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountPasswordPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountPasswordPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    AccountPasswordPolicy 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 AccountPasswordPolicy resource accepts the following input properties:

    AllowUsersToChangePassword bool

    Whether to allow users to change their own password

    HardExpiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    MaxPasswordAge int

    The number of days that an user password is valid.

    MinimumPasswordLength int

    Minimum length to require for user passwords.

    PasswordReusePrevention int

    The number of previous passwords that users are prevented from reusing.

    RequireLowercaseCharacters bool

    Whether to require lowercase characters for user passwords.

    RequireNumbers bool

    Whether to require numbers for user passwords.

    RequireSymbols bool

    Whether to require symbols for user passwords.

    RequireUppercaseCharacters bool

    Whether to require uppercase characters for user passwords.

    AllowUsersToChangePassword bool

    Whether to allow users to change their own password

    HardExpiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    MaxPasswordAge int

    The number of days that an user password is valid.

    MinimumPasswordLength int

    Minimum length to require for user passwords.

    PasswordReusePrevention int

    The number of previous passwords that users are prevented from reusing.

    RequireLowercaseCharacters bool

    Whether to require lowercase characters for user passwords.

    RequireNumbers bool

    Whether to require numbers for user passwords.

    RequireSymbols bool

    Whether to require symbols for user passwords.

    RequireUppercaseCharacters bool

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword Boolean

    Whether to allow users to change their own password

    hardExpiry Boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge Integer

    The number of days that an user password is valid.

    minimumPasswordLength Integer

    Minimum length to require for user passwords.

    passwordReusePrevention Integer

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters Boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers Boolean

    Whether to require numbers for user passwords.

    requireSymbols Boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters Boolean

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword boolean

    Whether to allow users to change their own password

    hardExpiry boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge number

    The number of days that an user password is valid.

    minimumPasswordLength number

    Minimum length to require for user passwords.

    passwordReusePrevention number

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers boolean

    Whether to require numbers for user passwords.

    requireSymbols boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters boolean

    Whether to require uppercase characters for user passwords.

    allow_users_to_change_password bool

    Whether to allow users to change their own password

    hard_expiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    max_password_age int

    The number of days that an user password is valid.

    minimum_password_length int

    Minimum length to require for user passwords.

    password_reuse_prevention int

    The number of previous passwords that users are prevented from reusing.

    require_lowercase_characters bool

    Whether to require lowercase characters for user passwords.

    require_numbers bool

    Whether to require numbers for user passwords.

    require_symbols bool

    Whether to require symbols for user passwords.

    require_uppercase_characters bool

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword Boolean

    Whether to allow users to change their own password

    hardExpiry Boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge Number

    The number of days that an user password is valid.

    minimumPasswordLength Number

    Minimum length to require for user passwords.

    passwordReusePrevention Number

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters Boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers Boolean

    Whether to require numbers for user passwords.

    requireSymbols Boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters Boolean

    Whether to require uppercase characters for user passwords.

    Outputs

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

    ExpirePasswords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    Id string

    The provider-assigned unique ID for this managed resource.

    ExpirePasswords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    Id string

    The provider-assigned unique ID for this managed resource.

    expirePasswords Boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    id String

    The provider-assigned unique ID for this managed resource.

    expirePasswords boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    id string

    The provider-assigned unique ID for this managed resource.

    expire_passwords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    id str

    The provider-assigned unique ID for this managed resource.

    expirePasswords Boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    id String

    The provider-assigned unique ID for this managed resource.

    Look up Existing AccountPasswordPolicy Resource

    Get an existing AccountPasswordPolicy 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?: AccountPasswordPolicyState, opts?: CustomResourceOptions): AccountPasswordPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            allow_users_to_change_password: Optional[bool] = None,
            expire_passwords: Optional[bool] = None,
            hard_expiry: Optional[bool] = None,
            max_password_age: Optional[int] = None,
            minimum_password_length: Optional[int] = None,
            password_reuse_prevention: Optional[int] = None,
            require_lowercase_characters: Optional[bool] = None,
            require_numbers: Optional[bool] = None,
            require_symbols: Optional[bool] = None,
            require_uppercase_characters: Optional[bool] = None) -> AccountPasswordPolicy
    func GetAccountPasswordPolicy(ctx *Context, name string, id IDInput, state *AccountPasswordPolicyState, opts ...ResourceOption) (*AccountPasswordPolicy, error)
    public static AccountPasswordPolicy Get(string name, Input<string> id, AccountPasswordPolicyState? state, CustomResourceOptions? opts = null)
    public static AccountPasswordPolicy get(String name, Output<String> id, AccountPasswordPolicyState 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.
    The following state arguments are supported:
    AllowUsersToChangePassword bool

    Whether to allow users to change their own password

    ExpirePasswords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    HardExpiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    MaxPasswordAge int

    The number of days that an user password is valid.

    MinimumPasswordLength int

    Minimum length to require for user passwords.

    PasswordReusePrevention int

    The number of previous passwords that users are prevented from reusing.

    RequireLowercaseCharacters bool

    Whether to require lowercase characters for user passwords.

    RequireNumbers bool

    Whether to require numbers for user passwords.

    RequireSymbols bool

    Whether to require symbols for user passwords.

    RequireUppercaseCharacters bool

    Whether to require uppercase characters for user passwords.

    AllowUsersToChangePassword bool

    Whether to allow users to change their own password

    ExpirePasswords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    HardExpiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    MaxPasswordAge int

    The number of days that an user password is valid.

    MinimumPasswordLength int

    Minimum length to require for user passwords.

    PasswordReusePrevention int

    The number of previous passwords that users are prevented from reusing.

    RequireLowercaseCharacters bool

    Whether to require lowercase characters for user passwords.

    RequireNumbers bool

    Whether to require numbers for user passwords.

    RequireSymbols bool

    Whether to require symbols for user passwords.

    RequireUppercaseCharacters bool

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword Boolean

    Whether to allow users to change their own password

    expirePasswords Boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    hardExpiry Boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge Integer

    The number of days that an user password is valid.

    minimumPasswordLength Integer

    Minimum length to require for user passwords.

    passwordReusePrevention Integer

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters Boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers Boolean

    Whether to require numbers for user passwords.

    requireSymbols Boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters Boolean

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword boolean

    Whether to allow users to change their own password

    expirePasswords boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    hardExpiry boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge number

    The number of days that an user password is valid.

    minimumPasswordLength number

    Minimum length to require for user passwords.

    passwordReusePrevention number

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers boolean

    Whether to require numbers for user passwords.

    requireSymbols boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters boolean

    Whether to require uppercase characters for user passwords.

    allow_users_to_change_password bool

    Whether to allow users to change their own password

    expire_passwords bool

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    hard_expiry bool

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    max_password_age int

    The number of days that an user password is valid.

    minimum_password_length int

    Minimum length to require for user passwords.

    password_reuse_prevention int

    The number of previous passwords that users are prevented from reusing.

    require_lowercase_characters bool

    Whether to require lowercase characters for user passwords.

    require_numbers bool

    Whether to require numbers for user passwords.

    require_symbols bool

    Whether to require symbols for user passwords.

    require_uppercase_characters bool

    Whether to require uppercase characters for user passwords.

    allowUsersToChangePassword Boolean

    Whether to allow users to change their own password

    expirePasswords Boolean

    Indicates whether passwords in the account expire. Returns true if max_password_age contains a value greater than 0. Returns false if it is 0 or not present.

    hardExpiry Boolean

    Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)

    maxPasswordAge Number

    The number of days that an user password is valid.

    minimumPasswordLength Number

    Minimum length to require for user passwords.

    passwordReusePrevention Number

    The number of previous passwords that users are prevented from reusing.

    requireLowercaseCharacters Boolean

    Whether to require lowercase characters for user passwords.

    requireNumbers Boolean

    Whether to require numbers for user passwords.

    requireSymbols Boolean

    Whether to require symbols for user passwords.

    requireUppercaseCharacters Boolean

    Whether to require uppercase characters for user passwords.

    Import

    Using pulumi import, import IAM Account Password Policy using the word iam-account-password-policy. For example:

     $ pulumi import aws:iam/accountPasswordPolicy:AccountPasswordPolicy strict iam-account-password-policy
    

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi