-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ca9319
commit 1db00d3
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |