AWS objects:
-Created a new not-brigade AMI that launches the app. ami-6a41550b (not-brigade-ami). Can redeploy as many as I like, so long as I run "sudo puppet agent --test --server=puppet.internal.justin.tv"  on it

-Created ' codedeploy-userpolicy ' policy and 'poc-codedeploy-user' user. the poc-codedeploy-user is used to generate the iam user needed for each code deploy instance ( requirement for http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-configure-on-premises-host.html#how-to-configure-on-premises-host-script  since we can't reuse iam users)
- Created 'codedeploy-service-role' based on http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-create-service-role.html. Role ARN: arn:aws:iam::673385534282:role/codedeploy-service-role
-Created "deploymentConfigId": "9e2ecf43-4aa6-4436-8156-3fdc71b9e8bd" by "aws deploy create-deployment-config --deployment-config-name not-brigade-dev-ec2 --minimum-healthy-hosts type=HOST_COUNT,value=0 --region us-west-2"
- Created application "not-brigade-dev-ec2"  with id: "applicationId": "fb92e9c2-5106-4338-9aa0-f30cad69f75c" by: "aws deploy create-application --application-name not-brigade-dev-ec2 --region us-west-2"
- Created deployment-group:  "deploymentGroupId": "92daa2b0-fe4b-4257-8e5b-5a58739df5b4" by using: "aws deploy create-deployment-group --application-name not-brigade-dev-ec2 --region us-west-2 --deployment-group-name development --service-role-arn arn:aws:iam::673385534282:role/codedeploy-service-role"


TODO:
  * need to have an automated rollout into codedeploy for already running instances 
 register instance with codedeploy (aws deploy register --instance-name not-brigade-0.dev.us-west2.justin.tv --tags Key=DeployGroup,Value=not-brigade-dev --region us-west-2)
  * Note: Don't run the deploy install command it tells you to run after since the agent is already running


Concerns:
  - so when I run puppet, it uses courier to install and start the process... We need to make sure the install directories are the same, or remove courier.
  - how does this work with ASGs where we're actively deploying to the group and a new node is created during the deploy?
  - set "reasonable" timeouts for scripts
  - How to get logs going to cloud*?
  - why didn't my codedeploy-agent logs get pushed to the UI or anywhere?

Notes on building a not-brigade AMI:
- created a separate dev.tf file so I can do a dry run of changes required against the prod instance. Will bake into AMI and use in an ASG so we can test deploy to it. Also, the base AMI has the wrong version of puppet installed. needed to apt-get remove it, then apt-get install puppet-common=3.7.5-1puppetlabs1.


