import subprocess def handler(event, context): commands = [ 'whoami', 'id', 'df -h', 'ls -l /mnt', 'touch /mnt/lambda-efs/dummy.file', 'ls -l /mnt/lambda-efs/dummy.file' ] for command in commands: output = subprocess.check_output(command.split(' ')) print(f"Running command '{command}':\n{output.decode('ascii')}\n---\n") return { 'statusCode': 200, 'body': 'Hello world' }