Coder Social home page Coder Social logo

paws's Introduction

Paws, an AWS SDK for R

CRAN status Build Status AppVeyor Build Status codecov view examples

Overview

Paws is a Package for Amazon Web Services in R. Paws provides access to the full suite of AWS services from within R.

Visit our home page to see online documentation.

Disclaimer: Paws is not a product of or supported by Amazon Web Services.

Installation

Install Paws using:

install.packages("paws")

If you are using Linux, you will need to install the following OS packages:

  • Debian/Ubuntu: libcurl4-openssl-dev libssl-dev libxml2-dev
  • CentOS/Fedora/Red Hat: libcurl-devel libxml2-devel openssl-devel

Credentials

You'll need to set up your AWS credentials and region. Paws supports setting these per-service, or using R and OS environment variables, AWS credential files, and IAM roles. See docs/credentials.md for more info.

In the example below, we set them with R environment variables.

Warning: Do not save your credentials in your code, which could reveal them to others. Use one of the other methods above instead. See also RStudio's best practices for securing credentials.

Sys.setenv(
  AWS_ACCESS_KEY_ID = "abc",
  AWS_SECRET_ACCESS_KEY = "123",
  AWS_REGION = "us-east-1"
)

Usage

To use a service, create a client. All of a service's operations can be accessed from this object.

ec2 <- paws::ec2()

Launch an EC2 instance using the run_instances function.

resp <- ec2$run_instances(
  ImageId = "ami-f973ab84",
  InstanceType = "t2.micro",
  KeyName = "default",
  MinCount = 1,
  MaxCount = 1,
  TagSpecifications = list(
    list(
      ResourceType = "instance",
      Tags = list(
        list(Key = "webserver", Value = "production")
      )
    )
  )
)

List all of your instances with describe_instances.

ec2$describe_instances()

Shut down the instance you started with terminate_instances.

ec2$terminate_instances(
  InstanceIds = resp$Instances[[1]]$InstanceId
)

Documentation

You can browse all available services by looking at the package documentation.

help(package = "paws")

You can also jump to a specific service and see all its operations.

?paws::ec2

RStudio's code completion will show you the available services, their operations, and each operation's parameters.

There are also examples for EC2, S3, SQS, SNS, DynamoDB, Lambda, Batch, and Comprehend.

Related packages

  • cognitoR provides authentication for Shiny applications using Amazon Cognito.
  • noctua is an interface to the Athena serverless interactive query service, which allows you to query files stored in S3 using SQL or dplyr.
  • R6sagemaker is an interface to the SageMaker machine learning service, designed to work like the Python SageMaker SDK.
  • redshiftTools is a collection of tools for working with the Redshift data warehouse service, such as performing bulk uploads.

Examples, tutorials, and workshops

  • AWS AI Services for R Users shows how to use AWS to add deep learning capabilities like image recognition, text translation, and text-to-speech conversion to R and Shiny applications.
  • Using Amazon Rekognition from R is an end to end example of how to build and deploy a model to detect Nike swooshes in images using the Rekognition computer vision service.

Credits

API specifications from AWS SDK for JavaScript; design based on AWS SDK for Go.

Logo by Hsinyi Chen.

Home page design and cheat sheet by Mara Ursu.

Supported by the AWS Open Source promotional credits program.

paws's People

Contributors

davidkretch avatar adambanker avatar jcheng5 avatar dyfanjones avatar lorenzwalthert avatar ryanb8 avatar

Watchers

James Cloos avatar

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.