aws.iam.AccountPasswordPolicy
Explore with Pulumi AI
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
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const strict = new aws.iam.AccountPasswordPolicy("strict", {
minimumPasswordLength: 8,
requireLowercaseCharacters: true,
requireNumbers: true,
requireUppercaseCharacters: true,
requireSymbols: true,
allowUsersToChangePassword: true,
});
import pulumi
import pulumi_aws as aws
strict = aws.iam.AccountPasswordPolicy("strict",
minimum_password_length=8,
require_lowercase_characters=True,
require_numbers=True,
require_uppercase_characters=True,
require_symbols=True,
allow_users_to_change_password=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{
MinimumPasswordLength: pulumi.Int(8),
RequireLowercaseCharacters: pulumi.Bool(true),
RequireNumbers: pulumi.Bool(true),
RequireUppercaseCharacters: pulumi.Bool(true),
RequireSymbols: pulumi.Bool(true),
AllowUsersToChangePassword: pulumi.Bool(true),
})
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 strict = new Aws.Iam.AccountPasswordPolicy("strict", new()
{
MinimumPasswordLength = 8,
RequireLowercaseCharacters = true,
RequireNumbers = true,
RequireUppercaseCharacters = true,
RequireSymbols = true,
AllowUsersToChangePassword = true,
});
});
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()
.minimumPasswordLength(8)
.requireLowercaseCharacters(true)
.requireNumbers(true)
.requireUppercaseCharacters(true)
.requireSymbols(true)
.allowUsersToChangePassword(true)
.build());
}
}
resources:
strict:
type: aws:iam:AccountPasswordPolicy
properties:
minimumPasswordLength: 8
requireLowercaseCharacters: true
requireNumbers: true
requireUppercaseCharacters: true
requireSymbols: true
allowUsersToChangePassword: true
Create AccountPasswordPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccountPasswordPolicy(name: string, args?: AccountPasswordPolicyArgs, opts?: CustomResourceOptions);
@overload
def AccountPasswordPolicy(resource_name: str,
args: Optional[AccountPasswordPolicyArgs] = None,
opts: Optional[ResourceOptions] = None)
@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)
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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var accountPasswordPolicyResource = new Aws.Iam.AccountPasswordPolicy("accountPasswordPolicyResource", new()
{
AllowUsersToChangePassword = false,
HardExpiry = false,
MaxPasswordAge = 0,
MinimumPasswordLength = 0,
PasswordReusePrevention = 0,
RequireLowercaseCharacters = false,
RequireNumbers = false,
RequireSymbols = false,
RequireUppercaseCharacters = false,
});
example, err := iam.NewAccountPasswordPolicy(ctx, "accountPasswordPolicyResource", &iam.AccountPasswordPolicyArgs{
AllowUsersToChangePassword: pulumi.Bool(false),
HardExpiry: pulumi.Bool(false),
MaxPasswordAge: pulumi.Int(0),
MinimumPasswordLength: pulumi.Int(0),
PasswordReusePrevention: pulumi.Int(0),
RequireLowercaseCharacters: pulumi.Bool(false),
RequireNumbers: pulumi.Bool(false),
RequireSymbols: pulumi.Bool(false),
RequireUppercaseCharacters: pulumi.Bool(false),
})
var accountPasswordPolicyResource = new AccountPasswordPolicy("accountPasswordPolicyResource", AccountPasswordPolicyArgs.builder()
.allowUsersToChangePassword(false)
.hardExpiry(false)
.maxPasswordAge(0)
.minimumPasswordLength(0)
.passwordReusePrevention(0)
.requireLowercaseCharacters(false)
.requireNumbers(false)
.requireSymbols(false)
.requireUppercaseCharacters(false)
.build());
account_password_policy_resource = aws.iam.AccountPasswordPolicy("accountPasswordPolicyResource",
allow_users_to_change_password=False,
hard_expiry=False,
max_password_age=0,
minimum_password_length=0,
password_reuse_prevention=0,
require_lowercase_characters=False,
require_numbers=False,
require_symbols=False,
require_uppercase_characters=False)
const accountPasswordPolicyResource = new aws.iam.AccountPasswordPolicy("accountPasswordPolicyResource", {
allowUsersToChangePassword: false,
hardExpiry: false,
maxPasswordAge: 0,
minimumPasswordLength: 0,
passwordReusePrevention: 0,
requireLowercaseCharacters: false,
requireNumbers: false,
requireSymbols: false,
requireUppercaseCharacters: false,
});
type: aws:iam:AccountPasswordPolicy
properties:
allowUsersToChangePassword: false
hardExpiry: false
maxPasswordAge: 0
minimumPasswordLength: 0
passwordReusePrevention: 0
requireLowercaseCharacters: false
requireNumbers: false
requireSymbols: false
requireUppercaseCharacters: false
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:
- Allow
Users boolTo Change Password - 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 intAge - The number of days that an user password is valid.
- Minimum
Password intLength - Minimum length to require for user passwords.
- Password
Reuse intPrevention - The number of previous passwords that users are prevented from reusing.
- Require
Lowercase boolCharacters - 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 boolCharacters - Whether to require uppercase characters for user passwords.
- Allow
Users boolTo Change Password - 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 intAge - The number of days that an user password is valid.
- Minimum
Password intLength - Minimum length to require for user passwords.
- Password
Reuse intPrevention - The number of previous passwords that users are prevented from reusing.
- Require
Lowercase boolCharacters - 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 boolCharacters - Whether to require uppercase characters for user passwords.
- allow
Users BooleanTo Change Password - Whether to allow users to change their own password
- hard
Expiry Boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password IntegerAge - The number of days that an user password is valid.
- minimum
Password IntegerLength - Minimum length to require for user passwords.
- password
Reuse IntegerPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase BooleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers Boolean - Whether to require numbers for user passwords.
- require
Symbols Boolean - Whether to require symbols for user passwords.
- require
Uppercase BooleanCharacters - Whether to require uppercase characters for user passwords.
- allow
Users booleanTo Change Password - Whether to allow users to change their own password
- hard
Expiry boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password numberAge - The number of days that an user password is valid.
- minimum
Password numberLength - Minimum length to require for user passwords.
- password
Reuse numberPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase booleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers boolean - Whether to require numbers for user passwords.
- require
Symbols boolean - Whether to require symbols for user passwords.
- require
Uppercase booleanCharacters - Whether to require uppercase characters for user passwords.
- allow_
users_ boolto_ change_ password - 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_ intage - The number of days that an user password is valid.
- minimum_
password_ intlength - Minimum length to require for user passwords.
- password_
reuse_ intprevention - The number of previous passwords that users are prevented from reusing.
- require_
lowercase_ boolcharacters - 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_ boolcharacters - Whether to require uppercase characters for user passwords.
- allow
Users BooleanTo Change Password - Whether to allow users to change their own password
- hard
Expiry Boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password NumberAge - The number of days that an user password is valid.
- minimum
Password NumberLength - Minimum length to require for user passwords.
- password
Reuse NumberPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase BooleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers Boolean - Whether to require numbers for user passwords.
- require
Symbols Boolean - Whether to require symbols for user passwords.
- require
Uppercase BooleanCharacters - 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:
- Expire
Passwords bool - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - Id string
- The provider-assigned unique ID for this managed resource.
- expire
Passwords Boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - id String
- The provider-assigned unique ID for this managed resource.
- expire
Passwords boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - id str
- The provider-assigned unique ID for this managed resource.
- expire
Passwords Boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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.
- Allow
Users boolTo Change Password - Whether to allow users to change their own password
- Expire
Passwords bool - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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 intAge - The number of days that an user password is valid.
- Minimum
Password intLength - Minimum length to require for user passwords.
- Password
Reuse intPrevention - The number of previous passwords that users are prevented from reusing.
- Require
Lowercase boolCharacters - 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 boolCharacters - Whether to require uppercase characters for user passwords.
- Allow
Users boolTo Change Password - Whether to allow users to change their own password
- Expire
Passwords bool - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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 intAge - The number of days that an user password is valid.
- Minimum
Password intLength - Minimum length to require for user passwords.
- Password
Reuse intPrevention - The number of previous passwords that users are prevented from reusing.
- Require
Lowercase boolCharacters - 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 boolCharacters - Whether to require uppercase characters for user passwords.
- allow
Users BooleanTo Change Password - Whether to allow users to change their own password
- expire
Passwords Boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - hard
Expiry Boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password IntegerAge - The number of days that an user password is valid.
- minimum
Password IntegerLength - Minimum length to require for user passwords.
- password
Reuse IntegerPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase BooleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers Boolean - Whether to require numbers for user passwords.
- require
Symbols Boolean - Whether to require symbols for user passwords.
- require
Uppercase BooleanCharacters - Whether to require uppercase characters for user passwords.
- allow
Users booleanTo Change Password - Whether to allow users to change their own password
- expire
Passwords boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - hard
Expiry boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password numberAge - The number of days that an user password is valid.
- minimum
Password numberLength - Minimum length to require for user passwords.
- password
Reuse numberPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase booleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers boolean - Whether to require numbers for user passwords.
- require
Symbols boolean - Whether to require symbols for user passwords.
- require
Uppercase booleanCharacters - Whether to require uppercase characters for user passwords.
- allow_
users_ boolto_ change_ password - Whether to allow users to change their own password
- expire_
passwords bool - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
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_ intage - The number of days that an user password is valid.
- minimum_
password_ intlength - Minimum length to require for user passwords.
- password_
reuse_ intprevention - The number of previous passwords that users are prevented from reusing.
- require_
lowercase_ boolcharacters - 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_ boolcharacters - Whether to require uppercase characters for user passwords.
- allow
Users BooleanTo Change Password - Whether to allow users to change their own password
- expire
Passwords Boolean - Indicates whether passwords in the account expire. Returns
true
ifmax_password_age
contains a value greater than0
. Returnsfalse
if it is0
or not present. - hard
Expiry Boolean - Whether users are prevented from setting a new password after their password has expired (i.e., require administrator reset)
- max
Password NumberAge - The number of days that an user password is valid.
- minimum
Password NumberLength - Minimum length to require for user passwords.
- password
Reuse NumberPrevention - The number of previous passwords that users are prevented from reusing.
- require
Lowercase BooleanCharacters - Whether to require lowercase characters for user passwords.
- require
Numbers Boolean - Whether to require numbers for user passwords.
- require
Symbols Boolean - Whether to require symbols for user passwords.
- require
Uppercase BooleanCharacters - 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.