Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-warren committed May 1, 2014
1 parent 1ca9319 commit 1db00d3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,27 @@ chef-aws-tag
============

Set tags on your ec2 instances using Opsworks

How?
====

Add ``aws-tag::ec2`` recipe to your layers runlist

Add a section to your custom json and set your own list of tags, eg:

```
{
"aws-tag": {
"tags": {
"ouid": "917736014",
"team": "webdev",
"email": "[email protected]",
"app": "Awesome App",
"environment": "dev",
"availability": "on"
}
}
}
```

Ensure that the opsworks role has the ability to CreateTags and DeleteTags.
12 changes: 12 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name "aws-tag"

maintainer "stuart-warren"
maintainer_email "[email protected]"
license "Apache"
description "Sets tags on EC2 instances when using OpsWorks"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.1"

depends 'aws', '>= 0.2.4'

provides 'aws-tag::ec2'
9 changes: 9 additions & 0 deletions recipes/ec2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

include_recipe "aws"

unless node['aws-tag']['tags'].empty? || node['aws-tag']['tags'].nil?
aws_resource_tag node['ec2']['instance_id'] do
tags(node['aws-tag']['tags'])
action :update
end
end

0 comments on commit 1db00d3

Please sign in to comment.