Git Product home page Git Product logo

Comments (5)

srisco avatar srisco commented on August 11, 2024

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.

tarunkumard avatar tarunkumard commented on August 11, 2024

this is awesome

from scar.

tarunkumard avatar tarunkumard commented on August 11, 2024

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.

srisco avatar srisco commented on August 11, 2024

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.

tarunkumard avatar tarunkumard commented on August 11, 2024

Thanks a Ton

from scar.

Related Issues (20)

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.