Modify Resource Based On Lambda Function In Python