S3KeysUnchangedSensor

Amazon

Checks for changes in the number of objects at prefix in AWS S3 bucket and returns True if the inactivity period has passed with no increase in the number of objects. Note, this sensor will not behave correctly in reschedule mode, as the state of the listed objects in the S3 bucket will be lost between rescheduled invocations.

View on GitHub

Last Updated: May. 7, 2021

Access Instructions

Install the Amazon provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

bucket_nameRequiredstrName of the S3 bucket
prefixRequiredstrThe prefix being waited on. Relative path from bucket root level.
aws_conn_idstra reference to the s3 connection
verifyOptional[Union[bool, str]]Whether or not to verify SSL certificates for S3 connection. By default SSL certificates are verified. You can provide the following values: False: do not validate SSL certificates. SSL will still be used(unless use_ssl is False), but SSL certificates will not be verified. path/to/cert/bundle.pem: A filename of the CA cert bundle to uses.You can specify this argument if you want to use a different CA cert bundle than the one used by botocore.
inactivity_periodfloatThe total seconds of inactivity to designate keys unchanged. Note, this mechanism is not real time and this operator may not return until a poke_interval after this period has passed with no additional objects sensed.
min_objectsintThe minimum number of objects needed for keys unchanged sensor to be considered valid.
previous_objectsOptional[Set[str]]The set of object ids found during the last poke.
allow_deleteboolShould this sensor consider objects being deleted between pokes valid behavior. If true a warning message will be logged when this happens. If false an error will be raised.

Documentation

Checks for changes in the number of objects at prefix in AWS S3 bucket and returns True if the inactivity period has passed with no increase in the number of objects. Note, this sensor will not behave correctly in reschedule mode, as the state of the listed objects in the S3 bucket will be lost between rescheduled invocations.

Was this page helpful?