cookbook 'aws_cloudwatch', '= 1.0.0'
aws_cloudwatch (7) Versions 1.0.0 Follow0
Provides aws_cloudwatch_agent resource
cookbook 'aws_cloudwatch', '= 1.0.0', :supermarket
knife supermarket install aws_cloudwatch
knife supermarket download aws_cloudwatch
AWS Cloudwatch Cookbook
This cookbook installs and configures AWS CloudWatch Agent.
Platform Support
- Ubuntu 14.04, 16.04
- Centos 6, 7
- Fedora 29
- Amazon Linux
Cookbook Dependencies
Usage
Place a dependency on the aws_cloudwatch cookbook in your cookbook's metadata.rb
depends 'aws_cloudwatch', '~> 0.1.0'
Then in a recipe:
aws_cloudwatch_agent 'default' do
action [:install, :configure, :restart]
json_config 'amazon-cloudwatch-agent.json.erb'
end
json_config
Amazon CloudWatch Agent configuration file which defines which metrics/logs are collected.
Place the amazon-cloudwatch-agent.json.erb
file to templates
directory. This is an agent configuration for metrics and logs collection.
See AWS documentation for more information: Manually Create or Edit the CloudWatch Agent Configuration File
config
The configuration file is at /opt/aws/amazon-cloudwatch-agent/etc.
See AWS Documentation for more info.
Default file looks like this:
# This common-config is used to configure items used for both ssm and cloudwatch access
## Configuration for shared credential.
## Default credential strategy will be used if it is absent here:
## Instance role is used for EC2 case by default.
## AmazonCloudWatchAgent profile is used for onPremise case by default.
# [credentials]
# shared_credential_profile = "{profile_name}"
# shared_credential_file= "{file_name}"
## Configuration for proxy.
## System-wide environment-variable will be read if it is absent here.
## i.e. HTTP_PROXY/http_proxy; HTTPS_PROXY/https_proxy; NO_PROXY/no_proxy
## Note: system-wide environment-variable is not accessible when using ssm run-command.
## Absent in both here and environment-variable means no proxy will be used.
# [proxy]
# http_proxy = "{http_url}"
# https_proxy = "{https_url}"
# no_proxy = "{domain}"
You can modify this configuration by overriding attributes:
default['aws_cloudwatch']['config']['params']['shared_credential_profile']
default['aws_cloudwatch']['config']['params']['shared_credential_file']
default['aws_cloudwatch']['config']['params']['http_proxy']
default['aws_cloudwatch']['config']['params']['https_proxy']
default['aws_cloudwatch']['config']['params']['no_proxy']
It is also possible to configure it with environment variables instead:
SHARED_CREDENTIAL_PROFILE
SHARED_CREDENTIAL_FILE
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
If you want to provide your own template for the configuration file, then you need to supply it as a config
parameter to the resource:
aws_cloudwatch_agent 'default' do
action :install
config
end
Resources overview
aws_cloudwatch_agent
The aws_cloudwatch_agent
resource installs AWS Cloudwatch Agent.
Parameters
-
action
- Possible actions with the agent::install
,:configure
,:remove
,:start
,:stop
,:restart
-
config
- A template name for a customtest-config.toml
file -
config_params
- A hash withtest-config.toml
parameters -
json_config
- A template name for anamazon-cloudwatch-agent.json
file
Example
aws_cloudwatch_agent 'default' do
action [:install, :configure, :restart]
json_config 'amazon-cloudwatch-agent.json.erb'
config_params :shared_credential_profile => 'test_profile',
:shared_credential_file => '/etc/test_credential_file',
:http_proxy => 'http://192.168.0.1',
:https_proxy => 'https://192.168.0.1',
:no_proxy => 'http://192.168.0.10'
end
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
aws_cloudwatch Cookbook CHANGELOG
This file is used to list changes made in each version of the aws_cloudwatch cookbook.
1.0.0 (2018-12-06)
- Initial release
Collaborator Number Metric
1.0.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.0 passed this metric
Foodcritic Metric
1.0.0 failed this metric
FC056: Ensure maintainer_email is set in metadata: aws_cloudwatch/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 passed this metric
Version Tag Metric
1.0.0 passed this metric
1.0.0 failed this metric
1.0.0 passed this metric
Foodcritic Metric
1.0.0 failed this metric
FC056: Ensure maintainer_email is set in metadata: aws_cloudwatch/metadata.rb:1
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.0 passed this metric
Testing File Metric
1.0.0 passed this metric
Version Tag Metric
1.0.0 passed this metric
1.0.0 failed this metric
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.0 passed this metric
Testing File Metric
1.0.0 passed this metric
Version Tag Metric
1.0.0 passed this metric
1.0.0 passed this metric
1.0.0 passed this metric