Best Python code snippet using localstack_python
aws-delete-users.py
Source:aws-delete-users.py
...50 list_ssh_public_keys = client.list_ssh_public_keys(UserName=row[1]) # Listing public keys51 if list_ssh_public_keys['SSHPublicKeys']:52 delete_ssh_public_key = [client.delete_ssh_public_key(53 UserName=row[1], SSHPublicKeyId= Id['SSHPublicKeyId']) for Id in list_ssh_public_keys['SSHPublicKeys'] ] # Deleting if any54 list_service_specific_credentials = client.list_service_specific_credentials(55 UserName=row[1]) # Listing service specific credentials 56 if list_service_specific_credentials['ServiceSpecificCredentials']: # Deleting if any57 delete_service_specific_credential = [client.delete_service_specific_credential(58 UserName=row[1], ServiceSpecificCredentialId= Id['ServiceSpecificCredentialId']) for Id in list_service_specific_credentials['ServiceSpecificCredentials'] ]59 list_mfa_devices = client.list_mfa_devices(60 UserName=row[1]61 ) # Listing MFA devices62 if list_mfa_devices['MFADevices']: # Deleting if any63 deactivate_mfa_device = [client.deactivate_mfa_device( UserName=row[1],64 SerialNumber= Id['SerialNumber']65 ) for Id in list_mfa_devices['MFADevices'] ]66 delete_virtual_mfa_device = [client.delete_virtual_mfa_device(67 SerialNumber= Id['SerialNumber']68 ) for Id in list_mfa_devices['MFADevices'] ]...
httpscreds.py
Source:httpscreds.py
...24@helper.delete25def delete_https_credentials(event, _):26 user = event['ResourceProperties']['user']27 28 response = iamclient.list_service_specific_credentials(29 UserName=user,30 ServiceName='codecommit.amazonaws.com'31 )32 credentialid = response['ServiceSpecificCredentials'][0]['ServiceSpecificCredentialId']33 iamclient.delete_service_specific_credential(34 UserName=user,35 ServiceSpecificCredentialId=credentialid36 )37def handler(event, context):38 print("Started execution of HTTPS Credentials Creator Lambda...")39 print("Function ARN %s" % context.invoked_function_arn)40 print("Incoming Event %s " % json.dumps(event))41 42 helper(event, context)
bruteforce_tests.py
Source:bruteforce_tests.py
1BRUTEFORCE_TESTS = {2 "sts": [3 "get_caller_identity",4 "get_session_token"5 ],6 "dynamodb": [7 "describe_endpoints",8 "describe_limits",9 "list_backups",10 "list_global_tables",11 "list_tables",12 "list_tables"13 ],14"iam": [15 "get_account_authorization_details",16 "get_account_password_policy",17 "get_account_summary",18 "get_credential_report",19 "get_user",20 "list_access_keys",21 "list_account_aliases",22 "list_groups",23 "list_instance_profiles",24 "list_mfa_devices",25 "list_open_id_connect_providers",26 "list_policies",27 "list_roles",28 "list_saml_providers",29 "list_server_certificates",30 "list_service_specific_credentials",31 "list_signing_certificates",32 "list_ssh_public_keys",33 "list_users",34 "list_virtual_mfa_devices"35 ]...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!