- Newest
- Most votes
- Most comments
The issue you're experiencing is likely due to an outdated version of the boto3 library in your Lambda function's environment. The list_file_transfer_results
method is a relatively new addition to the AWS Transfer Family service, and it may not be available in older versions of boto3.
To resolve this, you should try the following steps:
-
Update the boto3 library in your Lambda function. You can do this by including the latest version of boto3 in your deployment package. Create a requirements.txt file with the following content:
boto3==latest
Then, install the dependencies in a directory that you'll include in your Lambda deployment package:
pip install -r requirements.txt -t ./package
-
Include the updated boto3 library in your Lambda deployment package along with your function code.
-
If you're using a Lambda layer for boto3, make sure it's updated to the latest version.
-
After updating boto3, redeploy your Lambda function.
It's important to note that AWS regularly updates their services and SDKs, and the documentation you're referring to might be for the latest version. Always ensure that your boto3 version is up-to-date to access the most recent features and methods.
If updating boto3 doesn't resolve the issue, you may want to double-check that the AWS Transfer Family service fully supports this method in your specific region (ap-southeast-2). Although it's unlikely, there could be regional differences in feature availability.
Lastly, make sure your IAM role for the Lambda function has the necessary permissions to use the AWS Transfer Family service and specifically the list_file_transfer_results
action.
If the problem persists after trying these steps, you may want to contact AWS support for further assistance, as there could be an underlying issue specific to your account or setup.
Sources
Working with AWS Boto3 - Amazon Braket
Code examples for Lambda using AWS SDKs - AWS Lambda
AWS client not reused in a Lambda function | Amazon CodeGuru, Detector Library
I think you should using this method instead:
response = client.list_executions(
MaxResults=123,
NextToken='string',
WorkflowId='string'
)
Here is response:
{
'NextToken': 'string',
'WorkflowId': 'string',
'Executions': [
{
'ExecutionId': 'string',
'InitialFileLocation': {
'S3FileLocation': {
'Bucket': 'string',
'Key': 'string',
'VersionId': 'string',
'Etag': 'string'
},
'EfsFileLocation': {
'FileSystemId': 'string',
'Path': 'string'
}
},
'ServiceMetadata': {
'UserDetails': {
'UserName': 'string',
'ServerId': 'string',
'SessionId': 'string'
}
},
'Status': 'IN_PROGRESS'|'COMPLETED'|'EXCEPTION'|'HANDLING_EXCEPTION'
},
]
}
Many thanks for your suggestion, having a go. I am having difficulty getting the WorkflowID.
For example,
response = transfer_client.start_file_transfer( ConnectorId='c-top-secret', SendFilePaths = files_to_upload, RemoteDirectoryPath= myRemoteDirectoryPath ) # List workflows response = transfer_client.list_workflows() print("Response for list_workflows : " + json.dumps(response, indent=2))
Produces the following json response:
{ "Workflows": [], "ResponseMetadata": { "RequestId": "f8bc7d94-e77d-40be-9fe4-747ebc8e844f", "HTTPStatusCode": 200, "HTTPHeaders": { "date": "Mon, 18 Nov 2024 21:10:24 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "16", "connection": "keep-alive", "x-amzn-requestid": "f8bc7d94-e77d-40be-9fe4-747ebc8e844f" }, "RetryAttempts": 0 } }
Note, no workflowID
Relevant content
- asked 10 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
Have noted the following regarding Boto3 version
In the documentation, Boto3 version is Boto3 1.35.63 In the Lambda Python function, Boto3 version is boto3 version: 1.34.145 In the AWS CLI, Boto3 version is boto3 1.35.20
Considering that AWS CLI is working (eg aws transfer list-file-transfer-results --connector-id c-top-screct --transfer-id -454532452345top-works), suggests need to have at least boto31.35.20 version running on Lambda. So will need to create a Lambda deployment package ! WOW !