#NEWLINE# def account_policy( name = None , allow_users_to_change_password = None , hard_expiry = None , max_password_age = None , minimum_password_length = None , password_reuse_prevention = None , require_lowercase_characters = None , require_numbers = None , require_symbols = None , require_uppercase_characters = None , region = None , key = None , keyid = None , profile = None ) : #NEWLINE# #INDENT# "\n    Change account policy.\n\n    .. versionadded:: 2015.8.0\n\n    name (string)\n        The name of the account policy\n\n    allow_users_to_change_password (bool)\n        Allows all IAM users in your account to\n        use the AWS Management Console to change their own passwords.\n\n    hard_expiry (bool)\n        Prevents IAM users from setting a new password after their\n        password has expired.\n\n    max_password_age (int)\n        The number of days that an IAM user password is valid.\n\n    minimum_password_length (int)\n        The minimum number of characters allowed in an IAM user password.\n\n    password_reuse_prevention (int)\n        Specifies the number of previous passwords\n        that IAM users are prevented from reusing.\n\n    require_lowercase_characters (bool)\n        Specifies whether IAM user passwords\n        must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).\n\n    require_numbers (bool)\n        Specifies whether IAM user passwords must contain at\n        least one numeric character (0 to 9).\n\n    require_symbols (bool)\n        Specifies whether IAM user passwords must contain at\n        least one of the following non-alphanumeric characters: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | '\n\n    require_uppercase_characters (bool)\n        Specifies whether IAM user passwords must\n        contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).\n\n    region (string)\n        Region to connect to.\n\n    key (string)\n        Secret key to be used.\n\n    keyid (string)\n        Access key to be used.\n\n    profile (dict)\n        A dict with region, key and keyid, or a pillar key (string)\n    " #NEWLINE# config = locals ( ) #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : 'Account Policy' , #NEWLINE# 'result' : True , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# info = __salt__ [ 'boto_iam.get_account_policy' ] ( region , region , keyid , profile ) #NEWLINE# if ( not info ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Account policy is not Enabled.' #NEWLINE# ret [ 'result' ] = False #NEWLINE# return ret #NEWLINE# #UNINDENT# for ( key , value ) in config . items ( ) : #NEWLINE# #INDENT# if ( key in ( 'region' , 'key' , 'keyid' , 'profile' , 'name' ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( ( value is not None ) and ( str ( info [ key ] ) != str ( value ) . lower ( ) ) ) : #NEWLINE# #INDENT# ret [ 'comment' ] = os . linesep . join ( [ ret [ 'comment' ] , 'Policy value {0} has been set to {1}.' . format ( value , info [ key ] ) ] ) #NEWLINE# ret [ 'changes' ] [ key ] = str ( value ) . lower ( ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not ret [ 'changes' ] ) : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Account policy is not changed.' #NEWLINE# return ret #NEWLINE# #UNINDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'Account policy is set to be changed.' #NEWLINE# ret [ 'result' ] = None #NEWLINE# return ret #NEWLINE# #UNINDENT# if __salt__ [ 'boto_iam.update_account_password_policy' ] ( allow_users_to_change_password , hard_expiry , max_password_age , minimum_password_length , password_reuse_prevention , require_lowercase_characters , require_numbers , require_symbols , require_uppercase_characters , region , key , keyid , profile ) : #NEWLINE# #INDENT# return ret #NEWLINE# #UNINDENT# ret [ 'comment' ] = 'Account policy is not changed.' #NEWLINE# ret [ 'changes' ] = None #NEWLINE# ret [ 'result' ] = False #NEWLINE# return ret