Code Monkey home page Code Monkey logo

csv-to-parquet-function's Introduction

Project

A simple AWS lambda function that converts a csv file from S3 to Parquet format and put it into S3.

The project contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.

  • csv_to_parquet_function - Code for the application's Lambda function.
  • template.yaml - A template that defines the application's AWS resources.

The application uses several AWS resources, including Lambda functions and S3. These resources are defined in the template.yaml file in this project. You can update the template to add AWS resources through the same deployment process that updates your application code.

Build and deploy

Build

To build the function using the SAM CLI

cd {project_dir}
sam build --template template.yaml --build-dir .aws-sam/build

Package

To package the function, the following command will use the bucket csv-to-parquet-function-config-bucket to save the function config.

aws s3api create-bucket --bucket csv-to-parquet-function-config-bucket \
                        --region us-east-1

sam package --template-file .aws-sam\build\template.yaml \
            --output-template-file .aws-sam\build\packaged-template.yaml \
            --s3-bucket csv-to-parquet-function-config-bucket

Deploy

To deploy to AWS, the following command will create a CloudFormation stack with the configured resources in the template.yaml file.

sam deploy  --template-file .aws-sam\build\packaged-template.yaml \
            --stack-name csv-to-parquet-function-stack \
            --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM \
            --region us-east-1

Cleanup

To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:

aws s3 rm s3://titanic-datalake --recursive
aws s3 rm s3://csv-to-parquet-function-config-bucket --recursive
aws cloudformation delete-stack --stack-name csv-to-parquet-function-stack \
                                --region us-east-1

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.