1. Packages
  2. AWS IAM
  3. API Docs
  4. Account
AWS IAM v0.0.3 published on Wednesday, Jun 1, 2022 by Pulumi

aws-iam.Account

Explore with Pulumi AI

This resource helps you manage an Iam Account’s Alias and Password Policy. If your IAM Account Alias was previously set (either via the AWS console or when AWS created your Account) you will see an error like the below:

    * Aws_iam_account_alias.this: Error creating account alias with name my-account-alias

If you want to manage you Alias using Pulumi you will need to import this resource.

Example Usage

using Pulumi;
using Pulumi.AwsIam;
using Pulumi.AwsIam.Inputs;

class MyStack : Stack
{
    public MyStack()
    {
        var account = new Account("account", new AccountArgs
        {
            AccountAlias = "cool-alias",
            PasswordPolicy=new AccountPasswordPolicyArgs
            {
                MinimumLength = 37,
                RequireNumbers = false,
                AllowUsersToChange = true,
                HardExpiry = true,
                RequireSymbols = true,
                RequireLowercaseCharacters = true,
                RequireUppercaseCharacters = true,
            }

        });

        this.Account = Output.Create<Account>(account);
    }

    [Output]
    public Output<Account> Account { get; set; }
}
Copy
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        account, err := iam.NewAccount(ctx, "account", &iam.AccountArgs{
            AccountAlias: pulumi.String("cool-alias"),
            PasswordPolicy: iam.AccountPasswordPolicyArgs{
                MinimumLength:              pulumi.IntPtr(37),
                RequireNumbers:             pulumi.Bool(false),
                AllowUsersToChange:         pulumi.Bool(true),
                HardExpiry:                 pulumi.Bool(true),
                RequireSymbols:             pulumi.Bool(true),
                RequireLowercaseCharacters: pulumi.Bool(true),
                RequireUppercaseCharacters: pulumi.Bool(true),
            },
        })
        if err != nil {
            return err
        }

        ctx.Export("account", account)

        return nil
    })
}
Copy

Coming soon!

import * as iam from "@pulumi/aws-iam";

export const account = new iam.Account("account", {
    accountAlias: "cool-alias",
    passwordPolicy: {
        minimumLength: 37,
        requireNumbers: false,
        allowUsersToChange: true,
        hardExpiry: true,
        requireSymbols: true,
        requireLowercaseCharacters: true,
        requireUppercaseCharacters: true,
    },
});
Copy
import pulumi
import pulumi_aws_iam as iam

account = iam.Account(
    'account',
    account_alias='cool-alias',
    password_policy=iam.AccountPasswordPolicyArgs(
        minimum_length=37,
        require_numbers=False,
        allow_users_to_change=True,
        hard_expiry=True,
        require_symbols=True,
        require_lowercase_characters=True,
        require_uppercase_characters=True,
    )
)

pulumi.export('account', account)
Copy
name: awsiam-yaml
runtime: yaml
resources:
    account:
        type: "aws-iam:index:Account"
        properties:
            accountAlias: "cool-alias"
            passwordPolicy:
                minimumLength: 37
                requireNumbers: false
                allowUsersToChange: true
                hardExpiry: true
                requireSymbols: true
                requireLowercaseCharacters: true
                requireUppercaseCharacters: true
outputs:
    account: ${account}
Copy

Create Account Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Account(name: string, args: AccountArgs, opts?: ComponentResourceOptions);
@overload
def Account(resource_name: str,
            args: AccountArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def Account(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            account_alias: Optional[str] = None,
            password_policy: Optional[AccountPasswordPolicyArgs] = None)
func NewAccount(ctx *Context, name string, args AccountArgs, opts ...ResourceOption) (*Account, error)
public Account(string name, AccountArgs args, ComponentResourceOptions? opts = null)
public Account(String name, AccountArgs args)
public Account(String name, AccountArgs args, ComponentResourceOptions options)
type: aws-iam:Account
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AccountArgs
The arguments to resource properties.
opts ComponentResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AccountArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AccountArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AccountArgs
The arguments to resource properties.
opts ComponentResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AccountArgs
The arguments to resource properties.
options ComponentResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var accountResource = new AwsIam.Account("accountResource", new()
{
    AccountAlias = "string",
    PasswordPolicy = new AwsIam.Inputs.AccountPasswordPolicyArgs
    {
        AllowUsersToChange = false,
        HardExpiry = false,
        RequireLowercaseCharacters = false,
        RequireNumbers = false,
        RequireSymbols = false,
        RequireUppercaseCharacters = false,
        MaxAge = 0,
        MinimumLength = 0,
        ReusePrevention = 0,
    },
});
Copy
example, err := awsiam.NewAccount(ctx, "accountResource", &awsiam.AccountArgs{
	AccountAlias: pulumi.String("string"),
	PasswordPolicy: &awsiam.AccountPasswordPolicyArgs{
		AllowUsersToChange:         pulumi.Bool(false),
		HardExpiry:                 pulumi.Bool(false),
		RequireLowercaseCharacters: pulumi.Bool(false),
		RequireNumbers:             pulumi.Bool(false),
		RequireSymbols:             pulumi.Bool(false),
		RequireUppercaseCharacters: pulumi.Bool(false),
		MaxAge:                     pulumi.Int(0),
		MinimumLength:              pulumi.Int(0),
		ReusePrevention:            pulumi.Int(0),
	},
})
Copy
var accountResource = new Account("accountResource", AccountArgs.builder()
    .accountAlias("string")
    .passwordPolicy(AccountPasswordPolicyArgs.builder()
        .allowUsersToChange(false)
        .hardExpiry(false)
        .requireLowercaseCharacters(false)
        .requireNumbers(false)
        .requireSymbols(false)
        .requireUppercaseCharacters(false)
        .maxAge(0)
        .minimumLength(0)
        .reusePrevention(0)
        .build())
    .build());
Copy
account_resource = aws_iam.Account("accountResource",
    account_alias="string",
    password_policy={
        "allow_users_to_change": False,
        "hard_expiry": False,
        "require_lowercase_characters": False,
        "require_numbers": False,
        "require_symbols": False,
        "require_uppercase_characters": False,
        "max_age": 0,
        "minimum_length": 0,
        "reuse_prevention": 0,
    })
Copy
const accountResource = new aws_iam.Account("accountResource", {
    accountAlias: "string",
    passwordPolicy: {
        allowUsersToChange: false,
        hardExpiry: false,
        requireLowercaseCharacters: false,
        requireNumbers: false,
        requireSymbols: false,
        requireUppercaseCharacters: false,
        maxAge: 0,
        minimumLength: 0,
        reusePrevention: 0,
    },
});
Copy
type: aws-iam:Account
properties:
    accountAlias: string
    passwordPolicy:
        allowUsersToChange: false
        hardExpiry: false
        maxAge: 0
        minimumLength: 0
        requireLowercaseCharacters: false
        requireNumbers: false
        requireSymbols: false
        requireUppercaseCharacters: false
        reusePrevention: 0
Copy

Account Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Account resource accepts the following input properties:

AccountAlias This property is required. string
AWS IAM account alias for this account.
PasswordPolicy This property is required. Pulumi.AwsIam.Inputs.AccountPasswordPolicy
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.
AccountAlias This property is required. string
AWS IAM account alias for this account.
PasswordPolicy This property is required. AccountPasswordPolicyArgs
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.
accountAlias This property is required. String
AWS IAM account alias for this account.
passwordPolicy This property is required. AccountPasswordPolicy
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.
accountAlias This property is required. string
AWS IAM account alias for this account.
passwordPolicy This property is required. AccountPasswordPolicy
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.
account_alias This property is required. str
AWS IAM account alias for this account.
password_policy This property is required. AccountPasswordPolicyArgs
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.
accountAlias This property is required. String
AWS IAM account alias for this account.
passwordPolicy This property is required. Property Map
Options to specify complexity requirements and mandatory rotation periods for your IAM users' passwords. If left empty the default AWS password policy will be applied.

Outputs

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

Arn string
The AWS ARN associated with the calling entity.
Id string
The AWS Account ID number of the account that owns or contains the calling entity.
PasswordPolicyExpirePasswords 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.
UserId string
The unique identifier of the calling entity.
Arn string
The AWS ARN associated with the calling entity.
Id string
The AWS Account ID number of the account that owns or contains the calling entity.
PasswordPolicyExpirePasswords 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.
UserId string
The unique identifier of the calling entity.
arn String
The AWS ARN associated with the calling entity.
id String
The AWS Account ID number of the account that owns or contains the calling entity.
passwordPolicyExpirePasswords 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.
userId String
The unique identifier of the calling entity.
arn string
The AWS ARN associated with the calling entity.
id string
The AWS Account ID number of the account that owns or contains the calling entity.
passwordPolicyExpirePasswords 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.
userId string
The unique identifier of the calling entity.
arn str
The AWS ARN associated with the calling entity.
id str
The AWS Account ID number of the account that owns or contains the calling entity.
password_policy_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.
user_id str
The unique identifier of the calling entity.
arn String
The AWS ARN associated with the calling entity.
id String
The AWS Account ID number of the account that owns or contains the calling entity.
passwordPolicyExpirePasswords 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.
userId String
The unique identifier of the calling entity.

Supporting Types

AccountPasswordPolicy
, AccountPasswordPolicyArgs

AllowUsersToChange This property is required. bool
Whether to allow users to change their own password.
HardExpiry This property is required. bool
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
RequireLowercaseCharacters This property is required. bool
Whether to require lowercase characters for user passwords.
RequireNumbers This property is required. bool
Whether to require numbers for user passwords.
RequireSymbols This property is required. bool
Whether to require symbols for user passwords.
RequireUppercaseCharacters This property is required. bool
Whether to require uppercase characters for user passwords.
MaxAge int
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
MinimumLength int
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
ReusePrevention int
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.
AllowUsersToChange This property is required. bool
Whether to allow users to change their own password.
HardExpiry This property is required. bool
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
RequireLowercaseCharacters This property is required. bool
Whether to require lowercase characters for user passwords.
RequireNumbers This property is required. bool
Whether to require numbers for user passwords.
RequireSymbols This property is required. bool
Whether to require symbols for user passwords.
RequireUppercaseCharacters This property is required. bool
Whether to require uppercase characters for user passwords.
MaxAge int
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
MinimumLength int
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
ReusePrevention int
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.
allowUsersToChange This property is required. Boolean
Whether to allow users to change their own password.
hardExpiry This property is required. Boolean
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
requireLowercaseCharacters This property is required. Boolean
Whether to require lowercase characters for user passwords.
requireNumbers This property is required. Boolean
Whether to require numbers for user passwords.
requireSymbols This property is required. Boolean
Whether to require symbols for user passwords.
requireUppercaseCharacters This property is required. Boolean
Whether to require uppercase characters for user passwords.
maxAge Integer
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
minimumLength Integer
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
reusePrevention Integer
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.
allowUsersToChange This property is required. boolean
Whether to allow users to change their own password.
hardExpiry This property is required. boolean
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
requireLowercaseCharacters This property is required. boolean
Whether to require lowercase characters for user passwords.
requireNumbers This property is required. boolean
Whether to require numbers for user passwords.
requireSymbols This property is required. boolean
Whether to require symbols for user passwords.
requireUppercaseCharacters This property is required. boolean
Whether to require uppercase characters for user passwords.
maxAge number
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
minimumLength number
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
reusePrevention number
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.
allow_users_to_change This property is required. bool
Whether to allow users to change their own password.
hard_expiry This property is required. bool
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
require_lowercase_characters This property is required. bool
Whether to require lowercase characters for user passwords.
require_numbers This property is required. bool
Whether to require numbers for user passwords.
require_symbols This property is required. bool
Whether to require symbols for user passwords.
require_uppercase_characters This property is required. bool
Whether to require uppercase characters for user passwords.
max_age int
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
minimum_length int
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
reuse_prevention int
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.
allowUsersToChange This property is required. Boolean
Whether to allow users to change their own password.
hardExpiry This property is required. Boolean
Whether users are prevented from setting a new password after their password has expired (i.e. require administrator reset).
requireLowercaseCharacters This property is required. Boolean
Whether to require lowercase characters for user passwords.
requireNumbers This property is required. Boolean
Whether to require numbers for user passwords.
requireSymbols This property is required. Boolean
Whether to require symbols for user passwords.
requireUppercaseCharacters This property is required. Boolean
Whether to require uppercase characters for user passwords.
maxAge Number
The number of days that an user password is valid. If not set or a value of 0 is provided, then passwords will not expire.
minimumLength Number
Minimum length to require for user passwords. Defaults to 8 if not set or the provided value is invalid. Valid values are between 6 and 128.
reusePrevention Number
The number of previous passwords that users are prevented from reusing. If not set or a value of 0 is provided, no reuse prevention policy will be used.

Package Details

Repository
aws-iam
License