# How to create an file in S3 bucket using AWS S3 node

In this tutorial we will create a json file inside an AWS S3 bucket. The input for creating the json file would be passed as API input.

  1. TBD The input payload for this use case is json payload given below.

     {
         "Bank_IFS_Code" : 33333,
         "Bank_Name" :  "ABCCorp",
         "MICR" : "AXTT-473-00-333",
         "Location" : "NSW",
     }
    
  2. Drag and drop JSON node from the transformation section on the pallette to the canvas.

  3. Double click the JSON node and select Always convert to JSON string. Click Save.

  4. Wire the TBD to JSON node.

TIP

As a Pre-requisite for this tutorial. Ensure to create an S3 bucket and name the bucket as MyBank. Reference: https://aws.amazon.com/s3/getting-started/?nc=sn&loc=5

  1. Drop the S3 node from AWS section on the pallette to the canvas. Double click the S3 node and provide the following details.

    • Bucket - MyBank
    • Key - BankRecord.json
    • Content - $msg.payload
  2. Click Save.

  3. Wire the JSON node to S3 node.

  4. Drop the debug node and name it as Completed.

  5. Wire the S3 node to Debug node.

  6. Click on the TBD to test the flow.

Observation

Go to your AWS account Mybank S3 bucket . You will be able to see a json file with the name BankRecord. Open the BankRecord.json to see the following payload

{
        "Bank_IFS_Code" : 33333,
        "Bank_Name" :  "ABCCorp",
        "MICR" : "AXTT-473-00-333",
        "Location" : "NSW",
}