Docker image for AWS CLI based on the alpine Docker image.
Credentials can be passed to the Docker container through the following environment variables:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
Assuming that these variables are already populated on your machine, you would list all your defined lambda functions by issuing the command:
docker run --rm -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY grycap/aws-cli lambda list-functions
Further information is available in the AWS CLI documentation.
You can run AWS CLI in AWS Lambda via SCAR using the following procedure:
- Modify the configuration file
scar-aws-cli.yaml
to include your keys and initialize the lambda function
scar init -f scar-aws-cli.yaml
- Invoke the Lambda function with the parameters that you want to execute in the aws-cli
scar run -f scar-aws-cli.yaml lambda list-functions