Skip to content

Latest commit

 

History

History
 
 

cloudwatch-logs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

CloudWatch Logs code examples for the SDK for JavaScript in Node.js

Overview

The code examples in this directory demonstrate how to work with Amazon CloudWatch Logs using the AWS SDK for JavaScript (v3).

You can use Amazon CloudWatch Logs to monitor, store, and access your log files from Amazon Elastic Compute Cloud (Amazon EC2) instances, AWS CloudTrail, Route 53, and other sources.

⚠️ Important

  • Running this code might result in charges to your AWS account.
  • Running the tests might result in charges to your AWS account.
  • We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see Grant least privilege.
  • This code is not tested in every AWS Region. For more information, see AWS Regional Services.

Code examples

Single actions

Code excerpts that show you how to call individual service functions.

Run the examples

Note: All code examples are written in ECMAscript 6 (ES6). For guidelines on converting to CommonJS, see JavaScript ES6/CommonJS syntax.

Prerequisites

Instructions

Run a single action

  1. Run node ./actions/<fileName>. OR
  2. Import ./actions/fileName into another module.

Tests

⚠️ Running the tests might result in charges to your AWS account.

Unit tests

  1. Run yarn.
  2. Run yarn test.

Integration tests

  1. Run yarn.
  2. Run yarn integration-test.

Additional resources

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0