Skip to content

Instantly share code, notes, and snippets.

@n0ts
Created September 17, 2014 07:30
Show Gist options
  • Save n0ts/3f6b95dec568c9674163 to your computer and use it in GitHub Desktop.
Save n0ts/3f6b95dec568c9674163 to your computer and use it in GitHub Desktop.
AWS EC2 create-tags
for i in `aws ec2 describe-security-groups | jq -r '@csv "\(.SecurityGroups[] | [.GroupId, .GroupName])"'`; do aws ec2 create-tags --resources `echo $i | cut -d ',' -f 1 | tr -d '"'` --tags Key=Name,Value=`echo $i | cut -d ',' -f 2 | tr -d '"'` ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment