airflow.providers.amazon.aws.operators.rds
¶
Module Contents¶
Classes¶
Creates a snapshot of a DB instance or DB cluster. |
|
Copies the specified DB instance or DB cluster snapshot |
|
Deletes a DB instance or cluster snapshot or terminating the copy operation |
|
Starts an export of a snapshot to Amazon S3. The provided IAM role must have access to the S3 bucket. |
|
Cancels an export task in progress that is exporting a snapshot to Amazon S3 |
|
Creates an RDS event notification subscription |
|
Deletes an RDS event notification subscription |
|
Creates an RDS DB instance |
|
Deletes an RDS DB Instance |
|
Starts an RDS DB instance / cluster |
|
Stops an RDS DB instance / cluster |
- class airflow.providers.amazon.aws.operators.rds.RdsCreateDbSnapshotOperator(*, db_type, db_identifier, db_snapshot_identifier, tags=None, wait_for_completion=True, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Creates a snapshot of a DB instance or DB cluster. The source DB instance or cluster must be in the available or storage-optimization state.
See also
For more information on how to use this operator, take a look at the guide: Create a database snapshot
- Parameters
db_type (str) – Type of the DB - either “instance” or “cluster”
db_identifier (str) – The identifier of the instance or cluster that you want to create the snapshot of
db_snapshot_identifier (str) – The identifier for the DB snapshot
tags (Sequence[TagTypeDef] | dict | None) – A dictionary of tags or a list of tags in format [{“Key”: “…”, “Value”: “…”},] USER Tagging
wait_for_completion (bool) – If True, waits for creation of the DB snapshot to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsCopyDbSnapshotOperator(*, db_type, source_db_snapshot_identifier, target_db_snapshot_identifier, kms_key_id='', tags=None, copy_tags=False, pre_signed_url='', option_group_name='', target_custom_availability_zone='', source_region='', wait_for_completion=True, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Copies the specified DB instance or DB cluster snapshot
See also
For more information on how to use this operator, take a look at the guide: Copy a database snapshot
- Parameters
db_type (str) – Type of the DB - either “instance” or “cluster”
source_db_snapshot_identifier (str) – The identifier of the source snapshot
target_db_snapshot_identifier (str) – The identifier of the target snapshot
kms_key_id (str) – The AWS KMS key identifier for an encrypted DB snapshot
tags (Sequence[TagTypeDef] | dict | None) – A dictionary of tags or a list of tags in format [{“Key”: “…”, “Value”: “…”},] USER Tagging
copy_tags (bool) – Whether to copy all tags from the source snapshot to the target snapshot (default False)
pre_signed_url (str) – The URL that contains a Signature Version 4 signed request
option_group_name (str) – The name of an option group to associate with the copy of the snapshot Only when db_type=’instance’
target_custom_availability_zone (str) – The external custom Availability Zone identifier for the target Only when db_type=’instance’
source_region (str) – The ID of the region that contains the snapshot to be copied
wait_for_completion (bool) – If True, waits for snapshot copy to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsDeleteDbSnapshotOperator(*, db_type, db_snapshot_identifier, wait_for_completion=True, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Deletes a DB instance or cluster snapshot or terminating the copy operation
See also
For more information on how to use this operator, take a look at the guide: Delete a database snapshot
- Parameters
- class airflow.providers.amazon.aws.operators.rds.RdsStartExportTaskOperator(*, export_task_identifier, source_arn, s3_bucket_name, iam_role_arn, kms_key_id, s3_prefix='', export_only=None, wait_for_completion=True, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Starts an export of a snapshot to Amazon S3. The provided IAM role must have access to the S3 bucket.
See also
For more information on how to use this operator, take a look at the guide: Export an Amazon RDS snapshot to Amazon S3
- Parameters
export_task_identifier (str) – A unique identifier for the snapshot export task.
source_arn (str) – The Amazon Resource Name (ARN) of the snapshot to export to Amazon S3.
s3_bucket_name (str) – The name of the Amazon S3 bucket to export the snapshot to.
iam_role_arn (str) – The name of the IAM role to use for writing to the Amazon S3 bucket.
kms_key_id (str) – The ID of the Amazon Web Services KMS key to use to encrypt the snapshot.
s3_prefix (str) – The Amazon S3 bucket prefix to use as the file name and path of the exported snapshot.
export_only (list[str] | None) – The data to be exported from the snapshot.
wait_for_completion (bool) – If True, waits for the DB snapshot export to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsCancelExportTaskOperator(*, export_task_identifier, wait_for_completion=True, check_interval=30, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Cancels an export task in progress that is exporting a snapshot to Amazon S3
See also
For more information on how to use this operator, take a look at the guide: Cancel an Amazon RDS export task
- Parameters
- class airflow.providers.amazon.aws.operators.rds.RdsCreateEventSubscriptionOperator(*, subscription_name, sns_topic_arn, source_type='', event_categories=None, source_ids=None, enabled=True, tags=None, wait_for_completion=True, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Creates an RDS event notification subscription
See also
For more information on how to use this operator, take a look at the guide: Subscribe to an Amazon RDS event notification
- Parameters
subscription_name (str) – The name of the subscription (must be less than 255 characters)
sns_topic_arn (str) – The ARN of the SNS topic created for event notification
source_type (str) – The type of source that is generating the events. Valid values: db-instance | db-cluster | db-parameter-group | db-security-group | db-snapshot | db-cluster-snapshot | db-proxy
event_categories (Sequence[str] | None) – A list of event categories for a source type that you want to subscribe to USER Events
source_ids (Sequence[str] | None) – The list of identifiers of the event sources for which events are returned
enabled (bool) – A value that indicates whether to activate the subscription (default True)l
tags (Sequence[TagTypeDef] | dict | None) – A dictionary of tags or a list of tags in format [{“Key”: “…”, “Value”: “…”},] USER Tagging
wait_for_completion (bool) – If True, waits for creation of the subscription to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsDeleteEventSubscriptionOperator(*, subscription_name, aws_conn_id='aws_default', **kwargs)[source]¶
Bases:
RdsBaseOperator
Deletes an RDS event notification subscription
See also
For more information on how to use this operator, take a look at the guide: Unsubscribe to an Amazon RDS event notification
- Parameters
subscription_name (str) – The name of the RDS event notification subscription you want to delete
- class airflow.providers.amazon.aws.operators.rds.RdsCreateDbInstanceOperator(*, db_instance_identifier, db_instance_class, engine, rds_kwargs=None, aws_conn_id='aws_default', wait_for_completion=True, **kwargs)[source]¶
Bases:
RdsBaseOperator
Creates an RDS DB instance
See also
For more information on how to use this operator, take a look at the guide: Create a database instance
- Parameters
db_instance_identifier (str) – The DB instance identifier, must start with a letter and contain from 1 to 63 letters, numbers, or hyphens
db_instance_class (str) – The compute and memory capacity of the DB instance, for example db.m5.large
engine (str) – The name of the database engine to be used for this instance
rds_kwargs (dict | None) – Named arguments to pass to boto3 RDS client function
create_db_instance
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.create_db_instanceaws_conn_id (str) – The Airflow connection used for AWS credentials.
wait_for_completion (bool) – If True, waits for creation of the DB instance to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsDeleteDbInstanceOperator(*, db_instance_identifier, rds_kwargs=None, aws_conn_id='aws_default', wait_for_completion=True, **kwargs)[source]¶
Bases:
RdsBaseOperator
Deletes an RDS DB Instance
See also
For more information on how to use this operator, take a look at the guide: Delete a database instance
- Parameters
db_instance_identifier (str) – The DB instance identifier for the DB instance to be deleted
rds_kwargs (dict | None) – Named arguments to pass to boto3 RDS client function
delete_db_instance
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/rds.html#RDS.Client.delete_db_instanceaws_conn_id (str) – The Airflow connection used for AWS credentials.
wait_for_completion (bool) – If True, waits for deletion of the DB instance to complete. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsStartDbOperator(*, db_identifier, db_type=RdsDbType.INSTANCE, aws_conn_id='aws_default', wait_for_completion=True, **kwargs)[source]¶
Bases:
RdsBaseOperator
Starts an RDS DB instance / cluster
See also
For more information on how to use this operator, take a look at the guide: Start a database instance or cluster
- Parameters
db_identifier (str) – The AWS identifier of the DB to start
db_type (RdsDbType | str) – Type of the DB - either “instance” or “cluster” (default: “instance”)
aws_conn_id (str) – The Airflow connection used for AWS credentials. (default: “aws_default”)
wait_for_completion (bool) – If True, waits for DB to start. (default: True)
- class airflow.providers.amazon.aws.operators.rds.RdsStopDbOperator(*, db_identifier, db_type=RdsDbType.INSTANCE, db_snapshot_identifier=None, aws_conn_id='aws_default', wait_for_completion=True, **kwargs)[source]¶
Bases:
RdsBaseOperator
Stops an RDS DB instance / cluster
See also
For more information on how to use this operator, take a look at the guide: Stop a database instance or cluster
- Parameters
db_identifier (str) – The AWS identifier of the DB to stop
db_type (RdsDbType | str) – Type of the DB - either “instance” or “cluster” (default: “instance”)
db_snapshot_identifier (str | None) – The instance identifier of the DB Snapshot to create before stopping the DB instance. The default value (None) skips snapshot creation. This parameter is ignored when
db_type
is “cluster”aws_conn_id (str) – The Airflow connection used for AWS credentials. (default: “aws_default”)
wait_for_completion (bool) – If True, waits for DB to stop. (default: True)