blob: 6d3bfdf903cf6a0a64b46afe0ccf446304d2137d [file] [log] [blame]
:mod:`airflow.contrib.hooks.aws_hook`
=====================================
.. py:module:: airflow.contrib.hooks.aws_hook
.. autoapi-nested-parse::
This module contains Base AWS Hook
Module Contents
---------------
.. function:: _parse_s3_config(config_file_name, config_format='boto', profile=None)
Parses a config file for s3 credentials. Can currently
parse boto, s3cmd.conf and AWS SDK config formats
:param config_file_name: path to the config file
:type config_file_name: str
:param config_format: config type. One of "boto", "s3cmd" or "aws".
Defaults to "boto"
:type config_format: str
:param profile: profile name in AWS type config file
:type profile: str
.. py:class:: AwsHook(aws_conn_id='aws_default', verify=None)
Bases: :class:`airflow.hooks.base_hook.BaseHook`
Interact with AWS.
This class is a thin wrapper around the boto3 python library.
.. method:: _get_credentials(self, region_name)
.. method:: get_client_type(self, client_type, region_name=None, config=None)
Get the underlying boto3 client using boto3 session
.. method:: get_resource_type(self, resource_type, region_name=None, config=None)
Get the underlying boto3 resource using boto3 session
.. method:: get_session(self, region_name=None)
Get the underlying boto3.session.
.. method:: get_credentials(self, region_name=None)
Get the underlying `botocore.Credentials` object.
This contains the following authentication attributes: access_key, secret_key and token.
.. method:: expand_role(self, role)
If the IAM role is a role name, get the Amazon Resource Name (ARN) for the role.
If IAM role is already an IAM role ARN, no change is made.
:param role: IAM role name or ARN
:return: IAM role ARN