This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users = [{"id": 40, "name": "Joe Bloggs", "posts": 4}, | |
{"id": 567, "name": "Jenny Smith", "posts": 3}, | |
{"id": 3, "name": "Frank Jones", "posts": 54}, | |
{"id": 46, "name": "Samantha Wills", "posts": 0}, | |
{"id": 6789, "name": "Ahmed Joseph Naran", "posts": 15}] | |
def userTransform(user): | |
name = user["name"].rsplit(" ", 1) | |
return {"first_name": name[0], "last_name": name[1], "posts": user["posts"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We need the latest epel-release for a RHEL/Centos specific cloud-init | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
rpm -Uvh epel-release-6-8.noarch.rpm | |
# After this finishes you can build an AMI that will process the user data | |
# with cloud-init. You may also be interested in taking a look at the config | |
# file at /etc/cloud/cloud.cfg | |
yum install cloud-init |