airflow.providers.amazon.aws.hooks.base_aws
¶
This module contains Base AWS Hook.
See also
For more information on how to use this hook, take a look at the guide: Amazon Web Services Connection
Module Contents¶
-
class
airflow.providers.amazon.aws.hooks.base_aws.
AwsBaseHook
(aws_conn_id: Optional[str] = default_conn_name, verify: Union[bool, str, None] = None, region_name: Optional[str] = None, client_type: Optional[str] = None, resource_type: Optional[str] = None, config: Optional[Config] = None)[source]¶ Bases:
airflow.hooks.base.BaseHook
Interact with AWS. This class is a thin wrapper around the boto3 python library.
- Parameters
aws_conn_id (str) -- The Airflow connection used for AWS credentials. If this is None or empty then the default boto3 behaviour is used. If running Airflow in a distributed manner and aws_conn_id is None or empty, then default boto3 configuration would be used (and must be maintained on each worker node).
verify (Union[bool, str, None]) -- Whether or not to verify SSL certificates. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
region_name (Optional[str]) -- AWS region_name. If not specified then the default boto3 behaviour is used.
client_type (Optional[str]) -- boto3.client client_type. Eg 's3', 'emr' etc
resource_type (Optional[str]) -- boto3.resource resource_type. Eg 'dynamodb' etc
config (Optional[botocore.client.Config]) -- Configuration for botocore client. (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html)
-
get_client_type
(self, client_type: str, region_name: Optional[str] = None, config: Optional[Config] = None)[source]¶ Get the underlying boto3 client using boto3 session
-
get_resource_type
(self, resource_type: str, region_name: Optional[str] = None, config: Optional[Config] = None)[source]¶ Get the underlying boto3 resource using boto3 session
-
conn
(self)[source]¶ Get the underlying boto3 client/resource (cached)
- Returns
boto3.client or boto3.resource
- Return type
Union[boto3.client, boto3.resource]
-
get_conn
(self)[source]¶ Get the underlying boto3 client/resource (cached)
Implemented so that caching works as intended. It exists for compatibility with subclasses that rely on a super().get_conn() method.
- Returns
boto3.client or boto3.resource
- Return type
Union[boto3.client, boto3.resource]
-
get_credentials
(self, region_name: Optional[str] = None)[source]¶ Get the underlying botocore.Credentials object.
This contains the following authentication attributes: access_key, secret_key and token.