AWS SDK for Ruby Developer Guide

Total Page:16

File Type:pdf, Size:1020Kb

AWS SDK for Ruby Developer Guide AWS SDK for Ruby Developer Guide AWS SDK for Ruby: Developer Guide Copyright © Amazon Web Services, Inc. and/or its affiliates. All rights reserved. AWS SDK for Ruby Developer Guide Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by Amazon. AWS SDK for Ruby Developer Guide Table of Contents AWS SDK for Ruby Developer Guide .................................................................................................... 1 Using the AWS SDK for Ruby with AWS Cloud9 ............................................................................. 1 About This Guide ....................................................................................................................... 1 Additional Documentation and Resources ...................................................................................... 1 Deploying to the AWS Cloud ............................................................................................... 2 Maintenance and support for SDK major versions .......................................................................... 2 Getting Started .................................................................................................................................. 3 Quick Start Guide ...................................................................................................................... 3 Write the Code .................................................................................................................. 3 Run the Code .................................................................................................................... 3 Note for Windows Users ..................................................................................................... 3 Installing the SDK ...................................................................................................................... 4 Prerequisites ...................................................................................................................... 4 Installing the SDK .............................................................................................................. 4 Hello World Tutorial ................................................................................................................... 4 Using the AWS SDK for Ruby in Your Program ....................................................................... 5 Creating an Amazon S3 Resource ......................................................................................... 5 Creating a Bucket ............................................................................................................... 5 Adding a File to the Bucket ................................................................................................. 5 Listing the Contents of a Bucket .......................................................................................... 5 Complete Program ............................................................................................................. 5 Running the Program ......................................................................................................... 7 Next Steps ........................................................................................................................ 7 Configuring the SDK ........................................................................................................................... 8 Get your AWS access keys ........................................................................................................... 8 To get your access key ID and secret access key ..................................................................... 8 Setting AWS Credentials ............................................................................................................. 8 Setting Shared Credentials .................................................................................................. 9 Setting Credentials Using Environment Variables .................................................................... 9 Setting Credentials Using Aws.config ............................................................................... 10 Changing your Credentials Location .................................................................................... 10 Setting Credentials in a Client Object ................................................................................. 10 Setting Credentials Using IAM ............................................................................................ 10 Creating an AWS STS Access Token ............................................................................................ 10 Setting a Region ...................................................................................................................... 11 Setting the Region Using Environment Variables .................................................................. 11 Setting the Region Using Aws.config ............................................................................... 11 Setting the Region in a Client or Resource Object ................................................................. 11 Setting a Nonstandard Endpoint ................................................................................................ 11 SDK Metrics ............................................................................................................................. 12 Authorize SDK Metrics ...................................................................................................... 12 Set Up SDK Metrics .......................................................................................................... 14 SDK Metric Definitions ...................................................................................................... 16 Using AWS Cloud9 with the SDK ........................................................................................................ 18 Step 1: Set up Your AWS Account to Use AWS Cloud9 ................................................................... 18 Step 2: Set up Your AWS Cloud9 Development Environment .......................................................... 18 Step 3: Set up the AWS SDK for Ruby ......................................................................................... 18 Step 4: Download Example Code ................................................................................................ 19 Step 5: Run Example Code ........................................................................................................ 19 Using the SDK ................................................................................................................................. 20 Using the AWS SDK for Ruby REPL Tool ..................................................................................... 20 Using the SDK with Ruby on Rails ............................................................................................. 20 Migrating from Version 1 or 2 to Version 3 of the AWS SDK for Ruby ............................................. 21 Side-by-Side Usage ........................................................................................................... 21 iii AWS SDK for Ruby Developer Guide General Differences .......................................................................................................... 21 Client Differences ............................................................................................................. 21 Resource Differences ......................................................................................................... 22 Debugging Tip: Getting Wire Trace Information from a Client ........................................................ 23 Stubbing Client Responses and Errors ........................................................................................ 24 Stubbing Client Responses ................................................................................................ 24 Stubbing Client Errors ....................................................................................................... 25 Paging Response Data ............................................................................................................. 25 Paged Responses Are Enumerable ...................................................................................... 25 Handling Paged Responses Manually .................................................................................. 25 Paged Data Classes ........................................................................................................... 26 Using Waiters ......................................................................................................................... 26 Invoking a Waiter ............................................................................................................. 26 Wait Failures .................................................................................................................... 26 Configuring a Waiter ......................................................................................................... 27 Extending a Waiter
Recommended publications
  • Reglas De Congo: Palo Monte Mayombe) a Book by Lydia Cabrera an English Translation from the Spanish
    THE KONGO RULE: THE PALO MONTE MAYOMBE WISDOM SOCIETY (REGLAS DE CONGO: PALO MONTE MAYOMBE) A BOOK BY LYDIA CABRERA AN ENGLISH TRANSLATION FROM THE SPANISH Donato Fhunsu A dissertation submitted to the faculty of the University of North Carolina at Chapel Hill in partial fulfillment of the requirements for the degree of Doctor of Philosophy in the Department of English and Comparative Literature (Comparative Literature). Chapel Hill 2016 Approved by: Inger S. B. Brodey Todd Ramón Ochoa Marsha S. Collins Tanya L. Shields Madeline G. Levine © 2016 Donato Fhunsu ALL RIGHTS RESERVED ii ABSTRACT Donato Fhunsu: The Kongo Rule: The Palo Monte Mayombe Wisdom Society (Reglas de Congo: Palo Monte Mayombe) A Book by Lydia Cabrera An English Translation from the Spanish (Under the direction of Inger S. B. Brodey and Todd Ramón Ochoa) This dissertation is a critical analysis and annotated translation, from Spanish into English, of the book Reglas de Congo: Palo Monte Mayombe, by the Cuban anthropologist, artist, and writer Lydia Cabrera (1899-1991). Cabrera’s text is a hybrid ethnographic book of religion, slave narratives (oral history), and folklore (songs, poetry) that she devoted to a group of Afro-Cubans known as “los Congos de Cuba,” descendants of the Africans who were brought to the Caribbean island of Cuba during the trans-Atlantic Ocean African slave trade from the former Kongo Kingdom, which occupied the present-day southwestern part of Congo-Kinshasa, Congo-Brazzaville, Cabinda, and northern Angola. The Kongo Kingdom had formal contact with Christianity through the Kingdom of Portugal as early as the 1490s.
    [Show full text]
  • Theine2 Documentation Release Latest
    theine2 Documentation Release latest Dec 06, 2019 Contents 1 Installing 3 2 Upgrading 5 3 Using 7 4 Configuration 9 4.1 base_port and max_port.........................................9 4.2 min_free_workers............................................9 4.3 spawn_parallel..............................................9 4.4 silent................................................... 10 5 Speed up Theine 11 5.1 Tell Theine to use CRuby for the client................................. 11 6 Using with Foreman 13 7 Using with Docker 15 8 How it works 17 i ii theine2 Documentation, Release latest Theine is a Rails application pre-loader designed to work on JRuby. It is similar to Zeus, Spring and Spork. The problem with Zeus and Spring is that they use fork which doesn’t work on JRuby. An example: time rails runner"puts Rails.env" 48.31s user 1.96s system 242% cpu 20.748 total # normal time theine runner"puts Rails.env" 0.12s user 0.02s system 32% cpu 0.449 total # Theine Contents 1 theine2 Documentation, Release latest 2 Contents CHAPTER 1 Installing You need to install screen on your system. For example on Ubuntu: sudo apt-get install screen Then install the gem. gem install theine2 3 theine2 Documentation, Release latest 4 Chapter 1. Installing CHAPTER 2 Upgrading If you want to use CRuby for the client, you will probably need to re-run theine_set_ruby after upgrading. 5 theine2 Documentation, Release latest 6 Chapter 2. Upgrading CHAPTER 3 Using Start up the theine server in the root of your Rails project: theine_server or theine_start for a detached
    [Show full text]
  • Download the 2021 IEEE Thesaurus
    2021 IEEE Thesaurus Version 1.0 Created by The Institute of Electrical and Electronics Engineers (IEEE) 2021 IEEE Thesaurus The IEEE Thesaurus is a controlled The IEEE Thesaurus also provides a vocabulary of almost 10,900 descriptive conceptual map through the use of engineering, technical and scientific terms, semantic relationships such as broader as well as IEEE-specific society terms terms (BT), narrower terms (NT), 'used for' [referred to as “descriptors” or “preferred relationships (USE/UF), and related terms terms”] .* Each descriptor included in the (RT). These semantic relationships identify thesaurus represents a single concept or theoretical connections between terms. unit of thought. The descriptors are Italic text denotes Non-preferred terms. considered the preferred terms for use in Bold text is used for preferred headings. describing IEEE content. The scope of descriptors is based on the material presented in IEEE journals, conference Abbreviations used in the Thesaurus: papers, standards, and/or IEEE organizational material. A controlled BT - Broader term vocabulary is a specific terminology used in NT - Narrower term a consistent and controlled fashion that RT - Related term results in better information searching and USE- Use preferred term retrieval. UF - Used for Thesaurus construction is based on the ANSI/NISO Z39.19-2005(2010) standard, Guidelines for the Construction, Format, and Management of Monolingual Controlled Vocabulary. The Thesaurus vocabulary uses American-based spellings with cross references to British variant spellings. The scope and structure of the IEEE Thesaurus reflects the engineering and scientific disciplines that comprise the Societies, Councils, and Communities of the IEEE in *Refer to ANSI/NISO NISO Z39.19-2005 addition to the technologies IEEE serves.
    [Show full text]
  • The Ruby Programming Language... It's Really Fun and It Feels Good!
    The Ruby Programming Language... it's really fun and it feels good! Dr. John Pagonis Pragmaticomm Limited, Athens Ruby Meetup #9, March 31st 2012 twitter: @greekrubymeetup @johnpagonis 1 1 Menu Why I got into Ruby? In search of a better way to code Ruby in twenty minutes (or thereabouts:-)‏ Why we should all have a look at it? 2 2 Before we start… a word ! A reminder from Fred. P. Brooks ‘’ No Silver Bullet - essence and accidents of software engineering’’,1986 ! ! There is NO silver bullet! 3 3 My experience with Ruby (mostly First got involved in 'Skunkworks' while at Symbian :-)‏ Ported with Pragmaticomm the Ruby 1.9.0.0 and Ruby 1.9.1p1 VM and some extensions to Symbian OS v9.1 (for Nokia's Symbian Research dept.)‏ I've used it for mobile programming, text filtering, classification, Web apps, machine learning, database access and Genetic Algorithm related work 4 4 Lately in my life (does it look familiar to you?)‏ There is a a lot of stuff I need to automate There are a lot of stuff I want to develop There are a lot of platforms I need to be using I need to be more efficient when coding. I have realised that my time and memory is MUCH more expensive than my CPUs’ time and RAM. I haven’t been getting any younger I haven’t been getting much smarter :-)‏ I think faster than I code! I am running out of time…. 5 5 Consequently Life is too short, to not have fun… !! ! I have to cheat! !There must be a better way to program… there must be!! 6 6 There must be a better way to program… there must be!! ..to clarify that !There must be a much better
    [Show full text]
  • Metaprogramming Ruby
    Prepared exclusively for Shohei Tanaka What Readers Are Saying About Metaprogramming Ruby Reading this book was like diving into a new world of thinking. I tried a mix of Java and JRuby metaprogramming on a recent project. Using Java alone would now feel like entering a sword fight carrying only a banana, when my opponent is wielding a one-meter-long Samurai blade. Sebastian Hennebrüder Java Consultant and Trainer, laliluna.de This Ruby book fills a gap between language reference manuals and programming cookbooks. Not only does it explain various meta- programming facilities, but it also shows a pragmatic way of making software smaller and better. There’s a caveat, though; when the new knowledge sinks in, programming in more mainstream languages will start feeling like a chore. Jurek Husakowski Software Designer, Philips Applied Technologies Before this book, I’d never found a clear organization and explanation of concepts like the Ruby object model, closures, DSLs definition, and eigenclasses all spiced with real-life examples taken from the gems we usually use every day. This book is definitely worth reading. Carlo Pecchia Software Engineer I’ve had a lot of trouble finding a good way to pick up these meta- programming techniques, and this book is bar none the best way to do it. Paolo Perrotta makes it painless to learn Ruby’s most complex secrets and use them in practical applications. Chris Bunch Software Engineer Prepared exclusively for Shohei Tanaka Metaprogramming Ruby Program Like the Ruby Pros Paolo Perrotta The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas Prepared exclusively for Shohei Tanaka Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks.
    [Show full text]
  • Getting Started with Appium
    E-BOOK Getting Started With Appium RUBY EDITION 2018.1 LEARN MORE AT SAUCELABS.COM BY JONATHAN LIPPS TABLE OF CONTENTS 3 Preface 20 Chapter 4: Writing Your First Test 4 Chapter 1: Introduction 25 Chapter 5: Introduction to Page Objects 4 The Appium Vision 30 Chapter 6: Android Joins the Party 5 The Appium Drivers 35 Chapter 7: Running Local Tests With Rake 6 The Appium Clients 36 Chapter 8: Running Tests in the Sauce Labs Cloud 7 Chapter 2: Getting Set Up 40 Annotating Tests on Sauce 7 Assumed Knowledge 41 Chapter 9: Automating Test Runs with a CI Server 7 iOS-specific System Setup 41 Setting Up Jenkins 7 Android-Specific System Setup 42 Creating an Android Build 8 Appium Setup 44 Creating an iOS Build 10 Ruby Client Setup 44 Running on Sauce 10 Project Setup 45 Jenkins for Production 11 Known Working Versions 46 Chapter 10: Heading Out on Your Own 12 Chapter 3: Exploring Your App 46 Resources 12 Using the Appium Ruby Console 47 Support 17 Using the Appium Desktop Inspector PREFACE This little e-book will help you get started with Appium using the Ruby programming language. It is a complete revision from the ground up of an earlier guide written by Dave Haeffner, who along with Matthew Edwards deserves a lot of thanks for all the work put into the first edition. Appium is an open source project that is always changing, and guides like this one will never be accurate forever. When possible I will indicate which versions of various software are being used, which might help in ensuring reproducibility of the code samples used here.
    [Show full text]
  • Document Resume Ed 051 228 Te 002 435 Author Title Pub
    DOCUMENT RESUME ED 051 228 TE 002 435 AUTHOR Early, Margaret, Ed. TITLE Language Face to Face: Developing a Language Centered Curriculum at the Heman Street School. INSTITUTION Syracuse Univ., N. Y. Eeading and Language Arts Center. PUB DATE 71 GRANT OEG-0-9-420068-2173-721 NOTE 159p. EDRS PRICE EDRS Price MF-$0.65 HC-$6.58 DESCRIPTORS *Curriculum Development, Elementary School Teachers, *English Curriculum, Teacher Education, Teacher Educators ABSTRACT Five prospective elementary teachers and five prospective teacher trainers were i.ntroduced to the experience of initiating and developing a language-centered curriculum. A collection or articles, written by the doctoral and master's candidates in the program, represents significant aspects of their experience. The titles of the articles are the following: (1) "One Person's View of Language in the Elementary School," (2)"A Unit on Neighborhoods: Grade Two," (3) "Language Face to Face,"(4) "Introducing Individualized Reading in First Crade,"(5) "Introducing 'Free' Reading Perio6s,"(6) "Mini Courses: Evaluation of a Curricular Innovation at Heman Street School," (7) "Working on Writing,"(8) "Language Throughout the Integrated Day," (9;"learning Sight Words," (10) "Replication Study: Word Boundaries," (11) "'Action Research' on Spelling Methods in Grade Two," and (12) "Listening and Listening-Reading at Two Rates of Presentation by Fifth Grade Pupils." (CK) LANGUAGE FACE TO FACE DEVELOPING A LANGUAGE CENTERED CURRICULiti AT THE HBfAN STREET SGWL Edited uy Margaret Early Reading and Language Arts Center Syracuse Univr-rsity lLi 1 "PERMISS1.3 TO REPRODUCE THIS COPVRIGHTED MATERIAL HAS BUN GRANTED BY (1.Eitet-Yf$1447 READING* ithv 1.4',AGa AZirsetAlsiSigAevse TO ERIC AND ORGANIZATIONS OPERATING UNDER A61104E113 WIN THE U.S.
    [Show full text]
  • Licensing Information User Manual for Peoplesoft Campus Solutions 9.2 (Through Update Image 20)
    Licensing Information User Manual for PeopleSoft Campus Solutions 9.2 (through Update Image 20) April 2021 Licensing Information User Manual for PeopleSoft Campus Solutions 9.2 (through Update Image 20) Copyright © 1988, 2021, Oracle and/or its affiliates. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or “commercial computer software documentation” pursuant
    [Show full text]
  • Code Analysis of Hacking Team's Exploits
    Report submitted in Partial Fulfillment of the Course Offensive Technologies Università degli Studi di Trento Master of Science in Computer Science EIT Digital Master of Science in Security and Privacy https://securitylab.disi.unitn.it/doku.php?id=course_on_offensive_technolog ies Code analysis of Hacking Team’s exploits Amit Gupta Ali Davanian University of Trento, Italy Feb 20, 2016 1 Table of Contents Sl.No. Content Page Number 1 rcs-db-ext/Python and Ruby 3 2 core-win32 14 3 poc-x 20 4 References 25 2 1. rcs-db-ext/Python and Ruby Purpose of the code: The rcs-db-ext repository is the soul of the HackingTeam’s Remote Control System. This repository contains the binaries, huge libraries and third party libraries that form the foundation of the execution of application. The repository has four prime packages – Java, nsis, python and ruby. Like the names suggest, each of these packages have the contents based on the language of code. In this analysis report, the prime focus is laid on the python and the ruby packages only. The prime purpose of the code base is to support the functionalities of the RCS with the required library functions, 3rd Party libraries and compiled binaries. Additionally there are some libraries, which help the developer to set up the development environment and the play-environment to run the RCS. We analyzed the code repository and dig-in for portions of the code, which seem interesting to us. Initially we went through the RCS admin and service manuals [1] to understand the features of the RCS and develop a high level picture of the application.
    [Show full text]
  • Ecosystems in Github and a Method for Ecosystem Identification Using
    Ecosystems in GitHub and a Method for Ecosystem Identification using Reference Coupling Kelly Blincoe, Francis Harrison and Daniela Damian Software Engineering Global InterAction Lab University of Victoria Victoria, BC, Canada Email: [email protected], [email protected], [email protected] Abstract—Software projects are not developed in isolation. To identify technical dependencies, we turn to cross- Recent research has shifted to studying software ecosystems, references on GitHub, a social code hosting service. GitHub communities of projects that depend on each other and are encourages collaboration between users both within and across developed together. However, identifying technical dependencies at the ecosystem level can be challenging. In this paper, we projects through its transparent interface and built-in social 1 propose a new method, known as reference coupling, for detecting features. With GitHub Flavored Markdown , when a user technical dependencies between projects. The method establishes cross-references another repository in a pull request, issue or dependencies through user-specified cross-references between commit comment a link to the other repository is automati- projects. We use our method to identify ecosystems in GitHub- cally created. This introduces a way for developers to bring hosted projects, and we identify several characteristics of the identified ecosystems. We find that most ecosystems are centered awareness across repositories. In this paper, we investigate around one project and are interconnected with other ecosystems. whether these cross-references indicate a technical dependency The predominant type of ecosystems are those that develop between the two repositories by examining a set of these tools to support software development. We also found that the cross-references.
    [Show full text]
  • Reference Coupling: an Exploration of Inter-Project Technical Dependencies and Their Characteristics Within Large Software Ecosystems
    Reference Coupling: An Exploration of Inter-project Technical Dependencies and their Characteristics within Large Software Ecosystems Kelly Blincoea,∗, Francis Harrisonb, Navpreet Kaurb, Daniela Damianb aUniversity of Auckland, New Zealand bUniversity of Victoria, BC, Canada Abstract Context: Software projects often depend on other projects or are developed in tandem with other projects. Within such software ecosystems, knowledge of cross-project technical dependencies is important for 1) practitioners under- standing of the impact of their code change and coordination needs within the ecosystem and 2) researchers in exploring properties of software ecosystems based on these technical dependencies. However, identifying technical depen- dencies at the ecosystem level can be challenging. Objective: In this paper, we describe Reference Coupling, a new method that uses solely the information in developers online interactions to detect technical dependencies between projects. The method establishes dependencies through user-specified cross-references between projects. We then use the output of this method to explore the properties of large software ecosystems. Method: We validate our method on two datasets | one from open-source projects hosted on GitHub and one commercial dataset of IBM projects. We manually analyze the identified dependencies, categorize them, and compare them to dependencies specified by the development team. We examine the types of projects involved in the identified ecosystems, the structure of the iden- ∗Corresponding author Email addresses: [email protected] (Kelly Blincoe), [email protected] (Francis Harrison), [email protected] (Navpreet Kaur), [email protected] (Daniela Damian) Preprint submitted to Elsevier February 2, 2019 tified ecosystems, and how the ecosystems structure compares with the social behaviour of project contributors and owners.
    [Show full text]
  • Lecture 1 Introduction
    Lecture 1 Introduction 1 / 57 What is this course about? Ruby language web development using Ruby on Rails database design, API usage and integration, complex front-end design (UI/UX) popular software architecture patterns how the web works: internet's client-server model version control (Git) amongst other topics 2 / 57 What does this do? 3.times do print 'Hello, world!' end 3 / 57 Why Ruby? Optimized for programmer happiness Used for Ruby on Rails Very popular web framework 4 / 57 Course Policies 5 / 57 Prerequisites Currently taking CIS 120 or have already taken it (or instructor permission) Basic HTML/CSS knowledge Codecademy Mozilla Developer Network W3Schools Good to know: tag, basic syntax, important tags e.g. <h1> Let us know if you do not have the prerequisites or have any other concerns 6 / 57 CIS 196 Course Structure Lecture Topics: 3 weeks on Ruby programming language 6 weeks on Ruby on Rails web framework 3 weeks on miscellaneous topics 9 homework assignments 1 final project For more details, read the course syllabus 7 / 57 CIS 19x Course Schedule 3 shared lectures during semester 1/23: Command Line 1/30: git/github 2/6: HTML/CSS basics 8 / 57 Grading 70% - Homework 25% - Final Project 5% - In-class polls 9 / 57 Homework Due on Wednesdays at noon through GitHub Classroom 2 free late days to use on any assignment After, 20% will be deducted for each day late We give you all our automated tests Unlimited submissions Your latest submission will be used for grading 10 / 57 Homework Grading Correctness (15 pts) Full credit if you pass all our automated tests on Travis CI Style (5 pts) Full credit if you have no Rubocop offenses Best Practices (5 pts) TAs will manually grade your code to ensure the Ruby Way 11 / 57 Final Project Must be a web app built using Ruby on Rails Must be an idea approved by either of us ahead of time Milestones included to keep you on track Demo to both instructors during Reading Days.
    [Show full text]