3 Answers
- Newest
- Most votes
- Most comments
1
Why are you using Lambda in this case? I would send the S3 notification to SQS and have a process polling the queue on the EC2 instance. When it receives a new message, it download the file and process it.
0
Try Mountpoint for Amazon S3 - https://aws.amazon.com/blogs/aws/mountpoint-for-amazon-s3-generally-available-and-ready-for-production-workloads/
answered 8 months ago
Mountpoint only support Linux today. You could use WSL or a container to run on Windows.
0
I implemented similar solution in the past using S3 --> EventBridge --> Lambda function which invoked a SSM command
Example:
bucket_name = event['bucket_name']
s3_object = event['object_key']
instance_id = event['instance_id']
destination_path = event['destination']
command_string = f"Copy-S3Object -BucketName {bucket_name} -Key {s3_object} -LocalFile {destination_path}\{s3_object}"
cmd_id = ssm_client.send_command(
InstanceIds=[instance_id],
DocumentName="AWS-RunPowerShellScript",
Parameters={"commands": [command_string]},
CloudWatchOutputConfig={"CloudWatchOutputEnabled": True}
)
You will also need to verify that the EC2 instance has the proper IAM permissions assigned to access the S3 bucket and objects as well as the proper permissions for SSM management.
answered 8 months ago
Relevant content
- asked a year ago
- asked a month ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Thank you for your response. I was thinking of using Lambda to perform the above action and then continue to operate Window Server with Run Command by lambda.