airflow.providers.amazon.aws.operators.rds

Module Contents

Classes

RdsCreateDbSnapshotOperator

Creates a snapshot of a DB instance or DB cluster.

RdsCopyDbSnapshotOperator

Copies the specified DB instance or DB cluster snapshot

RdsDeleteDbSnapshotOperator

Deletes a DB instance or cluster snapshot or terminating the copy operation

RdsStartExportTaskOperator

Starts an export of a snapshot to Amazon S3. The provided IAM role must have access to the S3 bucket.

RdsCancelExportTaskOperator

Cancels an export task in progress that is exporting a snapshot to Amazon S3

RdsCreateEventSubscriptionOperator

Creates an RDS event notification subscription

RdsDeleteEventSubscriptionOperator

Deletes an RDS event notification subscription

RdsCreateDbInstanceOperator

Creates an RDS DB instance

RdsDeleteDbInstanceOperator

Deletes an RDS DB Instance

class airflow.providers.amazon.aws.operators.rds.RdsCreateDbSnapshotOperator(*, db_type, db_identifier, db_snapshot_identifier, tags=None, aws_conn_id='aws_conn_id', **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
template_fields = ['db_snapshot_identifier', 'db_identifier', 'tags'][source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

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='', 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 (Optional[Sequence[mypy_boto3_rds.type_defs.TagTypeDef]]) – A list of tags in format [{“Key”: “something”, “Value”: “something”},] `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

template_fields = ['source_db_snapshot_identifier', 'target_db_snapshot_identifier', 'tags', 'pre_signed_url',...[source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

class airflow.providers.amazon.aws.operators.rds.RdsDeleteDbSnapshotOperator(*, db_type, db_snapshot_identifier, 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
  • db_type (str) – Type of the DB - either “instance” or “cluster”

  • db_snapshot_identifier (str) – The identifier for the DB instance or DB cluster snapshot

template_fields = ['db_snapshot_identifier'][source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

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, 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 (Optional[List[str]]) – The data to be exported from the snapshot.

template_fields = ['export_task_identifier', 'source_arn', 's3_bucket_name', 'iam_role_arn', 'kms_key_id',...[source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

class airflow.providers.amazon.aws.operators.rds.RdsCancelExportTaskOperator(*, export_task_identifier, 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

export_task_identifier (str) – The identifier of the snapshot export task to cancel

template_fields = ['export_task_identifier'][source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

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, 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 (Optional[Sequence[str]]) – A list of event categories for a source type that you want to subscribe to USER Events

  • source_ids (Optional[Sequence[str]]) – 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 (Optional[Sequence[mypy_boto3_rds.type_defs.TagTypeDef]]) – A list of tags in format [{“Key”: “something”, “Value”: “something”},] `USER Tagging

template_fields = ['subscription_name', 'sns_topic_arn', 'source_type', 'event_categories', 'source_ids', 'tags'][source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

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

template_fields = ['subscription_name'][source]
execute(self, context)[source]

Different implementations for snapshots, tasks and events

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 (Optional[Dict]) – 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_instance

  • aws_conn_id (str) – The Airflow connection used for AWS credentials.

  • wait_for_completion (bool) – Whether or not wait for creation of the DB instance to complete. (default: True)

execute(self, context)[source]

Different implementations for snapshots, tasks and events

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
execute(self, context)[source]

Different implementations for snapshots, tasks and events

Was this entry helpful?