Skip to main content

ListS3

Description

Retrieves a listing of objects from an S3 bucket. For each object that is listed, creates a FlowFile that represents the object so that it can be fetched in conjunction with FetchS3Object. This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all of the data.

Tags

AWS, Amazon, S3, list

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Bucket *BucketThe S3 Bucket to interact with

Supports Expression Language, using FlowFile attributes and Environment variables.
Region *RegionUS West (Oregon)
  • AWS GovCloud (US)
  • AWS GovCloud (US-East)
  • US East (N. Virginia)
  • US East (Ohio)
  • US West (N. California)
  • US West (Oregon)
  • EU (Ireland)
  • EU (London)
  • EU (Paris)
  • EU (Frankfurt)
  • EU (Zurich)
  • EU (Stockholm)
  • EU (Milan)
  • EU (Spain)
  • Asia Pacific (Hong Kong)
  • Asia Pacific (Mumbai)
  • Asia Pacific (Hyderabad)
  • Asia Pacific (Singapore)
  • Asia Pacific (Sydney)
  • Asia Pacific (Jakarta)
  • Asia Pacific (Melbourne)
  • Asia Pacific (Tokyo)
  • Asia Pacific (Seoul)
  • Asia Pacific (Osaka)
  • South America (Sao Paulo)
  • China (Beijing)
  • China (Ningxia)
  • Canada (Central)
  • Canada West (Calgary)
  • Middle East (UAE)
  • Middle East (Bahrain)
  • Africa (Cape Town)
  • US ISO East
  • US ISOB East (Ohio)
  • US ISO West
  • Israel (Tel Aviv)
The AWS Region to connect to.
AWS Credentials Provider Service *AWS Credentials Provider serviceController Service:
AWSCredentialsProviderService

Implementations:
AWSCredentialsProviderControllerService
The Controller Service that is used to obtain AWS credentials provider
Listing Strategy *listing-strategyTracking Timestamps
  • Tracking Timestamps
  • Tracking Entities
  • No Tracking
Specify how to determine new/updated entities. See each strategy descriptions for detail.
Entity Tracking State Cache *et-state-cacheController Service:
DistributedMapCacheClient

Implementations:
HazelcastMapCacheClient
MapCacheClientService
RedisDistributedMapCacheClientService
SimpleRedisDistributedMapCacheClientService
Listed entities are stored in the specified cache storage so that this processor can resume listing across NiFi restart or in case of primary node change. 'Tracking Entities' strategy require tracking information of all listed entities within the last 'Tracking Time Window'. To support large number of entities, the strategy uses DistributedMapCache instead of managed state. Cache key format is 'ListedEntities::{processorId}(::{nodeId})'. If it tracks per node listed entities, then the optional '::{nodeId}' part is added to manage state separately. E.g. cluster wide cache key = 'ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b', per node cache key = 'ListedEntities::8dda2321-0164-1000-50fa-3042fe7d6a7b::nifi-node3' The stored cache content is Gzipped JSON string. The cache key will be deleted when target listing configuration is changed. Used by 'Tracking Entities' strategy.

This property is only considered if:
  • the property Listing Strategy has a value of entities
Entity Tracking Time Window *et-time-window3 hoursSpecify how long this processor should track already-listed entities. 'Tracking Entities' strategy can pick any entity whose timestamp is inside the specified time window. For example, if set to '30 minutes', any entity having timestamp in recent 30 minutes will be the listing target when this processor runs. A listed entity is considered 'new/updated' and a FlowFile is emitted if one of following condition meets: 1. does not exist in the already-listed entities, 2. has newer timestamp than the cached entity, 3. has different size than the cached entity. If a cached entity's timestamp becomes older than specified time window, that entity will be removed from the cached already-listed entities. Used by 'Tracking Entities' strategy.

Supports Expression Language, using Environment variables.

This property is only considered if:
  • the property Entity Tracking State Cache has a value specified
Entity Tracking Initial Listing Target *et-initial-listing-targetAll Available
  • Tracking Time Window
  • All Available
Specify how initial listing should be handled. Used by 'Tracking Entities' strategy.

This property is only considered if:
  • the property Listing Strategy has a value of entities
Record Writerrecord-writerController Service:
RecordSetWriterFactory

Implementations:
AvroRecordSetWriter
CSVRecordSetWriter
FreeFormTextRecordSetWriter
JsonRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
Specifies the Record Writer to use for creating the listing. If not specified, one FlowFile will be created for each entity that is listed. If the Record Writer is specified, all entities will be written to a single FlowFile instead of adding attributes to individual FlowFiles.
Minimum Object Age *min-age0 secThe minimum age that an S3 object must be in order to be considered; any object younger than this amount of time (according to last modification date) will be ignored
Maximum Object Agemax-ageThe maximum age that an S3 object can be in order to be considered; any object older than this amount of time (according to last modification date) will be ignored
Listing Batch SizeListing Batch Size100If not using a Record Writer, this property dictates how many S3 objects should be listed in a single batch. Once this number is reached, the FlowFiles that have been created will be transferred out of the Processor. Setting this value lower may result in lower latency by sending out the FlowFiles before the complete listing has finished. However, it can significantly reduce performance. Larger values may take more memory to store all of the information before sending the FlowFiles out. This property is ignored if using a Record Writer, as one of the main benefits of the Record Writer is being able to emit the entire listing as a single FlowFile.
Write Object Tags *write-s3-object-tagsFalse
  • True
  • False
If set to 'True', the tags associated with the S3 object will be written as FlowFile attributes
Write User Metadata *write-s3-user-metadataFalse
  • True
  • False
If set to 'True', the user defined metadata associated with the S3 object will be added to FlowFile attributes/records
Communications Timeout *Communications Timeout30 secsThe amount of time to wait in order to establish a connection to AWS or receive data from AWS before timing out.
SSL Context ServiceSSL Context ServiceController Service:
SSLContextService

Implementations:
StandardRestrictedSSLContextService
StandardSSLContextService
Specifies an optional SSL Context Service that, if provided, will be used to create connections
Endpoint Override URLEndpoint Override URLEndpoint URL to use instead of the AWS default including scheme, host, port, and path. The AWS libraries select an endpoint URL based on the AWS region, but this property overrides the selected endpoint URL, allowing use with other S3-compatible endpoints.

Supports Expression Language, using Environment variables.
Signer OverrideSigner OverrideDefault Signature
  • Default Signature
  • Signature Version 4
  • Signature Version 2
  • Custom Signature
The AWS S3 library uses Signature Version 4 by default but this property allows you to specify the Version 2 signer to support older S3-compatible services or even to plug in your own custom signer implementation.
Custom Signer Class Name *custom-signer-class-nameFully qualified class name of the custom signer class. The signer must implement com.amazonaws.auth.Signer interface.

Supports Expression Language, using Environment variables.

This property is only considered if:
  • the property Signer Override has a value of CustomSignerType
Custom Signer Module Locationcustom-signer-module-locationComma-separated list of paths to files and/or directories which contain the custom signer's JAR file and its dependencies (if any).

Supports Expression Language, using Environment variables.

This property is only considered if:
  • the property Signer Override has a value of CustomSignerType
Proxy Configuration Serviceproxy-configuration-serviceController Service:
ProxyConfigurationService

Implementations:
StandardProxyConfigurationService
Specifies the Proxy Configuration Controller Service to proxy network requests. Supported proxies: HTTP + AuthN
DelimiterdelimiterThe string used to delimit directories within the bucket. Please consult the AWS documentation for the correct use of this field.
PrefixprefixThe prefix used to filter the object list. Do not begin with a forward slash '/'. In most cases, it should end with a forward slash '/'.

Supports Expression Language, using Environment variables.
Use Versions *use-versionsfalse
  • true
  • false
Specifies whether to use S3 versions, if applicable. If false, only the latest version of each object will be returned.
List Type *list-typeList Objects V1
  • List Objects V1
  • List Objects V2
Specifies whether to use the original List Objects or the newer List Objects Version 2 endpoint.
Requester Pays *requester-paysFalse
  • True
  • False
If true, indicates that the requester consents to pay any charges associated with listing the S3 bucket. This sets the 'x-amz-request-payer' header to 'requester'. Note that this setting is not applicable when 'Use Versions' is 'true'.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
successFlowFiles are routed to this Relationship after they have been successfully processed.

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
filenameThe name of the file
s3.bucketThe name of the S3 bucket
s3.etagThe ETag that can be used to see if the file has changed
s3.isLatestA boolean indicating if this is the latest version of the object
s3.lastModifiedThe last modified time in milliseconds since epoch in UTC time
s3.lengthThe size of the object in bytes
s3.regionThe region of the S3 bucket
s3.storeClassThe storage class of the object
s3.tag.___If 'Write Object Tags' is set to 'True', the tags associated to the S3 object that is being listed will be written as part of the flowfile attributes
s3.user.metadata.___If 'Write User Metadata' is set to 'True', the user defined metadata associated to the S3 object that is being listed will be written as part of the flowfile attributes
s3.versionThe version of the object, if applicable

State Management

ScopeDescription
CLUSTERAfter performing a listing of keys, the timestamp of the newest key is stored, along with the keys that share that same timestamp. This allows the Processor to list only keys that have been added or modified after this date the next time that the Processor is run. State is stored across the cluster so that this Processor can be run on Primary Node only and if a new Primary Node is selected, the new node can pick up where the previous node left off, without duplicating the data.

Restricted

This component is not restricted.

Input Requirement

This component does not allow an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

CopyS3Object, DeleteS3Object, FetchS3Object, GetS3ObjectMetadata, PutS3Object, TagS3Object