I put everything in us-east-1 so this might not be for you.
export AWS_ACCESS_KEY_ID="test"
export AWS_SECRET_ACCESS_KEY="test"
export AWS_DEFAULT_REGION="us-east-1"REFERENCES:
<bucket-name>= bucket name<item>= item to upload<lambda-name>= the name of the lambada
awslocal s3api create-bucket --bucket <bucket-name> --region us-east-1awslocal s3api list-bucketsawslocal s3api put-object \
--bucket <bucket-name> \
--key <item> \
--body image.jpgawslocal s3api list-objects \
--bucket <bucket-name>#!/usr/bin/env bash
( awslocal ec2 describe-regions | jq -r '.Regions[].RegionName' ) | while IFS= read -r line
do
awslocal cloudformation describe-stacks --region $line
done[!note] if you published versions
awslocal lambda list-versions-by-function --function-name <lambda-name> --query 'Versions[*][Version, FunctionArn]' --output json
base64 -i input.json -o input.txt
awslocal lambda invoke --function-name my-function --payload file://input.txt outputfile.txt
In this command:
- base64 encode the JSON file to a text file.
my-functionis the name of your Lambda function.file://input.jsonis the path to the JSON file that contains the payload to be passed to the Lambda function.outputfile.txtis the file where the output of the Lambda function will be stored.
The input.json file might look like this:
{
"key1": "value1",
"key2": "value2",
"key3": "value3"
}