为什么与 AWS SFTP 服务器关联的工作流程在第一步后停止?

问题描述 投票:0回答:1

我在 AWS(传输系列)中有一个 SFTP 服务器。我将工作流程与其关联起来。

此工作流程有 3 个步骤:

  • 为上传到 SFTP 服务器的每个文件调用 lambda 函数(在
    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}"  
    }  
  }  
]
amazon-web-services aws-lambda aws-transfer-family
1个回答
0
投票

您需要编写第一步 lambda 来执行

SendWorkflowStepState
https://docs.aws.amazon.com/transfer/latest/APIReference/API_SendWorkflowStepState.html

© www.soinside.com 2019 - 2024. All rights reserved.