Collection of methods to help interactions with AWS Cloudwatch Logs
yarn install
yarn add aws-sdk --peer
: AWS-SDK is a peer dependency so it is on the dev to add it. Shouldn't be neccessary if it is install globally on the system.- Set up env vars. See section below
NODE_ENV
: Your Node environmentAWS_PROFILE
: AWS profile with full access to cloudwatch logsAWS_REGION
: The aws region your log group lives in.
(async function () {
process.env.NODE_ENV = "<node-env";
process.env.AWS_PROFILE = "<profile-with-full-cloudwatch-rights>";
process.env.AWS_REGION = "<region-you-will-be-working-in";
const awsCloudWatchHelper = require('./index');
const results = await awsCloudWatchHelper.clearLogStreams({
logGroupName: "<log-group-name>"
});
console.log("FINISHED: ", JSON.stringify(results, null, 2));
})();