o Sa@sddlZddlZddlmZmZddlmZddlmZddl m Z dddgid d gd giddd gid d gd gid Z e e dZ Gddde ZdS)N)jsonsix) ResultSet) SummaryMap)AWSQueryConnection StatementServicezec2.amazonaws.comAllowzsts:AssumeRole) PrincipalEffectActionzec2.amazonaws.com.cn)defaultamazonaws.com.cnr cseZdZdZ     dƇfdd Zd d Z  dd dZdddZdddZdddZ ddZ dddZ ddZ ddZ ddZddd Zd!d"Zd#d$Zdd%d&Zdd'd(Zd)d*Zdd+d,Zdd-d.Zdd/d0Zd1d2Zd3d4Zd5d6Zdd7d8Zdd9d:Zdd;d<Zdd=d>Zdd?d@Z  ddAdBZ ddCdDZ!ddEdFZ"ddGdHZ#  ddIdJZ$e$Z%  ddKdLZ& ddMdNZ'dOdPZ(dQdRZ)ddSdTZ*dUdVZ+dWdXZ,dYdZZ-d[d\Z.d]d^Z/d_d`Z0dadbZ1dcddZ2dedfZ3dgdhZ4ddjdkZ5dldmZ6dndoZ7ddpdqZ8ddrdsZ9ddtduZ:dvdwZ;dxdyZd~dZ?ddZ@  dddZA  dddZBdddZCdddZDddZEddZFddZGddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQ       dddZR  dddZS dddZTddZUddZVddZWddZX  dddZYdddZZddZ[   dddZ\ddZ]ddZ^ddZ_ddZ`ddÄZaddńZbZcS) IAMConnectionz 2010-05-08NTiam.amazonaws.comr/cs2tt|j||||||||| | | | | ||ddS)N)validate_certs profile_name)superr__init__)selfaws_access_key_idaws_secret_access_key is_secureportproxy proxy_port proxy_user proxy_passhostdebughttps_connection_factorypathsecurity_tokenrr __class__5/usr/lib/python3/dist-packages/boto/iam/connection.pyr=s  zIAMConnection.__init__cCsdgS)Nzhmac-v4r&rr&r&r'_required_auth_capabilityKsz'IAMConnection._required_auth_capabilityPOSTSetc Cs|s|}|||||}|}tj||jdkr5|r3tjj|dd} tj| |} | || SiStj d|j|j ftj d|| |j|j |)zQ Utility method to handle calls to IAM and parsing of responses. T) list_markerpythonize_namez%s %sz%s) make_requestreadbotologr status jsonresponseElement XmlHandlerparseerrorreason ResponseError) ractionparamsr"parentverbr-responsebodyehr&r&r' get_responseNs"   zIAMConnection.get_responsecC8i}|r||d<|r||d<|r||d<|jd|ddS)a List the groups that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only groups whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. PathPrefixMarkerMaxItems ListGroupsGroupsr-rCr path_prefixmarker max_itemsr<r&r&r'get_all_groupslszIAMConnection.get_all_groupscC0d|i}|r ||d<|r||d<|jd|ddS)a Return a list of users that are in the specified group. :type group_name: string :param group_name: The name of the group whose information should be returned. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. GroupNamerFrGGetGroupUsersrJrKr group_namerNrOr<r&r&r' get_groups zIAMConnection.get_groupcC||d}|d|S)z Create a group. :type group_name: string :param group_name: The name of the new group :type path: string :param path: The path to the group (Optional). Defaults to /. )rRPath CreateGrouprK)rrVr"r<r&r&r' create_group  zIAMConnection.create_groupcCd|i}|d|S)z Delete a group. The group must not contain any Users or have any attached policies :type group_name: string :param group_name: The name of the group to delete. rR DeleteGrouprK)rrVr<r&r&r' delete_group zIAMConnection.delete_groupcC,d|i}|r ||d<|r||d<|d|S)a Updates name and/or path of the specified group. :type group_name: string :param group_name: The name of the new group :type new_group_name: string :param new_group_name: If provided, the name of the group will be changed to this name. :type new_path: string :param new_path: If provided, the path of the group will be changed to this path. rR NewGroupNameNewPath UpdateGrouprK)rrVnew_group_namenew_pathr<r&r&r' update_group  zIAMConnection.update_groupcCrX)z Add a user to a group :type group_name: string :param group_name: The name of the group :type user_name: string :param user_name: The to be added to the group. rRUserNameAddUserToGrouprKrrV user_namer<r&r&r'add_user_to_groupr\zIAMConnection.add_user_to_groupcCrX)z Remove a user from a group. :type group_name: string :param group_name: The name of the group :type user_name: string :param user_name: The user to remove from the group. riRemoveUserFromGrouprKrlr&r&r'remove_user_from_groupr\z$IAMConnection.remove_user_from_groupcC|||d}|jd|ddS)az Adds or updates the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. :type policy_json: string :param policy_json: The policy document. )rR PolicyNamePolicyDocumentPutGroupPolicyr*r>rK)rrV policy_name policy_jsonr<r&r&r'put_group_policy zIAMConnection.put_group_policycCrQ)a List the names of the policies associated with the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rRrFrGListGroupPolicies PolicyNamesrJrKrUr&r&r'get_all_group_policiesz$IAMConnection.get_all_group_policiescC||d}|jd|ddS)a  Retrieves the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. rRrrGetGroupPolicyr*rurKrrVrvr<r&r&r'get_group_policy zIAMConnection.get_group_policycCr~)a! Deletes the specified policy document for the specified group. :type group_name: string :param group_name: The name of the group the policy is associated with. :type policy_name: string :param policy_name: The policy document to delete. rDeleteGroupPolicyr*rurKrr&r&r'delete_group_policy+rz!IAMConnection.delete_group_policycCrQ)a List the users that have the specified path prefix. :type path_prefix: string :param path_prefix: If provided, only users whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rErFrG ListUsersrTrJrKrLr&r&r' get_all_users:s zIAMConnection.get_all_userscCrX)z Create a user. :type user_name: string :param user_name: The name of the new user :type path: string :param path: The path in which the user will be created. Defaults to /. )rjrY CreateUserrK)rrmr"r<r&r&r' create_userW  zIAMConnection.create_usercCr])a8 Delete a user including the user's path, GUID and ARN. If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The name of the user to delete. rj DeleteUserrKrrmr<r&r&r' delete_userg zIAMConnection.delete_usercCsi}|r||d<|d|S)ap Retrieve information about the specified user. If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The name of the user to retrieve. If not specified, defaults to user making request. rjGetUserrKrr&r&r'get_userus  zIAMConnection.get_usercCra)a Updates name and/or path of the specified user. :type user_name: string :param user_name: The name of the user :type new_user_name: string :param new_user_name: If provided, the username of the user will be changed to this username. :type new_path: string :param new_path: If provided, the path of the user will be changed to this path. rj NewUserNamerc UpdateUserrK)rrm new_user_namerfr<r&r&r' update_userrhzIAMConnection.update_usercCrQ)a List the names of the policies associated with the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rjrFrGListUserPoliciesr{rJrKrrmrNrOr<r&r&r'get_all_user_policiesr}z#IAMConnection.get_all_user_policiescCrq)av Adds or updates the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. :type policy_json: string :param policy_json: The policy document. )rjrrrs PutUserPolicyr*rurK)rrmrvrwr<r&r&r'put_user_policyryzIAMConnection.put_user_policycCr~)a Retrieves the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to get. rjrr GetUserPolicyr*rurKrrmrvr<r&r&r'get_user_policyrzIAMConnection.get_user_policycCr~)a Deletes the specified policy document for the specified user. :type user_name: string :param user_name: The name of the user the policy is associated with. :type policy_name: string :param policy_name: The policy document to delete. rDeleteUserPolicyr*rurKrr&r&r'delete_user_policyrz IAMConnection.delete_user_policycCrQ)a List the groups that a specified user belongs to. :type user_name: string :param user_name: The name of the user to list groups for. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rjrFrGListGroupsForUserrIrJrKrr&r&r'get_groups_for_userr}z!IAMConnection.get_groups_for_usercCrQ)aq Get all access keys associated with an account. :type user_name: string :param user_name: The username of the user :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rjrFrGListAccessKeysAccessKeyMetadatarJrKrr&r&r'get_all_access_keysr}z!IAMConnection.get_all_access_keyscCr])a Create a new AWS Secret Access Key and corresponding AWS Access Key ID for the specified user. The default status for new keys is Active If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The username of the user rjCreateAccessKeyrKrr&r&r'create_access_keys zIAMConnection.create_access_keycC"||d}|r ||d<|d|S)aj Changes the status of the specified access key from Active to Inactive or vice versa. This action can be used to disable a user's key as part of a key rotation workflow. If the user_name is not specified, the user_name is determined implicitly based on the AWS Access Key ID used to sign the request. :type access_key_id: string :param access_key_id: The ID of the access key. :type status: string :param status: Either Active or Inactive. :type user_name: string :param user_name: The username of user (optional). ) AccessKeyIdStatusrjUpdateAccessKeyrK)r access_key_idr3rmr<r&r&r'update_access_key+s  zIAMConnection.update_access_keycC d|i}|r ||d<|d|S)a Delete an access key associated with a user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type access_key_id: string :param access_key_id: The ID of the access key to be deleted. :type user_name: string :param user_name: The username of the user rrjDeleteAccessKeyrK)rrrmr<r&r&r'delete_access_keyD zIAMConnection.delete_access_keycCrD)a Get all signing certificates associated with an account. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. :type user_name: string :param user_name: The username of the user rFrGrjListSigningCertificates CertificatesrJrK)rrNrOrmr<r&r&r'get_all_signing_certs[sz#IAMConnection.get_all_signing_certscCr)a Change the status of the specified signing certificate from Active to Inactive or vice versa. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type cert_id: string :param cert_id: The ID of the signing certificate :type status: string :param status: Either Active or Inactive. :type user_name: string :param user_name: The username of the user ) CertificateIdrrjUpdateSigningCertificaterK)rcert_idr3rmr<r&r&r'update_signing_cert{s  z!IAMConnection.update_signing_certcCs$d|i}|r ||d<|jd|ddS)a Uploads an X.509 signing certificate and associates it with the specified user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type cert_body: string :param cert_body: The body of the signing certificate. :type user_name: string :param user_name: The username of the user CertificateBodyrjUploadSigningCertificater*rurK)r cert_bodyrmr<r&r&r'upload_signing_certs z!IAMConnection.upload_signing_certcCr)av Delete a signing certificate associated with a user. If the user_name is not specified, it is determined implicitly based on the AWS Access Key ID used to sign the request. :type user_name: string :param user_name: The username of the user :type cert_id: string :param cert_id: The ID of the certificate. rrjDeleteSigningCertificaterK)rrrmr<r&r&r'delete_signing_certrz!IAMConnection.delete_signing_certcCrD)a  Lists the server certificates that have the specified path prefix. If none exist, the action returns an empty list. :type path_prefix: string :param path_prefix: If provided, only certificates whose paths match the provided prefix will be returned. :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rErFrGListServerCertificatesServerCertificateMetadataListrJrKrLr&r&r'list_server_certsszIAMConnection.list_server_certscCra)a< Updates the name and/or the path of the specified server certificate. :type cert_name: string :param cert_name: The name of the server certificate that you want to update. :type new_cert_name: string :param new_cert_name: The new name for the server certificate. Include this only if you are updating the server certificate's name. :type new_path: string :param new_path: If provided, the path of the certificate will be changed to this path. ServerCertificateNameNewServerCertificateNamercUpdateServerCertificaterK)r cert_name new_cert_namerfr<r&r&r'update_server_certs  z IAMConnection.update_server_certcCs4|||d}|r ||d<|r||d<|jd|ddS)a Uploads a server certificate entity for the AWS Account. The server certificate entity includes a public key certificate, a private key, and an optional certificate chain, which should all be PEM-encoded. :type cert_name: string :param cert_name: The name for the server certificate. Do not include the path in this value. :type cert_body: string :param cert_body: The contents of the public key certificate in PEM-encoded format. :type private_key: string :param private_key: The contents of the private key in PEM-encoded format. :type cert_chain: string :param cert_chain: The contents of the certificate chain. This is typically a concatenation of the PEM-encoded public key certificates of the chain. :type path: string :param path: The path for the server certificate. )rr PrivateKeyCertificateChainrYUploadServerCertificater*rurK)rrr private_key cert_chainr"r<r&r&r'upload_server_certsz IAMConnection.upload_server_certcCr])z Retrieves information about the specified server certificate. :type cert_name: string :param cert_name: The name of the server certificate you want to retrieve information about. rGetServerCertificaterKrrr<r&r&r'get_server_certificate!r`z$IAMConnection.get_server_certificatecCr])z Delete the specified server certificate. :type cert_name: string :param cert_name: The name of the server certificate you want to delete. rDeleteServerCertificaterKrr&r&r'delete_server_cert-r`z IAMConnection.delete_server_certcCrQ)ar Get all MFA devices associated with an account. :type user_name: string :param user_name: The username of the user :type marker: string :param marker: Use this only when paginating results and only in follow-up request after you've received a response where the results are truncated. Set this to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this only when paginating results to indicate the maximum number of groups you want in the response. rjrFrGListMFADevices MFADevicesrJrKrr&r&r'get_all_mfa_devices=sz!IAMConnection.get_all_mfa_devicescC||||d}|d|S)a5 Enables the specified MFA device and associates it with the specified user. :type user_name: string :param user_name: The username of the user :type serial_number: string :param serial_number: The serial number which uniquely identifies the MFA device. :type auth_code_1: string :param auth_code_1: An authentication code emitted by the device. :type auth_code_2: string :param auth_code_2: A subsequent authentication code emitted by the device. rj SerialNumberAuthenticationCode1AuthenticationCode2EnableMFADevicerKrrm serial_number auth_code_1 auth_code_2r<r&r&r'enable_mfa_deviceWs  zIAMConnection.enable_mfa_devicecCrX)aM Deactivates the specified MFA device and removes it from association with the user. :type user_name: string :param user_name: The username of the user :type serial_number: string :param serial_number: The serial number which uniquely identifies the MFA device. )rjrDeactivateMFADevicerK)rrmrr<r&r&r'deactivate_mfa_devicers  z#IAMConnection.deactivate_mfa_devicecCr)a Syncronizes the specified MFA device with the AWS servers. :type user_name: string :param user_name: The username of the user :type serial_number: string :param serial_number: The serial number which uniquely identifies the MFA device. :type auth_code_1: string :param auth_code_1: An authentication code emitted by the device. :type auth_code_2: string :param auth_code_2: A subsequent authentication code emitted by the device. rResyncMFADevicerKrr&r&r'resync_mfa_devices  zIAMConnection.resync_mfa_devicecCr])z Retrieves the login profile for the specified user. :type user_name: string :param user_name: The username of the user rjGetLoginProfilerKrr&r&r'get_login_profiles z IAMConnection.get_login_profilescCrX)aB Creates a login profile for the specified user, give the user the ability to access AWS services and the AWS Management Console. :type user_name: string :param user_name: The name of the user :type password: string :param password: The new password for the user rjPasswordCreateLoginProfilerKrrmpasswordr<r&r&r'create_login_profilerz"IAMConnection.create_login_profilecCr])z Deletes the login profile associated with the specified user. :type user_name: string :param user_name: The name of the user to delete. rjDeleteLoginProfilerKrr&r&r'delete_login_profilerz"IAMConnection.delete_login_profilecCrX)z Resets the password associated with the user's login profile. :type user_name: string :param user_name: The name of the user :type password: string :param password: The new password for the user rUpdateLoginProfilerKrr&r&r'update_login_profiler\z"IAMConnection.update_login_profilecCr])z Creates a new alias for the AWS account. For more information on account id aliases, please see http://goo.gl/ToB7G :type alias: string :param alias: The alias to attach to the account. AccountAliasCreateAccountAliasrKraliasr<r&r&r'create_account_alias z"IAMConnection.create_account_aliascCr])z Deletes an alias for the AWS account. For more information on account id aliases, please see http://goo.gl/ToB7G :type alias: string :param alias: The alias to remove from the account. rDeleteAccountAliasrKrr&r&r'delete_account_aliasrz"IAMConnection.delete_account_aliascC|jdiddS) Get the alias for the current account. This is referred to in the docs as list_account_aliases, but it seems you can only have one account alias currently. For more information on account id aliases, please see http://goo.gl/ToB7G ListAccountAliasesAccountAliasesrJrKr(r&r&r'get_account_aliass zIAMConnection.get_account_aliasec2cCs|}|s td|di}|di}|dg}t|s$td|d}|jdkr3d||fS|jdr?d ||fSd ||fS) z Get the URL where IAM users can use their login profile to sign in to this account's console. :type service: string :param service: Default service to go to in the console. zTNo alias associated with this account. Please use iam.create_account_alias() first.list_account_aliases_responselist_account_aliases_resultaccount_aliasesrziam.us-gov.amazonaws.comz1https://%s.signin.amazonaws-us-gov.com/console/%srz)https://%s.signin.amazonaws.cn/console/%sz+https://%s.signin.aws.amazon.com/console/%s)r Exceptiongetlenrendswith)rservicerrespresultaliasesr&r&r'get_signin_urls.     zIAMConnection.get_signin_urlcCs|ditS)rGetAccountSummary) get_objectrr(r&r&r'get_account_summary$s z!IAMConnection.get_account_summarycC|d||dS)a Adds the specified role to the specified instance profile. :type instance_profile_name: string :param instance_profile_name: Name of the instance profile to update. :type role_name: string :param role_name: Name of the role to add. AddRoleToInstanceProfileInstanceProfileNameRoleNamerKrinstance_profile_name role_namer&r&r'add_role_to_instance_profile4  z*IAMConnection.add_role_to_instance_profilecCs$d|i}|dur ||d<|d|S)z Creates a new instance profile. :type instance_profile_name: string :param instance_profile_name: Name of the instance profile to create. :type path: string :param path: The path to the instance profile. rNrYCreateInstanceProfilerK)rrr"r<r&r&r'create_instance_profileBs  z%IAMConnection.create_instance_profilecCsf|dur t|tjr |Sn!tD]\}}|dkrq|jr'|j|r'|}nq|s.td}t|S)Nr ) isinstancer string_typesDEFAULT_POLICY_DOCUMENTSitemsrrrdumps)rassume_role_policy_documenttldpolicyr&r&r' _build_policyQs  zIAMConnection._build_policycCs,|||d}|dur||d<|d|S)aQ Creates a new role for your AWS account. The policy grants permission to an EC2 instance to assume the role. The policy is URL-encoded according to RFC 3986. Currently, only EC2 instances can assume roles. :type role_name: string :param role_name: Name of the role to create. :type assume_role_policy_document: ``string`` or ``dict`` :param assume_role_policy_document: The policy that grants an entity permission to assume the role. :type path: string :param path: The path to the role. )rAssumeRolePolicyDocumentNrY CreateRole)r"rC)rrrr"r<r&r&r' create_roleis zIAMConnection.create_rolecC|dd|iS)z Deletes the specified instance profile. The instance profile must not have an associated role. :type instance_profile_name: string :param instance_profile_name: Name of the instance profile to delete. DeleteInstanceProfilerrKrrr&r&r'delete_instance_profilesz%IAMConnection.delete_instance_profilecCr&)z Deletes the specified role. The role must not have any policies attached. :type role_name: string :param role_name: Name of the role to delete. DeleteRolerrKrrr&r&r' delete_roleszIAMConnection.delete_rolecCr)a Deletes the specified policy associated with the specified role. :type role_name: string :param role_name: Name of the role associated with the policy. :type policy_name: string :param policy_name: Name of the policy to delete. DeleteRolePolicyrrrrKrrrvr&r&r'delete_role_policys z IAMConnection.delete_role_policycCr&)a' Retrieves information about the specified instance profile, including the instance profile's path, GUID, ARN, and role. :type instance_profile_name: string :param instance_profile_name: Name of the instance profile to get information about. GetInstanceProfilerrKr(r&r&r'get_instance_profiles z"IAMConnection.get_instance_profilecCr&)a Retrieves information about the specified role, including the role's path, GUID, ARN, and the policy granting permission to EC2 to assume the role. :type role_name: string :param role_name: Name of the role associated with the policy. GetRolerrKr+r&r&r'get_roles zIAMConnection.get_rolecCr)a Retrieves the specified policy document for the specified role. :type role_name: string :param role_name: Name of the role associated with the policy. :type policy_name: string :param policy_name: Name of the policy to get. GetRolePolicyr.rKr/r&r&r'get_role_policyrzIAMConnection.get_role_policycCDi}|dur ||d<|dur||d<|dur||d<|jd|ddS)a Lists the instance profiles that have the specified path prefix. If there are none, the action returns an empty list. :type path_prefix: string :param path_prefix: The path prefix for filtering the results. For example: /application_abc/component_xyz/, which would get all instance profiles whose path starts with /application_abc/component_xyz/. :type marker: string :param marker: Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this parameter only when paginating results to indicate the maximum number of user names you want in the response. NrErFrGListInstanceProfilesInstanceProfilesrJrKrLr&r&r'list_instance_profilessz$IAMConnection.list_instance_profilescC8d|i}|dur ||d<|dur||d<|jd|ddS)a Lists the instance profiles that have the specified associated role. If there are none, the action returns an empty list. :type role_name: string :param role_name: The name of the role to list instance profiles for. :type marker: string :param marker: Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received. :type max_items: int :param max_items: Use this parameter only when paginating results to indicate the maximum number of user names you want in the response. rNrFrGListInstanceProfilesForRoler9rJrKrrrNrOr<r&r&r'list_instance_profiles_for_rolesz-IAMConnection.list_instance_profiles_for_rolecCr;)a Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list. :type role_name: string :param role_name: The name of the role to list policies for. :type marker: string :param marker: Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the marker element in the response you just received. :type max_items: int :param max_items: Use this parameter only when paginating results to indicate the maximum number of user names you want in the response. rNrFrGListRolePoliciesr{rJrKr=r&r&r'list_role_policies sz IAMConnection.list_role_policiescCr7)a Lists the roles that have the specified path prefix. If there are none, the action returns an empty list. :type path_prefix: string :param path_prefix: The path prefix for filtering the results. :type marker: string :param marker: Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the marker element in the response you just received. :type max_items: int :param max_items: Use this parameter only when paginating results to indicate the maximum number of user names you want in the response. NrErFrG ListRolesRolesrJrKrLr&r&r' list_roles$szIAMConnection.list_rolescCs|d|||dS)a{ Adds (or updates) a policy document associated with the specified role. :type role_name: string :param role_name: Name of the role to associate the policy with. :type policy_name: string :param policy_name: Name of the policy document. :type policy_document: string :param policy_document: The policy document. PutRolePolicy)rrrrsrK)rrrvpolicy_documentr&r&r'put_role_policy?s  zIAMConnection.put_role_policycCr)a# Removes the specified role from the specified instance profile. :type instance_profile_name: string :param instance_profile_name: Name of the instance profile to update. :type role_name: string :param role_name: Name of the role to remove. RemoveRoleFromInstanceProfilerrKrr&r&r'!remove_role_from_instance_profileQs  z/IAMConnection.remove_role_from_instance_profilecCr)a Updates the policy that grants an entity permission to assume a role. Currently, only an Amazon EC2 instance can assume a role. :type role_name: string :param role_name: Name of the role to update. :type policy_document: string :param policy_document: The policy that grants an entity permission to assume the role. UpdateAssumeRolePolicy)rrsrK)rrrEr&r&r'update_assume_role_policy`s  z'IAMConnection.update_assume_role_policycCrX)a Creates an IAM entity to describe an identity provider (IdP) that supports SAML 2.0. The SAML provider that you create with this operation can be used as a principal in a role's trust policy to establish a trust relationship between AWS and a SAML identity provider. You can create an IAM role that supports Web-based single sign-on (SSO) to the AWS Management Console or one that supports API access to AWS. When you create the SAML provider, you upload an a SAML metadata document that you get from your IdP and that includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP. This operation requires `Signature Version 4`_. For more information, see `Giving Console Access Using SAML`_ and `Creating Temporary Security Credentials for SAML Federation`_ in the Using Temporary Credentials guide. :type saml_metadata_document: string :param saml_metadata_document: An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP. For more information, see `Creating Temporary Security Credentials for SAML Federation`_ in the Using Temporary Security Credentials guide. :type name: string :param name: The name of the provider to create. )SAMLMetadataDocumentNameCreateSAMLProviderrK)rsaml_metadata_documentnamer<r&r&r'create_saml_providerps) z"IAMConnection.create_saml_providercCr)zr Lists the SAML providers in the account. This operation requires `Signature Version 4`_. ListSAMLProvidersSAMLProviderListrJrKr(r&r&r'list_saml_providerssz!IAMConnection.list_saml_providerscCr])aZ Returns the SAML provider metadocument that was uploaded when the provider was created or updated. This operation requires `Signature Version 4`_. :type saml_provider_arn: string :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML provider to get information about. SAMLProviderArnGetSAMLProviderrKrsaml_provider_arnr<r&r&r'get_saml_providerrzIAMConnection.get_saml_providercCs||d}|d|S)a7 Updates the metadata document for an existing SAML provider. This operation requires `Signature Version 4`_. :type saml_provider_arn: string :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML provider to update. :type saml_metadata_document: string :param saml_metadata_document: An XML document generated by an identity provider (IdP) that supports SAML 2.0. The document includes the issuer's name, expiration information, and keys that can be used to validate the SAML authentication response (assertions) that are received from the IdP. You must generate the metadata document using the identity management software that is used as your organization's IdP. )rKrTUpdateSAMLProviderrK)rrWrNr<r&r&r'update_saml_providers z"IAMConnection.update_saml_providercCr])a Deletes a SAML provider. Deleting the provider does not update any roles that reference the SAML provider as a principal in their trust policies. Any attempt to assume a role that references a SAML provider that has been deleted will fail. This operation requires `Signature Version 4`_. :type saml_provider_arn: string :param saml_provider_arn: The Amazon Resource Name (ARN) of the SAML provider to delete. rTDeleteSAMLProviderrKrVr&r&r'delete_saml_providers z"IAMConnection.delete_saml_providercCi}|d|S)z Generates a credential report for an account A new credential report can only be generated every 4 hours. If one hasn't been generated in the last 4 hours then get_credential_report will error when called GenerateCredentialReportrKrr<r&r&r'generate_credential_reports z(IAMConnection.generate_credential_reportcCr])z Retrieves a credential report for an account A report must have been generated in the last 4 hours to succeed. The report is returned as a base64 encoded blob within the response. GetCredentialReportrKr_r&r&r'get_credential_reports z#IAMConnection.get_credential_reportcCrX)a Creates a new virtual MFA device for the AWS account. After creating the virtual MFA, use enable-mfa-device to attach the MFA device to an IAM user. :type path: string :param path: The path for the virtual MFA device. :type device_name: string :param device_name: The name of the virtual MFA device. Used with path to uniquely identify a virtual MFA device. )rYVirtualMFADeviceNameCreateVirtualMFADevicerK)rr" device_namer<r&r&r'create_virtual_mfa_devices z'IAMConnection.create_virtual_mfa_devicecCr])zB Returns the password policy for the AWS account. GetAccountPasswordPolicyrKr_r&r&r'get_account_password_policy z)IAMConnection.get_account_password_policycCr])zO Delete the password policy currently set for the AWS account. DeleteAccountPasswordPolicyrKr_r&r&r'delete_account_password_policyriz,IAMConnection.delete_account_password_policyc Csi} |durt|turt|| d<|dur&t|tur&t|| d<|dur.|| d<|dur6|| d<|dur>|| d<|durPt|turPt|| d<|durbt|turbt|| d<|durtt|turtt|| d <| durt|turt| | d <|d | S) a Update the password policy for the AWS account. Notes: unset parameters will be reset to Amazon default settings! Most of the password policy settings are enforced the next time your users change their passwords. When you set minimum length and character type requirements, they are enforced the next time your users change their passwords - users are not forced to change their existing passwords, even if the pre-existing passwords do not adhere to the updated password policy. When you set a password expiration period, the expiration period is enforced immediately. :type allow_users_to_change_password: bool :param allow_users_to_change_password: Allows all IAM users in your account to use the AWS Management Console to change their own passwords. :type hard_expiry: bool :param hard_expiry: Prevents IAM users from setting a new password after their password has expired. :type max_password_age: int :param max_password_age: The number of days that an IAM user password is valid. :type minimum_password_length: int :param minimum_password_length: The minimum number of characters allowed in an IAM user password. :type password_reuse_prevention: int :param password_reuse_prevention: Specifies the number of previous passwords that IAM users are prevented from reusing. :type require_lowercase_characters: bool :param require_lowercase_characters: Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (``a`` to ``z``). :type require_numbers: bool :param require_numbers: Specifies whether IAM user passwords must contain at least one numeric character (``0`` to ``9``). :type require_symbols: bool :param require_symbols: Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters: ``! @ # $ % ^ & * ( ) _ + - = [ ] { } | '`` :type require_uppercase_characters: bool :param require_uppercase_characters: Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (``A`` to ``Z``). NAllowUsersToChangePassword HardExpiryMaxPasswordAgeMinimumPasswordLengthPasswordReusePreventionRequireLowercaseCharactersRequireNumbersRequireSymbolsRequireUppercaseCharactersUpdateAccountPasswordPolicytypeboolstrlowerrC) rallow_users_to_change_password hard_expirymax_password_ageminimum_password_lengthpassword_reuse_preventionrequire_lowercase_charactersrequire_numbersrequire_symbolsrequire_uppercase_charactersr<r&r&r'update_account_password_policys(9 z,IAMConnection.update_account_password_policycCs,|||d}|durt||d<|d|S)a Create a policy. :type policy_name: string :param policy_name: The name of the new policy :type policy_document string :param policy_document: The document of the new policy :type path: string :param path: The path in which the policy will be created. Defaults to /. :type description: string :param path: A description of the new policy. )rrrsrYN Description CreatePolicy)ryrC)rrvrEr" descriptionr<r&r&r' create_policyls  zIAMConnection.create_policycCs2||d}t|tkrt||d<|d|S)ao Create a policy version. :type policy_arn: string :param policy_arn: The ARN of the policy :type policy_document string :param policy_document: The document of the new policy version :type set_as_default: bool :param set_as_default: Sets the policy version as default Defaults to None. ) PolicyArnrs SetAsDefaultCreatePolicyVersionrv)r policy_arnrEset_as_defaultr<r&r&r'create_policy_versions   z#IAMConnection.create_policy_versioncCr])z Delete a policy. :type policy_arn: string :param policy_arn: The ARN of the policy to delete r DeletePolicyrKrrr<r&r&r' delete_policyrzIAMConnection.delete_policycCrX)z Delete a policy version. :type policy_arn: string :param policy_arn: The ARN of the policy to delete a version from :type version_id: string :param version_id: The id of the version to delete r VersionIdDeletePolicyVersionrKrr version_idr<r&r&r'delete_policy_versionr\z#IAMConnection.delete_policy_versioncCr])z Get policy information. :type policy_arn: string :param policy_arn: The ARN of the policy to get information for r GetPolicyrKrr&r&r' get_policyrzIAMConnection.get_policycCrX)a Get policy information. :type policy_arn: string :param policy_arn: The ARN of the policy to get information for a specific version :type version_id: string :param version_id: The id of the version to get information for rGetPolicyVersionrKrr&r&r'get_policy_versionrz IAMConnection.get_policy_versioncCspi}|dur ||d<|dur||d<|dur||d<t|tkr(t||d<|dur0||d<|jd|dd S) aG List policies of account. :type marker: string :param marker: A marker used for pagination (received from previous accesses) :type max_items: int :param max_items: Send only max_items; allows paginations :type only_attached: bool :param only_attached: Send only policies attached to other resources :type path_prefix: string :param path_prefix: Send only items prefixed by this path :type scope: string :param scope: AWS|Local. Choose between AWS policies or your own NrErFrG OnlyAttachedScope ListPoliciesPoliciesrJrv)rrNrO only_attachedrMscoper<r&r&r' list_policiess  zIAMConnection.list_policiescCr;)an List policy versions. :type policy_arn: string :param policy_arn: The ARN of the policy to get versions of :type marker: string :param marker: A marker used for pagination (received from previous accesses) :type max_items: int :param max_items: Send only max_items; allows paginations rNrFrGListPolicyVersionsVersionsrJrK)rrrNrOr<r&r&r'list_policy_versionssz"IAMConnection.list_policy_versionscCrX)a Set default policy version. :type policy_arn: string :param policy_arn: The ARN of the policy to set the default version for :type version_id: string :param version_id: The id of the version to set as default rSetDefaultPolicyVersionrKrr&r&r'set_default_policy_versionr\z(IAMConnection.set_default_policy_versioncCsXd|i}|dur ||d<|dur||d<|dur||d<|dur$||d<|jd|dd S) a_ :type policy_arn: string :param policy_arn: The ARN of the policy to get entities for :type marker: string :param marker: A marker used for pagination (received from previous accesses) :type max_items: int :param max_items: Send only max_items; allows paginations :type path_prefix: string :param path_prefix: Send only items prefixed by this path :type entity_filter: string :param entity_filter: Which entity type of User | Role | Group | LocalManagedPolicy | AWSManagedPolicy to return rNrFrGrE EntityFilterListEntitiesForPolicy) PolicyGroups PolicyUsers PolicyRolesrJrK)rrrMrNrO entity_filterr<r&r&r'list_entities_for_policy"sz&IAMConnection.list_entities_for_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to attach :type group_name: string :param group_name: Group to attach the policy to rrRAttachGroupPolicyrKrrrVr<r&r&r'attach_group_policyF z!IAMConnection.attach_group_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to attach :type role_name: string :param role_name: Role to attach the policy to rrAttachRolePolicyrKrrrr<r&r&r'attach_role_policyRrz IAMConnection.attach_role_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to attach :type user_name: string :param user_name: User to attach the policy to rrjAttachUserPolicyrKrrrmr<r&r&r'attach_user_policy^rz IAMConnection.attach_user_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to detach :type group_name: string :param group_name: Group to detach the policy from rDetachGroupPolicyrKrr&r&r'detach_group_policyjrz!IAMConnection.detach_group_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to detach :type role_name: string :param role_name: Role to detach the policy from rDetachRolePolicyrKrr&r&r'detach_role_policyvrz IAMConnection.detach_role_policycCrX)z :type policy_arn: string :param policy_arn: The ARN of the policy to detach :type user_name: string :param user_name: User to detach the policy from rDetachUserPolicyrKrr&r&r'detach_user_policyrz IAMConnection.detach_user_policy)NNTNNNNNrrNrNTN)rNr*r+)rNN)NN)r)N)NNN)r) NNNNNNNNN)rN)NNNNN)NNNN)d__name__ __module__ __qualname__ APIVersionrr)rCrPrWr[r_rgrnrprxr|rrrrrrrrrrrrrrrrrrrrrget_all_server_certsrrrrrrrrrrrrrrrr r rrr"r%r)r,r0r2r4r6r:r>r@rCrFrHrJrPrSrXrZr\r`rbrfrhrkrrrrrrrrrrrrrrrrr __classcell__r&r&r$r'r9s                  "  &     '        !  .   N     % $     r)r1boto.jsonresponse boto.compatrrboto.resultsetrboto.iam.summarymaprboto.connectionrrrASSUME_ROLE_POLICY_DOCUMENTrr&r&r&r's2