Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


aws_cloudwatch (7) Versions 2.0.0

Provides aws_cloudwatch_agent resource

cookbook 'aws_cloudwatch', '~> 2.0.0', :supermarket
cookbook 'aws_cloudwatch', '~> 2.0.0'
knife supermarket install aws_cloudwatch
knife supermarket download aws_cloudwatch
Quality 60%

AWS Cloudwatch Cookbook

Build Status Cookbook Version

This cookbook installs and configures AWS CloudWatch Agent.

Check out my blog at

Platform Support

  • Ubuntu 16.04, 18.04, 20.04
  • Debian 9, 10, 11
  • Centos 7
  • Fedora 29
  • Amazon Linux

Cookbook Dependencies

  • Chef 13+
  • gpg
  • sudo


Place a dependency on the aws_cloudwatch cookbook in your cookbook's metadata.rb

depends 'aws_cloudwatch', '~> 2.0.0'

Then in a recipe:

aws_cloudwatch_agent 'default' do
  action      [:install, :configure, :restart]
  json_config 'amazon-cloudwatch-agent.json.erb'


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


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:


It is also possible to configure it with environment variables instead:


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

Resources overview


The aws_cloudwatch_agent resource installs AWS Cloudwatch Agent.


  • action - Possible actions with the agent: :install, :configure, :remove, :start, :stop, :restart
  • config - A template name for a custom test-config.toml file
  • config_params - A hash with test-config.toml parameters
  • json_config - A template name for an amazon-cloudwatch-agent.json file


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 => '',
                  :https_proxy => '',
                  :no_proxy => ''



  • Ruby (see .tool-versions)
  • [Ruby Bundler](

Install gems with bundler:

bundle i


Create a branch for this cookbook. Create a PR. This will trigger a build on Travis CI. Make sure it succeeds.
You can also use test kitchen with AWS. Make sure you modify it with your custom parameters like Security Group id and

# Docker kitchen verify default
# AWS (uses OS credentials) kitchen verify default

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.

2.0.0 (2022.06.30)

  • Added Ubuntu-20.04 support
  • Added Debian 9, 10, 11 support
  • Dropped Chef 12 support
  • Fixed Issue #12 with config-translator writing to stderr

1.0.2 (2019.04.07)

  • Ubuntu-18.04 support

1.0.1 (2019.01.14)

1.0.0 (2018.12.06)

  • Initial release

Collaborator Number Metric

2.0.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Cookstyle Metric

2.0.0 failed this metric

Chef/Deprecations/DeprecatedChefSpecPlatform: Use currently supported platforms in ChefSpec listed at Fauxhai / ChefSpec will perform fuzzy matching on platform version so it's always best to be less specific ie. 10 instead of 10.3 ( aws_cloudwatch/spec/unit/recipes/default_spec.rb: 29
Chef/Modernize/RespondToInMetadata: It is no longer necessary to use respond_to? or defined? in metadata.rb in Chef Infra Client 12.15 and later ( aws_cloudwatch/metadata.rb: 6

Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations

No Binaries Metric

2.0.0 passed this metric

Testing File Metric

2.0.0 passed this metric

Version Tag Metric

2.0.0 passed this metric