Session

class coto.Session(debug=False, verify=True, metadata1_generator=None, captcha_solver=None, **kwargs)[source]

The Session class represents a session with the AWS Management Console.

Use the client method to obtain a client for one of the supported services.

Parameters:
  • debug (bool) – Enable debug messages.
  • verify (str | bool) – Requests SSL certificate checking. Path to CA certificates file. False to ignore certificate errors. True to use defaults (default).
  • captcha_solver (coto.captcha.Solver) – Class implementing a way to solve captchas (e.g., send them to Slack for you to solve).
  • metadata1_generator (coto.metadata1.Generator) – Class implementing a way to generate metadata1.
  • **kwargs – You can pass arguments for the signin method here.
client(service)[source]

Create a client for a service.

Supported services:
  • account
  • billing
  • federation
  • iam
  • mfa
  • resetpassword
  • signin
  • signin_amazon
  • signin_aws
Parameters:service – name of the service, eg., billing
Returns:service client
Return type:object
signin(**kwargs)[source]

Signin to the AWS Management Console.

There are various ways to sign in:
  • Using a boto3.Session object, pass the boto3_session argument.
  • Using the Account Root User, pass the email, password, and optionally mfa_secret arguments.
Parameters:
  • boto3_session (boto3.session.Session) – The credentials of this session are retrieved and used to signin to the console.
  • email (str) – AWS account root user email to use for login.
  • password (str) – AWS account root user password to use for login.
  • mfa_secret (str) – AWS account root user mfa secret to use for login. The Base32 seed defined as specified in RFC3548. The Base32StringSeed is Base64-encoded.