Skip to content

Instantly share code, notes, and snippets.

@perplexes
Created October 8, 2015 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perplexes/50f82116b9f5fafaeb45 to your computer and use it in GitHub Desktop.
Save perplexes/50f82116b9f5fafaeb45 to your computer and use it in GitHub Desktop.
Copy AWS tags to Chef
#!/bin/bash
# brew install awscli
# brew install jq
# brew install parallel
aws ec2 describe-tags |\
jq -r '.Tags[] | select(.ResourceType == "instance") | select(.Key != "Name") | "knife tag create \(.ResourceId) \(.Key)=\(.Value)"' |\
parallel "sh -c {}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment