isabella232 / aws.ec2 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from zapier/aws.ec2
AWS EC2 Client Package
This project forked from zapier/aws.ec2
AWS EC2 Client Package
# AWS EC2 Client Package # **aws.ec2** is a simple client package for the Amazon Web Services (AWS) [Elastic Cloud Compute (EC2)](http://aws.amazon.com/ec2/) REST API, which can be used to monitor use of AWS web services. To use the package, you will need an AWS account and enter your credentials into R. Your keypair can be generated on the [IAM Management Console](https://console.aws.amazon.com/iam/home?#security_credential) under the heading *Access Keys*. Note that you only have access to your secret key once. After it is generated, you need to save it in a secure location. New keypairs can be generated at any time if yours has been lost, stolen, or forgotten. By default, all **cloudyr** packages look for the access key ID and secret access key in environment variables. You can also use this to specify a default region. For example: ```R Sys.setenv("AWS_ACCESS_KEY_ID" = "mykey", "AWS_SECRET_ACCESS_KEY" = "mysecretkey", "AWS_DEFAULT_REGION" = "us-east-1") ``` These can alternatively be set on the command line or via an `Renviron.site` or `.Renviron` file ([see here for instructions](http://cran.r-project.org/web/packages/httr/vignettes/api-packages.html)). ## Code Examples ## The basic idea of the package is to be able to launch and control EC2 instances. You can read [this blog post from AWS](https://blogs.aws.amazon.com/bigdata/post/Tx3IJSB6BMHWZE5/Running-R-on-AWS) about how to run R on EC2. A really simple example is to launch an instance that comes preloaded with an RStudio Server Amazon Machine Image ([AMI](http://www.louisaslett.com/RStudio_AMI/)): ```{r} # Describe the AMI (from: http://www.louisaslett.com/RStudio_AMI/) image <- "ami-b1b0c3c2" describe_images(image) # Check your VPC and Security Group settings s <- describe_subnets() g <- describe_sgroups() # Launch the instance using appropriate settings i <- run_instances(image = image, type = "t2.micro", # <- you might want to change this subnet = s[[1]], sgroup = g[[1]]) # RStudio Server will be available at the "publicIp" address returned in `i` # Note: the default security settings prohibit outbound traffic # Stop and terminate the instances stop_instances(i[[1]]) terminate_instances(i[[1]]) ``` ## Installation ## [![CRAN](http://www.r-pkg.org/badges/version/aws.ec2)](http://cran.r-project.org/package=aws.ec2) ![Downloads](https://cranlogs.r-pkg.org/badges/aws.ec2) [![Travis Build Status](https://travis-ci.org/cloudyr/aws.ec2.png?branch=master)](https://travis-ci.org/cloudyr/aws.ec2) [![codecov.io](http://codecov.io/github/cloudyr/aws.ec2/coverage.svg?branch=master)](http://codecov.io/github/cloudyr/aws.ec2?branch=master) This package is not yet on CRAN. To install the latest development version you can install from the cloudyr drat repository: ```R # latest stable version install.packages("aws.ec2", repos = c(getOption("repos"), "http://cloudyr.github.io/drat")) ``` Or, to pull a potentially unstable version directly from GitHub: ```R if(!require("ghit")){ install.packages("ghit") } ghit::install_github("cloudyr/aws.ec2") ``` --- [![cloudyr project logo](http://i.imgur.com/JHS98Y7.png)](https://github.com/cloudyr)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.