Cloud Foundry is an open source platform as a service product owned by Pivotal Software. CF allows you to deploy applications to containers on AWS, Azue, VMware vSphere, and others.
Terraform allows you to manage your AWS, and other cloud infrastructure, the same way you would manage servers using configuration management products like CFEngine or Puppet. Terraform is idempotent and convergent so only required changes are applied.
I saw a great Terraform presentation last week at a Devops meetup. Terraform is a configuration management tool for virtual infrastructure. You can define your AWS or similar environment using a descriptive language.