Skip to content

Api#

Awscliv2 Index / Awscliv2 / Api

Auto-generated documentation for awscliv2.api module.

AWSAPI#

Show source in api.py:19

API for all AWS CLI v2 commands.

Supports installed and dockerized AWS CLI v2.

Arguments#

  • encoding - Input/output encoding, default utf-8.
  • output - Output stream, default sys.stdout.

Signature#

class AWSAPI:
    def __init__(
        self, encoding: str = ENCODING, output: Optional[TextIO] = None
    ) -> None: ...

See also#

AWSAPI().assume_role#

Show source in api.py:136

Add assume role to credentials.

Signature#

def assume_role(self, profile_name: str, source_profile: str, role_arn: str) -> None: ...

AWSAPI().execute#

Show source in api.py:80

Execute AWS CLI v2 command.

Returns#

Command output.

Signature#

def execute(self, args: Sequence[str]) -> str: ...

AWSAPI.get_awscli_v2_cmd#

Show source in api.py:35

Get command to run AWS CLI v2.

Signature#

@staticmethod
def get_awscli_v2_cmd() -> List[str]: ...

AWSAPI().print_version#

Show source in api.py:127

Print AWS CLI v2 version.

Returns#

Process exit code.

Signature#

def print_version(self) -> int: ...

AWSAPI().run_awscli_v2#

Show source in api.py:95

Run AWS CLI.

Returns#

Process exit code.

Signature#

def run_awscli_v2(self, args: Sequence[str]) -> int: ...

AWSAPI().run_awscli_v2_detached#

Show source in api.py:111

Run AWS CLI as a detached subprocess.

Returns#

Process exit code.

Signature#

def run_awscli_v2_detached(self, args: Sequence[str]) -> int: ...

AWSAPI().set_credentials#

Show source in api.py:172

Add or update credentials in ~/.aws/credentials.

Signature#

def set_credentials(
    self,
    profile_name: str,
    aws_access_key_id: str,
    aws_secret_access_key: str,
    aws_session_token: str = "",
    region: str = "",
) -> None: ...