我在 AWS(传输系列)中有一个 SFTP 服务器。我将工作流程与其关联起来。
此工作流程有 3 个步骤:
bucket_name_same_as_user_name/unprocessed
中)bucket_name_same_as_user_name/unprocessed
到bucket_name_same_as_user_name/processed
)lambda 函数被正确调用,但由于某些原因,其他步骤均未执行。这是为什么 ?我的配置中是否遗漏了某些内容?
以下是有关此工作流程的详细信息。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "transfer.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
{
"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"
]
}
]
}
[
{
"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}"
}
}
]
您需要编写第一步 lambda 来执行
SendWorkflowStepState
。 https://docs.aws.amazon.com/transfer/latest/APIReference/API_SendWorkflowStepState.html