carlogtt_python_library.aws_boto3.ec2 module
This module …
- class carlogtt_python_library.aws_boto3.ec2.EC2(aws_region_name: str, *, aws_profile_name: str | None = None, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, caching: bool = False, client_parameters: dict[str, Any] | None = None)[source]
Bases:
AwsServiceBase[EC2Client]The EC2 class provides a simplified interface for interacting with Amazon EC2 services within a Python application.
It includes an option to cache the client session to minimize the number of AWS API call.
- Parameters:
aws_region_name – The name of the AWS region where the service is to be used. This parameter is required to configure the AWS client.
aws_profile_name – The name of the AWS profile to use for credentials. This is useful if you have multiple profiles configured in your AWS credentials file. Default is None, which means the default profile or environment variables will be used if not provided.
aws_access_key_id – The AWS access key ID for programmatically accessing AWS services. This parameter is optional and only needed if not using a profile from the AWS credentials file.
aws_secret_access_key – The AWS secret access key corresponding to the provided access key ID. Like the access key ID, this parameter is optional and only needed if not using a profile.
aws_session_token – The AWS temporary session token corresponding to the provided access key ID. Like the access key ID, this parameter is optional and only needed if not using a profile.
caching – Determines whether to enable caching for the client session. If set to True, the client session will be cached to improve performance and reduce the number of API calls. Default is False.
client_parameters – A key-value pair object of parameters that will be passed to the low-level service client.