cookbook 'm-cloudwatch', '= 0.2.0'
m-cloudwatch (4) Versions 0.2.0 Follow0
Cloudwatch Cookbook
cookbook 'm-cloudwatch', '= 0.2.0', :supermarket
knife supermarket install m-cloudwatch
knife supermarket download m-cloudwatch
m-cloudwatch Cookbook
This cookbook supplies a custom resource you can use to quickly configure EC2 log shipping to Cloudwatch. All you need to do is ensure your EC2 instance has proper IAM permissions to write to Cloudwatch. Below is an example minimum IAM policy of an EC2 Instance profile required.
# IAM Instance Profile Policy Required
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:DescribeLogStreams"
],
"Resource": [
"arn:aws:logs:*:*:*"
]
}
]
}
Once the instance has proper IAM policies, call this resource in it's run list like so:
# You can specify as many resources as you like, they will all be accumulated into the same template
awslogs 'access_logs' do
file '/var/log/httpd/default_vhost-access.log'
log_group_name 'amazon-testing-access'
region 'us-west-2'
end
awslogs 'error_logs' do
file '/var/log/httpd/default_vhost-error.log'
log_group_name 'amazon-testing-errors'
region 'us-west-2'
end
Be aware that this cookbook requires that Apache is already installed and running
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.