I have an SFTP Server in AWS (Transfer Family). I associated a workflow to it.
This workflow has 3 steps :
- call a lambda function for each file uploaded to the SFTP server (in
bucket_name_same_as_user_name/unprocessed
) - copy the original file (from
bucket_name_same_as_user_name/unprocessed
tobucket_name_same_as_user_name/processed
) - delete the original file
The lambda function gets rightfully called but for some reasons, none of the other steps are executed. Why is that ? Did I miss something in my configuration ?
Here's details about this workflow.
- The role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "transfer.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
- The policy attached to the role:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CopyRead",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::${SourceBucketName}/${ObjectName}"
},
{
"Sid": "CopyWrite",
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::${DestinationBucketName}/${ObjectName}"
},
{
"Sid": "CopyList",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": [
"arn:aws:s3:::${SourceBucketName}",
"arn:aws:s3:::${DestinationBucketName}"
]
},
{
"Sid": "Delete",
"Effect": "Allow",
"Action": [
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::${BucketName}/${ObjectName}"
},
{
"Sid": "Custom",
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction"
],
"Resource": [
"arn:aws:lambda:eu-west-3:502802710160:function:test-function"
]
}
]
}
- The configuration of the workflow:
[
{
"Type": "CUSTOM",
"CustomStepDetails": {
"Name": "call-test-function",
"Target": "arn:aws:lambda:eu-west-3:502800000000:function:test-function",
"TimeoutSeconds": 60,
"SourceFileLocation": "${original.file}"
}
},
{
"Type": "COPY",
"CopyStepDetails": {
"Name": "copy-file",
"DestinationFileLocation": {
"S3FileLocation": {
"Bucket": "test-bucket",
"Key": "${transfer:userName}/processed"
}
},
"OverwriteExisting": "FALSE",
"SourceFileLocation": "${original.file}"
}
},
{
"Type": "DELETE",
"DeleteStepDetails": {
"Name": "delete-file",
"SourceFileLocation": "${original.file}"
}
}
]