Overview
To use this template, you need an Alli Cloud Storage setup that uses Amazon S3 behind the scenes. You must have an active Amazon Web Services account with valid access credentials and permission to read, copy, and delete files in the target storage location. Before running it, decide whether you want to simply move files to another folder, rename them, or both.
It is worth understanding that any path to for a file that will be uploaded or moved in ACS is firstly made up of the S3 Bucket name and S3 Key Prefix, then any additional folder path you require. The prefix will look something like "source=app/app=forklift/" and is required for API purposes specfic to actions that create a file in a location of the bucket. Keep this in mind when manually searching in the ACS UI, but do not worry about these values otherwise – they will be prepended to your folder path by the code.
Variables
|
Name |
Reference |
Type |
Required |
Default |
Options |
Description |
|---|---|---|---|---|---|---|
|
Source File Name Match Type |
SOURCE_FILE_NAME_MATCH_TYPE |
Select |
➖ |
exact_match |
Exact Match: exact_match
|
How to interpret the source file name: use 'exact_match' for an exact file name or 'regex_match' to treat it as a regular expression for multiple files. |
|
Source Folder Path |
SOURCE_FOLDER_PATH |
Alphanumeric |
➖ |
- |
- |
Folder path under the client's S3 bucket and upload prefix where the source file is located. Leave blank to search directly under the prefix. Do not include the client's S3 bucket, upload prefix, or a leading slash in the path (these will be handled by the code, see logs for their values). |
|
Source File Name or Pattern |
SOURCE_FILE_NAME |
Alphanumeric |
✅ |
- |
- |
Alli Cloud Storage file name or regular expression pattern to select files to move/rename. Just provide the name or pattern - no folder path needed for this input. |
|
Destination Folder Path |
DESTINATION_FOLDER_PATH |
Alphanumeric |
➖ |
- |
- |
Target folder path under the S3 upload prefix where files will be moved. If simply renaming the file, then leave this blank. Set to '.' if you want to move a file to the root directory under the prefix. Do not include a leading slash. |
|
Destination File Name |
DESTINATION_FILE_NAME |
Alphanumeric |
➖ |
- |
- |
You can optionally enter a custom name for the moved/renamed file; if you leave it blank, the original filename will be used. When regex matching returns multiple files, your custom name serves as the base and “_1”, “_2”, etc., are appended to each file—if only one file matches, it uses your name unchanged. |
YAML
Below is the YAML template
source:
template: Alli Cloud Storage - Move or Rename Files
inputs:
SOURCE_FILE_NAME_MATCH_TYPE: exact_match
SOURCE_FOLDER_PATH:
SOURCE_FILE_NAME:
DESTINATION_FOLDER_PATH:
DESTINATION_FILE_NAME:
type: TEMPLATE
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- 10
- 13
- 14
- 101
- 106