airflow.providers.amazon.aws.hooks.ec2
¶
Module Contents¶
Functions¶
|
- class airflow.providers.amazon.aws.hooks.ec2.EC2Hook(api_type='resource_type', *args, **kwargs)[source]¶
Bases:
airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook
Interact with AWS EC2 Service.
Additional arguments (such as
aws_conn_id
) may be specified and are passed down to the underlying AwsBaseHook.See also
- get_instance(instance_id, filters=None)[source]¶
Get EC2 instance by id and return it.
- Parameters
instance_id (str) – id of the AWS EC2 instance
filters (Optional[List]) – List of filters to specify instances to get
- Returns
Instance object
- Return type
ec2.Instance
- describe_instances(filters=None, instance_ids=None)[source]¶
Describe EC2 instances, optionally applying filters and selective instance ids
- Parameters
filters (Optional[List]) – List of filters to specify instances to describe
instance_ids (Optional[List]) – List of instance IDs to describe
- Returns
Response from EC2 describe_instances API
- get_instances(filters=None, instance_ids=None)[source]¶
Get list of instance details, optionally applying filters and selective instance ids
- Parameters
instance_ids (Optional[List]) – List of ids to get instances for
filters (Optional[List]) – List of filters to specify instances to get
- Returns
List of instances
- Return type
- get_instance_ids(filters=None)[source]¶
Get list of instance ids, optionally applying filters to fetch selective instances
- Parameters
filters (Optional[List]) – List of filters to specify instances to get
- Returns
List of instance ids
- Return type