Git Product home page Git Product logo

lumigo-cli's Introduction

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

It will not receive any future updates or bug fixes.

lumigo-cli

A collection of helpful commands designed to smooth out the development and management of event-based, distributed applications.

Lumigo-cli also powers the Stackoscope that runs health-check on Serverless environments to detect security, cost, scalability, resilience, and performance issues.

oclif Version Downloads/week License codecov CircleCI

Usage

$ npm install -g lumigo-cli
$ lumigo-cli COMMAND
running command...
$ lumigo-cli (-v|--version|version)
lumigo-cli/0.40.1 darwin-x64 node-v14.3.0
$ lumigo-cli --help [COMMAND]
USAGE
  $ lumigo-cli COMMAND
...

Commands

lumigo-cli analyze-lambda-cold-starts

Analyze Lambda functions cold starts in ALL regions

USAGE
  $ lumigo-cli analyze-lambda-cold-starts

OPTIONS
  -d, --days=days        only find cold starts in the last X days
  -h, --hours=hours      only find cold starts in the last X hours
  -m, --minutes=minutes  [default: 60] only find cold starts in the last X minutes
  -n, --name=name        only analyze this function, e.g. hello-world
  -p, --profile=profile  AWS CLI profile name
  -r, --region=region    only include functions in an AWS region, e.g. us-east-1
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/analyze-lambda-cold-starts.js

lumigo-cli analyze-lambda-cost

Analyze Lambda functions costs in ALL regions

USAGE
  $ lumigo-cli analyze-lambda-cost

OPTIONS
  -d, --days=days        analyze lambda cost for the last X days
  -n, --name=name        only analyze this function, e.g. hello-world
  -p, --profile=profile  AWS CLI profile name
  -r, --region=region    only include functions in an AWS region, e.g. us-east-1
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/analyze-lambda-cost.js

lumigo-cli clear-account

Clear your AWS account from all supported resources. Use with cautious!

USAGE
  $ lumigo-cli clear-account

OPTIONS
  -f, --force            Skip prompt. Use mainly in CI/CD environments
  -p, --profile=profile  AWS CLI profile name
  -r, --retries=retries  [default: 2] How many times to try to delete stubborn resource
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/clear-account.js

lumigo-cli feedback

Suggest feature or report bug

USAGE
  $ lumigo-cli feedback

OPTIONS
  -d, --description=description  issue description
  -s, --subject=subject          (required) issue title
  -t, --type=feature|bug         (required) feedback type

See code: src/commands/feedback.js

lumigo-cli help [COMMAND]

display help for lumigo-cli

USAGE
  $ lumigo-cli help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

lumigo-cli list-kinesis-shards

Lists the shards of a Kinesis stream

USAGE
  $ lumigo-cli list-kinesis-shards

OPTIONS
  -n, --streamName=streamName  (required) name of the Kinesis stream, e.g. event-stream-dev
  -p, --profile=profile        AWS CLI profile name
  -r, --region=region          (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy        http/https proxy (when running in a corporate network)

See code: src/commands/list-kinesis-shards.js

lumigo-cli list-kinesis-streams

Lists the Kinesis streams

USAGE
  $ lumigo-cli list-kinesis-streams

OPTIONS
  -p, --profile=profile  AWS CLI profile name
  -r, --region=region    AWS region, e.g. us-east-1
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/list-kinesis-streams.js

lumigo-cli list-lambda

List Lambda functions in ALL regions

USAGE
  $ lumigo-cli list-lambda

OPTIONS
  -i, --inactive         only include functions that are inactive for 30 days
  -p, --profile=profile  AWS CLI profile name
  -r, --region=region    only include functions in an AWS region, e.g. us-east-1
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/list-lambda.js

lumigo-cli measure-lambda-cold-starts

Measures a function's cold start duration (i.e. duration + initDuration)

USAGE
  $ lumigo-cli measure-lambda-cold-starts

OPTIONS
  -e, --payload=payload            [default: {}] the JSON payload to send to the function
  -f, --file=file                  file that contains the JSON payload to send to the function
  -i, --invocations=invocations    [default: 100] the number of invocations to run for each configuration
  -n, --functionName=functionName  (required) name of the Lambda function
  -p, --profile=profile            AWS CLI profile name
  -r, --region=region              (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy            URL of the http/https proxy (when running in a corporate network)

See code: src/commands/measure-lambda-cold-starts.js

lumigo-cli powertune-lambda

Powertunes a Lambda function for cost or speed

USAGE
  $ lumigo-cli powertune-lambda

OPTIONS
  -e, --payload=payload                  [default: {}] the JSON payload to send to the function
  -f, --file=file                        file that contains the JSON payload to send to the function
  -i, --invocations=invocations          [default: 100] the number of invocations to run for each configuration
  -n, --functionName=functionName        (required) name of the Lambda function
  -o, --outputFile=outputFile            output file for the powertune SAR response
  -p, --profile=profile                  AWS CLI profile name
  -r, --region=region                    (required) AWS region, e.g. us-east-1
  -s, --strategy=cost|speed|balanced     (required) what to powertune the function for - "cost", "speed" or "balanced"
  -v, --powerValues=powerValues          comma-separated list of power values to be tested, e.g. 128,256,512,1024

  -w, --balancedWeight=balancedWeight    the trade-off between cost and time, 0.0 is equivalent to "speed" strategy, 1.0
                                         is equivalent to "cost" strategy

  -z, --noVisualization                  suppresses the prompt to show visualization

  --autoOptimize                         if true, apply the optimal configuration at the end of its execution

  --autoOptimizeAlias=autoOptimizeAlias  the state machine will create or update this alias with the new optimal power
                                         value

  --httpProxy=httpProxy                  URL of the http/https proxy (when running in a corporate network)

  --parallelInvocation                   run invocations in parallel

See code: src/commands/powertune-lambda.js

lumigo-cli replay-sqs-dlq

Replays the messages in a SQS DLQ back to the main queue

USAGE
  $ lumigo-cli replay-sqs-dlq

OPTIONS
  -c, --concurrency=concurrency     [default: 10] how many concurrent pollers to run
  -d, --dlqQueueName=dlqQueueName   (required) name of the SQS DLQ queue, e.g. task-queue-dlq-dev
  -k, --keep                        whether to keep the replayed messages in the DLQ
  -n, --targetName=targetName       (required) name of the target SQS queue/SNS topic, e.g. task-queue-dev
  -p, --profile=profile             AWS CLI profile name
  -r, --region=region               (required) AWS region, e.g. us-east-1
  -t, --targetType=SQS|SNS|Kinesis  [default: SQS] valid values are SQS [default], SNS, and Kinesis
  --httpProxy=httpProxy             URL of the http/https proxy (when running in a corporate network)
  --targetProfile=targetProfile     AWS CLI profile name to use for the target account
  --targetRegion=targetRegion       AWS region for the target resource, e.g. eu-west-1

See code: src/commands/replay-sqs-dlq.js

lumigo-cli s3-select-batch

Runs S3 Select on a batch of S3 objects, e.g. by prefix

USAGE
  $ lumigo-cli s3-select-batch

OPTIONS
  -b, --bucket=bucket                  (required) name of the S3 bucket
  -c, --concurrency=concurrency        [default: 10] how many concurrent S3 Select operations to run
  -e, --expression=expression          (required) the expression used to query each object
  -f, --fileType=CSV|JSON|Parquet      (required) What format are the files in? CSV, JSON, or Parquet
  -o, --outputFile=outputFile          output filename, if omitted, records would be printed in the console
  -p, --profile=profile                AWS CLI profile name
  -r, --region=region                  (required) AWS region, e.g. us-east-1
  -x, --prefix=prefix                  (required) object prefix
  --compressionType=(NONE|GZIP|BZIP2)  [default: NONE] the objects' compression format - NONE, GZIP or BZIP2
  --csvConfig=csvConfig                [default: {}] JSON config on how to parse CSV files
  --httpProxy=httpProxy                URL of the http/https proxy (when running in a corporate network)
  --jsonConfig=jsonConfig              [default: {"Type": "DOCUMENT"}] JSON config on how to parse JSON files
  --outputCsvConfig=outputCsvConfig    [default: {}] JSON config on how to format the output file in CSV
  --outputJsonConfig=outputJsonConfig  [default: {}] JSON config on how to format the output file in JSON

See code: src/commands/s3-select-batch.js

lumigo-cli scanner

Use Lumigo Stackoscope to scan your AWS account and suggest improvements

USAGE
  $ lumigo-cli scanner

OPTIONS
  -p, --profile=profile  AWS CLI profile name
  --httpProxy=httpProxy  URL of the http/https proxy (when running in a corporate network)

See code: src/commands/scanner.js

lumigo-cli send-to-sns

Sends each line in the specified file as a message to a SNS topic

USAGE
  $ lumigo-cli send-to-sns

OPTIONS
  -c, --concurrency=concurrency  [default: 10] how many concurrent pollers to run
  -f, --filePath=filePath        (required) path to the file
  -n, --topicName=topicName      (required) name of the SNS topic, e.g. my-topic-dev
  -p, --profile=profile          AWS CLI profile name
  -r, --region=region            (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy          URL of the http/https proxy (when running in a corporate network)

See code: src/commands/send-to-sns.js

lumigo-cli send-to-sqs

Sends each line in the specified file as a message to a SQS queue

USAGE
  $ lumigo-cli send-to-sqs

OPTIONS
  -f, --filePath=filePath    (required) path to the file
  -n, --queueName=queueName  (required) name of the SQS queue, e.g. task-queue-dev
  -p, --profile=profile      AWS CLI profile name
  -r, --region=region        (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy      URL of the http/https proxy (when running in a corporate network)

See code: src/commands/send-to-sqs.js

lumigo-cli sls-remove

Deletes a CloudFormation stack that was generated by the Serverless framework

USAGE
  $ lumigo-cli sls-remove

OPTIONS
  -e, --emptyS3Buckets       empty all S3 buckets that are part of the stack
  -n, --stackName=stackName  (required) name of the CloudFormation stack, e.g. hello-world-dev
  -p, --profile=profile      AWS CLI profile name
  -r, --region=region        (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy      URL of the http/https proxy (when running in a corporate network)

See code: src/commands/sls-remove.js

lumigo-cli switch-profile

Switch AWS profiles

USAGE
  $ lumigo-cli switch-profile

See code: src/commands/switch-profile.js

lumigo-cli tail-cloudwatch-events-bus

Tail a CloudWatch Events bus

USAGE
  $ lumigo-cli tail-cloudwatch-events-bus

OPTIONS
  -n, --eventBusName=eventBusName  name of the CloudWatch Events bus, if omitted, then the default bus is used
  -p, --profile=profile            AWS CLI profile name
  -r, --region=region              (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy            URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-cloudwatch-events-bus.js

lumigo-cli tail-cloudwatch-events-rule

Tail a CloudWatch Events rule

USAGE
  $ lumigo-cli tail-cloudwatch-events-rule

OPTIONS
  -b, --eventBusName=eventBusName  name of the CloudWatch Events bus
  -n, --ruleName=ruleName          (required) name of the CloudWatch Events rule
  -p, --profile=profile            AWS CLI profile name
  -r, --region=region              (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy            URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-cloudwatch-events-rule.js

lumigo-cli tail-cloudwatch-logs

Tail a CloudWatch Log Group

USAGE
  $ lumigo-cli tail-cloudwatch-logs

OPTIONS
  -f, --filterPattern=filterPattern  filter pattern for the logs, see
                                     https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.htm
                                     l

  -i, --interval=interval            [default: 1000] interval (ms) for polling CloudWatch Logs

  -n, --namePrefix=namePrefix        (required) name prefix of the log group, e.g. /aws/lambda/workshop-dev-

  -p, --profile=profile              AWS CLI profile name

  -r, --region=region                (required) AWS region, e.g. us-east-1

  --httpProxy=httpProxy              URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-cloudwatch-logs.js

lumigo-cli tail-dynamodb

Tails the records going into a DynamoDB stream

USAGE
  $ lumigo-cli tail-dynamodb

OPTIONS
  -e, --endpoint=endpoint    DynamoDB endpoint (for when using dynamodb-local)
  -n, --tableName=tableName  (required) name of the DynamoDB table, e.g. users-dev
  -p, --profile=profile      AWS CLI profile name
  -r, --region=region        (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy      URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-dynamodb.js

lumigo-cli tail-eventbridge-bus

Tail an EventBridge bus

USAGE
  $ lumigo-cli tail-eventbridge-bus

OPTIONS
  -n, --eventBusName=eventBusName  name of the EventBridge bus, if omitted, then the default bus is used
  -p, --profile=profile            AWS CLI profile name
  -r, --region=region              (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy            URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-eventbridge-bus.js

lumigo-cli tail-eventbridge-rule

Tail an EventBridge rule

USAGE
  $ lumigo-cli tail-eventbridge-rule

OPTIONS
  -b, --eventBusName=eventBusName  name of the EventBridge bus
  -n, --ruleName=ruleName          (required) name of the EventBridge rule
  -p, --profile=profile            AWS CLI profile name
  -r, --region=region              (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy            URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-eventbridge-rule.js

lumigo-cli tail-kinesis

Tails the records going into a Kinesis stream

USAGE
  $ lumigo-cli tail-kinesis

OPTIONS
  -n, --streamName=streamName  (required) name of the Kinesis stream, e.g. event-stream-dev
  -p, --profile=profile        AWS CLI profile name
  -r, --region=region          (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy        URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-kinesis.js

lumigo-cli tail-sns

Tails the messages going into a SNS topic

USAGE
  $ lumigo-cli tail-sns

OPTIONS
  -n, --topicName=topicName  (required) name of the SNS topic, e.g. task-topic-dev
  -p, --profile=profile      AWS CLI profile name
  -r, --region=region        (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy      URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-sns.js

lumigo-cli tail-sqs

Tails the messages going into a SQS queue

USAGE
  $ lumigo-cli tail-sqs

OPTIONS
  -n, --queueName=queueName  (required) name of the SQS queue, e.g. task-queue-dev
  -p, --profile=profile      AWS CLI profile name
  -r, --region=region        (required) AWS region, e.g. us-east-1
  --httpProxy=httpProxy      URL of the http/https proxy (when running in a corporate network)

See code: src/commands/tail-sqs.js

lumigo-cli whoami

See your current AWS profile name

USAGE
  $ lumigo-cli whoami

See code: src/commands/whoami.js

lumigo-cli's People

Contributors

efimk-lu avatar j0k3r avatar theburningmonk avatar tjpeden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lumigo-cli's Issues

move away from ngrok

a few people have complained about not being able to install because of ngrok related installation problems

add command to measure cold start

  1. deploy a Step Function to:
  2. invoke the target function
  3. modify the function's env vars to trigger "deployment"
  4. rinse and repeat to collect the min, max, 50th, 75th, 90th, 95th and 99th percentile latencies for, say, 1000 invocations
  5. poll the state machine execution for result
  6. parse and print the report
  7. delete the state machine afterwards

add EOL warning to node8.10 functions in list-lambda results

from AWS's email

For Node.js 8.x, there will be 2 stages to the runtime deprecation process:

1. Disable Function Create – Beginning January 6, 2020, customers will no longer be able to create functions using Node.js 8.10

2. Disable Function Update – Beginning February 3, 2020, customers will no longer be able to update functions using Node.js 8.10

After this period, both function creation and updates will be disabled permanently. However, existing Node 8.x functions will still be available to process invocation events.

add command to generate templates

e.g. a CloudFormation stack for bootstrapping logging infra (auto-subscribe SAR, auto-set-retention, async lambda metrics, etc.), or basic BI pipeline (kinesis -> kinesis firehose -> glue -> athena)

add command to powertune functions

steps:

  1. check if we have deployed the power tuning SAR already (we'll give the SAR app an identifiable name)
  2. if not, then deploy the power tuning SAR (do the dance of generating cloudformation template, poll, then deploy with cloudformation)
  3. run the step function against the specified function
  4. wait for execution to finish, then grab the output
  5. print the output
  6. exit, but leave the SAR around for next time

add command to deploy a monitoring stack

using our SARs for managing log groups and log retention, with the option to proxy through Kinesis stream, so we can also optionally support custom metrics through async-custom-metrics SAR

Send-to-sns error

I try to run this command:
lumigo-cli send-to-sns -n [topic_name] -r eu-west-1 -f testFile.json

and get the following error:

Error: Cannot find module 'bluebird'
    at Object.<anonymous> (/usr/local/lib/node_modules/lumigo-cli/src/commands/send-to-sns.js:1:17)

I'm using the latest version of the CLI.

lumigo-cli/0.25.1 darwin-x64 node-v10.17.0

Support for role_arn / source_profile format in AWS Credentials file

I tried taking the Lumigo-CLI for a spin today and found an issue wherein I am not able to use a profile that assumes a role from a base AWS account. The format in the credentials file looks like this:

[dev]
role_arn = arn:aws:iam::999633339999:role/poweruser_role
source_profile = some-profile

The error I get back is:

Replacing [default] profile creds with [dev] creds
Error: No "dev" profile found. Please check your creds
    at replaceDefaultProfile (~/.nvm/versions/node/v10.16.3/lib/node_modules/lumigo-cli/node_modules/aws-profile-utils/lib/index.js:103:11)
    at SwitchProfileCommand.run (~/.nvm/versions/node/v10.16.3/lib/node_modules/lumigo-cli/src/commands/switch-profile.js:48:5)

Note that this type of profile definition is supported by the AWS CLI.

add command to suggest feature/report bugs

e.g. lumigo-cli feedback --type feature --detail plz support x, lumigo-cli feedback -t bug -d when I run x it did y

and open the github issues page and create a new issue with the details

BUG: ProvisionedThroughputExceededException with Kinesis

I started listening for new Kinesis events after 4-5 I experienced the following exception:

ProvisionedThroughputExceededException: Rate exceeded for shard shardId-...
    at Request.extractError (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/protocol/json.js:51:27)
    at Request.callListeners (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/request.js:683:14)
    at Request.transition (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/request.js:685:12)
    at Request.callListeners (/usr/local/lib/node_modules/lumigo-cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)```

add command to update

perhaps also notify the user every time he/she runs a command that a new version is available?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.