aws-amplify / aws-amplify/amplify-cli

Pass parameters to lambda method in command line without event.json

Open
#1,992 1 comment 4 reactions 0 assignees View on GitHub
feature-request functions mock p4
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**
My use case is I need to create some utility scripts that do some admin on our backend (e.g. add users to cognito groups, backfill data, dump data from dynamo, etc..). I'm currently doing these via the function category, even though I only plan to run these functions locally and I don't care about deployment.

This is equivalent scenario to the reason why rails has rake tasks.

Functions are great, but I have a scenario now where I want to pass parameters to a function via the command line without having to create a new event.json since these parameters are a one-off thing.

**Describe the solution you'd like**
Pass "context" or "event" via command line without having to create a file.

**Describe alternatives you've considered**
Hardcode parameter values in the index.js and change them every time function is executed or create a specific event.json

**Additional context**
I basically want something equivalent to rake tasks in rails - a series of adhoc tasks that an admin might need to run on the backend via command line. The tasks usually will not be run by the app itself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.