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; }
}
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
})
}
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,
},
});
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)
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}
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,
},
});
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),
},
})
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());
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,
})
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,
},
});
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
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:
- Account
Alias This property is required. string - AWS IAM account alias for this account.
- Password
Policy This property is required. Pulumi.Aws Iam. Inputs. Account Password Policy - 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. string - AWS IAM account alias for this account.
- Password
Policy This property is required. AccountPassword Policy Args - 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. String - AWS IAM account alias for this account.
- password
Policy This property is required. AccountPassword Policy - 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. string - AWS IAM account alias for this account.
- password
Policy This property is required. AccountPassword Policy - 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. AccountPassword Policy Args - 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. String - AWS IAM account alias for this account.
- password
Policy 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.
- Password
Policy boolExpire Passwords - 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 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.
- Password
Policy boolExpire Passwords - 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 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.
- password
Policy BooleanExpire Passwords - 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 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.
- password
Policy booleanExpire Passwords - 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 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_ boolexpire_ passwords - 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.
- password
Policy BooleanExpire Passwords - 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 String - The unique identifier of the calling entity.
Supporting Types
AccountPasswordPolicy, AccountPasswordPolicyArgs
- 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.
- 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.
- allow
Users To Change This property is required. Boolean - Whether to allow users to change their own password.
- hard
Expiry This property is required. Boolean - 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. Boolean - Whether to require lowercase characters for user passwords.
- require
Numbers This property is required. Boolean - Whether to require numbers for user passwords.
- require
Symbols This property is required. Boolean - Whether to require symbols for user passwords.
- require
Uppercase Characters This property is required. Boolean - Whether to require uppercase characters for user passwords.
- max
Age 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. - minimum
Length 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. - reuse
Prevention 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.
- allow
Users To Change This property is required. boolean - Whether to allow users to change their own password.
- hard
Expiry This property is required. boolean - 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. boolean - Whether to require lowercase characters for user passwords.
- require
Numbers This property is required. boolean - Whether to require numbers for user passwords.
- require
Symbols This property is required. boolean - Whether to require symbols for user passwords.
- require
Uppercase Characters This property is required. boolean - Whether to require uppercase characters for user passwords.
- max
Age 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. - minimum
Length 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. - reuse
Prevention 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.
- allow
Users To Change This property is required. Boolean - Whether to allow users to change their own password.
- hard
Expiry This property is required. Boolean - 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. Boolean - Whether to require lowercase characters for user passwords.
- require
Numbers This property is required. Boolean - Whether to require numbers for user passwords.
- require
Symbols This property is required. Boolean - Whether to require symbols for user passwords.
- require
Uppercase Characters This property is required. Boolean - Whether to require uppercase characters for user passwords.
- max
Age 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. - minimum
Length 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. - reuse
Prevention 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