airflow.providers.amazon.aws.operators.base_aws¶
类¶
用于在 AWS Hook 基础上构建运算符的基础 AWS(Amazon)运算符类。 |
模块内容¶
- class airflow.providers.amazon.aws.operators.base_aws.AwsBaseOperator(*, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None, region=NOTSET, **kwargs)[source]¶
Bases:
airflow.providers.common.compat.sdk.BaseOperator,airflow.providers.amazon.aws.utils.mixins.AwsBaseHookMixin[airflow.providers.amazon.aws.utils.mixins.AwsHookType]用于在 AWS Hook 基础上构建运算符的基础 AWS(Amazon)运算符类。
警告
仅供内部使用,未来此类可能会在未另行通知的情况下更改、重命名或移除。
- 示例
from airflow.providers.amazon.aws.hooks.foo_bar import FooBarThinHook, FooBarThickHook class AwsFooBarOperator(AwsBaseOperator[FooBarThinHook]): aws_hook_class = FooBarThinHook def execute(self, context): pass class AwsFooBarOperator2(AwsBaseOperator[FooBarThickHook]): aws_hook_class = FooBarThickHook def __init__(self, *, spam: str, **kwargs): super().__init__(**kwargs) self.spam = spam @property def _hook_parameters(self): return {**super()._hook_parameters, "spam": self.spam} def execute(self, context): pass
- 参数:
aws_conn_id (str | None) – 用于获取 AWS 凭证的 Airflow 连接。如果为
None或为空,则使用默认的 boto3 行为。如果在分布式环境中运行 Airflow 且aws_conn_id为None或为空,则会使用默认的 boto3 配置(需在每个工作节点上维护该配置)。region_name (str | None) – AWS 区域名称。如果未指定,则使用默认的 boto3 行为。
verify (bool | str | None) – 是否验证 SSL 证书。参见:https://boto3.amazonaws.com/v1/documentation/api/latest/reference/core/session.html
botocore_config (dict | None) – botocore 客户端的配置字典(键值对)。参见:https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html
- template_fields: collections.abc.Sequence[str][source]¶