Comments (5)
Hey,
to save the result of the script in the CloudWatch logs you only have to set de log_level
to DEBUG
:
aws:
- lambda:
name: BlackBoxTester
log_level: DEBUG
run_script: login.sh
container:
image: byrnedo/alpine-curl
Another option could be storing the result into a bucket in S3. To do it, you must create a result file in the $TMP_OUTPUT_DIR
(in your script):
#!/bin/sh
# Black Box Tester!
curl --location --request POST "https://api.platform.wisss.com/auth/oauth/token" --header 'Content-Type: application/x-www-form-urlencoded' --header 'Authorization: Basic V0pSWURITkdST0laSEw4Q > $TMP_OUTPUT_DIR/my_result.txt
and configure the output bucket for the function:
aws:
- lambda:
name: BlackBoxTester
run_script: login.sh
container:
image: byrnedo/alpine-curl
output:
- storage_provider: s3
path: my-output-bucket
from scar.
this is awesome
from scar.
some how for me when i provide run_script: login.sh in yaml and post in s3 bucket using $TMP_OUTPUT_DIR/my_result.txt in login.sh mind you in S3 bucket i can see the file got generated but no output in cloudwatch,i mean i dont see output in cloudwatch but when i run from cli like 'scar run -n BlackBoxTester -s login.sh' then only i am able to see results in cloudwatch ,do you also see such type of results?'
from scar.
If you want to store the result into a S3 bucket but also in the CloudWatch logs you can set the log_level
to DEBUG
and configure your bucket in the output
field. To ensure that both file and logs are shown you can redirect the output to a file and then concatenate the content of that file to stdout (in your script):
command > $TMP_OUTPUT_DIR/file && cat $TMP_OUTPUT_DIR/file
from scar.
Thanks a Ton
from scar.
Related Issues (20)
- My docker image is 396MB which is <512MB still AWS cloud watch fails to execute saying No SPACE LEFT HOT 2
- Scar unable to execute AWS Lambda function using Uploaded Docker image to S3 HOT 2
- How can i schedule scar run -n <Function name> HOT 2
- How To Convert your "scar init -f scar.yaml" inside docker to an equivalent docker exec -it scar init -f scar.yaml file using docker-compose HOT 1
- Can I use this lambda for training? HOT 3
- Getting No logs/failures for private docker "scar init -n SREBlackBoxTester -i 8236.dkr.ecr.us-west-2.amazonaws.com/abc-gat:latest" HOT 6
- JSON object must be str, bytes or bytearray, not NoneType HOT 5
- Scar local, does not honour env variables HOT 3
- Is it possible to mount a container using tmpfs? HOT 1
- Running a script inside docker container HOT 1
- How do I send an input(for ex a json input) to my script that is running in the container in aws lambda? HOT 3
- Access EFS storage from within container HOT 10
- batch processing from public bucket / subscribing to SNS topic HOT 2
- Allow creating a function inside a VPC
- Integration with Serverless
- How could the darknet example be changed if the weights, cfg, and data files were in s3?
- S3 storage not working with user-defined scripts HOT 2
- Error checking supervisor version in run command in case if image runtime
- SCAR throwing “Must specify userName when calling with non-User credentials” error when using AWS temporary credentials.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scar.