AWS SDK for C++ Developer Guide

Total Page:16

File Type:pdf, Size:1020Kb

AWS SDK for C++ Developer Guide AWS SDK for C++ Developer Guide AWS SDK for C++: Developer Guide Copyright © 2020 Amazon Web Services, Inc. and/or its affiliates. All rights reserved. AWS SDK for C++ 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 C++ Developer Guide Table of Contents AWS SDK for C++ Developer Guide ..................................................................................................... 1 Additional Documentation and Resources ...................................................................................... 1 Getting Started .................................................................................................................................. 2 Setting Up the AWS SDK for C++ ................................................................................................ 2 Prerequisites ...................................................................................................................... 2 Getting the SDK Using NuGet with Visual C++ ....................................................................... 3 Getting the SDK Using Vcpkg with Visual C++ ........................................................................ 3 Building the SDK from Source ............................................................................................. 4 Providing AWS Credentials ......................................................................................................... 6 Using the AWS SDK for C++ ....................................................................................................... 6 Initializing and Shutting Down the SDK ................................................................................ 7 Setting SDK Options ........................................................................................................... 7 More Information ............................................................................................................... 8 Building Your Application with CMake ......................................................................................... 8 Setting Up a CMake Project ................................................................................................. 8 Setting CMAKE_PREFIX_PATH (Optional) ............................................................................... 9 Building with CMake ........................................................................................................... 9 Configuring the SDK ......................................................................................................................... 10 CMake Parameters ................................................................................................................... 10 General CMake Variables and Options ................................................................................. 10 Android CMake Variables and Options ................................................................................ 14 AWS Client Configuration ......................................................................................................... 16 Configuration Variables ..................................................................................................... 16 Overriding Your HTTP Client ..................................................................................................... 18 Controlling IOStreams Used by the HttpClient and the AWSClient .................................................. 18 SDK Metrics ............................................................................................................................ 19 Enable SDK Metrics for the AWS SDK for C++ ...................................................................... 19 Update a CloudWatch Agent .............................................................................................. 20 Disable SDK Metrics .......................................................................................................... 21 Definitions for SDK Metrics ................................................................................................ 21 Using the SDK ................................................................................................................................. 23 Service Client Classes ............................................................................................................... 23 Utility Modules ........................................................................................................................ 23 HTTP Stack ...................................................................................................................... 23 String Utils ...................................................................................................................... 23 Hashing Utils ................................................................................................................... 24 JSON Parser .................................................................................................................... 24 XML Parser ...................................................................................................................... 24 Memory Management ............................................................................................................... 24 Allocating and Deallocating Memory .................................................................................. 24 STL and AWS Strings and Vectors ...................................................................................... 25 Remaining Issues .............................................................................................................. 26 Native SDK Developers and Memory Controls ...................................................................... 26 Logging ................................................................................................................................... 27 Error Handling ......................................................................................................................... 27 Code Examples ................................................................................................................................ 29 Amazon CloudWatch Examples .................................................................................................. 29 Getting Metrics from CloudWatch ..................................................................................... 30 Publishing Custom Metric Data ......................................................................................... 31 Working with CloudWatch Alarms ..................................................................................... 32 Using Alarm Actions in CloudWatch ................................................................................... 35 Sending Events to CloudWatch ......................................................................................... 37 Amazon DynamoDB Examples .................................................................................................... 40 Working with Tables in DynamoDB .................................................................................... 40 iii AWS SDK for C++ Developer Guide Working with Items in DynamoDB ..................................................................................... 45 Amazon EC2 Examples .............................................................................................................. 48 Managing Amazon EC2 Instances ...................................................................................... 49 Using Elastic IP Addresses in Amazon EC2 .......................................................................... 55 Using Regions and Availability Zones for Amazon EC2 .......................................................... 58 Working with Amazon EC2 Key Pairs ................................................................................. 60 Working with Security Groups in Amazon EC2 ..................................................................... 62 AWS Identity and Access Management (IAM) Examples .................................................................. 65 Managing IAM Access Keys ............................................................................................... 66 Managing IAM Users ........................................................................................................ 70 Using IAM Account Aliases ................................................................................................ 73 Working with IAM Policies ................................................................................................ 76 Working with IAM Server Certificates ................................................................................. 81 Amazon S3 Examples ................................................................................................................ 85 Creating, Listing, and Deleting Buckets .............................................................................. 85 Operations on Objects ....................................................................................................
Recommended publications
  • Use of Microsoft Visual Studio Express Edition and Directx to Simulate Movements of a Colony of Penguins That Must Be Tagged for a Science Mission Education
    Use of Microsoft Visual Studio Express Edition and DirectX to Simulate Movements of a Colony of Penguins that must be tagged for a Science Mission Education Sandy Harrison (WSSU), Tushar Majithia (Mentor), Spencer Weeks- Jamieson, Jasmin Rivers (ECSU), Terrance Mason (MVSU), Dr. Arvin Agah (Mentor) (KU) igloos to the snow, the game itself displays a Abstract- type of climate that some penguins live in. In developing this game, the team is specifying, Students begin to take a general interest designing, implementing, and testing the in becoming scientists or engineers at early stages software. Some of the programs that the team in their life, such as the middle school level. It is utilized were C++, VC++ Express 2005 Edition imperative that they are targeted at this point in compiler, and Microsoft Platform SDK their lives to be encouraged to pursue their (Software Development Kit). This project education in science, technology, engineering, and mathematics (STEM) fields. The dilemma is how consisted of upgrading a previously developed to get young scholars interested in STEM areas? game. While using C++ in the aspect of Our proposed tool is an educational and programming, we modified the previous entertaining video game, as a vast number of young program's features with realistic graphics. This students tend to play video games everyday. Our modification would enrich it with a realistic goal is to combine education and fun into a game in perspective that would better serve our primary order to teach the players about polar research. objective. To validate if middle school students The objective of this URE Summer project is to would enjoy this game, we used the 2007 enhance an existing video game to educate young CReSIS Middle School Program students as students on the Polar Regions including challenges that scientists face.
    [Show full text]
  • Crypto Ransomware Analysis and Detection Using
    CRYPTO RANSOMWARE ANALYSIS AND DETECTION USING PROCESS MONITOR by ASHWINI BALKRUSHNA KARDILE Presented to the Faculty of the Graduate School of The University of Texas at Arlington in Partial Fulfillment of the Requirements for the Degree of MASTER OF SCIENCE IN COMPUTER SCIENCE THE UNIVERSITY OF TEXAS AT ARLINGTON December 2017 Copyright © by Ashwini Balkrushna Kardile 2017 All Rights Reserved ii Acknowledgements I would like to thank Dr. Ming for his timely guidance and motivation. His insights for this research were valuable. I would also like to thank my committee members Dr. David Levine and Dr. David Kung for taking out time from their schedule and attending my dissertation. I am grateful to John Podolanko; it would not have been possible without his help and support. Thank you, John, for helping me and foster my confidence. I would like to thank my colleagues for supporting me directly or indirectly. Last but not the least; I would like to thank my parents, my family and my friends for encouraging me and supporting me throughout my research. November 16, 2017 iii Abstract CRYPTO RANSOMWARE ANALYSIS AND DETECTION USING PROCESS MONITOR Ashwini Balkrushna Kardile, MS The University of Texas at Arlington, 2017 Supervising Professor: Jiang Ming Ransomware is a faster growing threat that encrypts user’s files and locks the computer and holds the key required to decrypt the files for ransom. Over the past few years, the impact of ransomware has increased exponentially. There have been several reported high profile ransomware attacks, such as CryptoLocker, CryptoWall, WannaCry, Petya and Bad Rabbit which have collectively cost individuals and companies well over a billion dollars according to FBI.
    [Show full text]
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Thriving in a Crowded and Changing World: C++ 2006–2020
    Thriving in a Crowded and Changing World: C++ 2006–2020 BJARNE STROUSTRUP, Morgan Stanley and Columbia University, USA Shepherd: Yannis Smaragdakis, University of Athens, Greece By 2006, C++ had been in widespread industrial use for 20 years. It contained parts that had survived unchanged since introduced into C in the early 1970s as well as features that were novel in the early 2000s. From 2006 to 2020, the C++ developer community grew from about 3 million to about 4.5 million. It was a period where new programming models emerged, hardware architectures evolved, new application domains gained massive importance, and quite a few well-financed and professionally marketed languages fought for dominance. How did C++ ś an older language without serious commercial backing ś manage to thrive in the face of all that? This paper focuses on the major changes to the ISO C++ standard for the 2011, 2014, 2017, and 2020 revisions. The standard library is about 3/4 of the C++20 standard, but this paper’s primary focus is on language features and the programming techniques they support. The paper contains long lists of features documenting the growth of C++. Significant technical points are discussed and illustrated with short code fragments. In addition, it presents some failed proposals and the discussions that led to their failure. It offers a perspective on the bewildering flow of facts and features across the years. The emphasis is on the ideas, people, and processes that shaped the language. Themes include efforts to preserve the essence of C++ through evolutionary changes, to simplify itsuse,to improve support for generic programming, to better support compile-time programming, to extend support for concurrency and parallel programming, and to maintain stable support for decades’ old code.
    [Show full text]
  • Cornell CS6480 Lecture 3 Dafny Robbert Van Renesse Review All States
    Cornell CS6480 Lecture 3 Dafny Robbert van Renesse Review All states Reachable Ini2al states states Target states Review • Behavior: infinite sequence of states • Specificaon: characterizes all possible/desired behaviors • Consists of conjunc2on of • State predicate for the inial states • Acon predicate characterizing steps • Fairness formula for liveness • TLA+ formulas are temporal formulas invariant to stuering • Allows TLA+ specs to be part of an overall system Introduction to Dafny What’s Dafny? • An imperave programming language • A (mostly funconal) specificaon language • A compiler • A verifier Dafny programs rule out • Run2me errors: • Divide by zero • Array index out of bounds • Null reference • Infinite loops or recursion • Implementa2ons that do not sa2sfy the specifica2ons • But it’s up to you to get the laFer correct Example 1a: Abs() method Abs(x: int) returns (x': int) ensures x' >= 0 { x' := if x < 0 then -x else x; } method Main() { var x := Abs(-3); assert x >= 0; print x, "\n"; } Example 1b: Abs() method Abs(x: int) returns (x': int) ensures x' >= 0 { x' := 10; } method Main() { var x := Abs(-3); assert x >= 0; print x, "\n"; } Example 1c: Abs() method Abs(x: int) returns (x': int) ensures x' >= 0 ensures if x < 0 then x' == -x else x' == x { x' := 10; } method Main() { var x := Abs(-3); print x, "\n"; } Example 1d: Abs() method Abs(x: int) returns (x': int) ensures x' >= 0 ensures if x < 0 then x' == -x else x' == x { if x < 0 { x' := -x; } else { x' := x; } } Example 1e: Abs() method Abs(x: int) returns (x': int) ensures
    [Show full text]
  • Create Mobile Apps with HTML5, Javascript and Visual Studio
    Create mobile apps with HTML5, JavaScript and Visual Studio DevExtreme Mobile is a single page application (SPA) framework for your next Windows Phone, iOS and Android application, ready for online publication or packaged as a store-ready native app using Apache Cordova (PhoneGap). With DevExtreme, you can target today’s most popular mobile devices with a single codebase and create interactive solutions that will amaze. Get started today… ・ Leverage your existing Visual Studio expertise. ・ Build a real app, not just a web page. ・ Deliver a native UI and experience on all supported devices. ・ Use over 30 built-in touch optimized widgets. Learn more and download your free trial devexpress.com/mobile All trademarks or registered trademarks are property of their respective owners. Untitled-4 1 10/2/13 11:58 AM APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE INSIDE Choose a Cloud Network for Government-Compliant magazine Applications Geo-Visualization of SPECIAL GOVERNMENT ISSUE & DEVELOPMENT SPECIAL GOVERNMENT ISSUE APPLICATIONS Government Data Sources Harness Open Data with CKAN, OData and Windows Azure Engage Communities with Open311 THE DIGITAL GOVERNMENT ISSUE Inside the tools, technologies and APIs that are changing the way government interacts with citizens. PLUS SPECIAL GOVERNMENT ISSUE APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE & DEVELOPMENT SPECIAL GOVERNMENT ISSUE APPLICATIONS Enhance Services with Windows Phone 8 Wallet and NFC Leverage Web Assets as Data Sources for Apps APPLICATIONS & DEVELOPMENT SPECIAL GOVERNMENT ISSUE ISSUE GOVERNMENT SPECIAL DEVELOPMENT & APPLICATIONS Untitled-1 1 10/4/13 11:40 AM CONTENTS OCTOBER 2013/SPECIAL GOVERNMENT ISSUE OCTOBER 2013/SPECIAL GOVERNMENT ISSUE magazine FEATURES MOHAMMAD AL-SABT Editorial Director/[email protected] Geo-Visualization of Government KENT SHARKEY Site Manager Data Sources MICHAEL DESMOND Editor in Chief/[email protected] Malcolm Hyson ..........................................
    [Show full text]
  • Python for the C# Developer
    {SDD} 2014 Software Design & Development Python for the C# developer Michael Kennedy @mkennedy http://blog.michaelckennedy.net Objectives • Introduce the basics of the Python language • Review what is awesome about C# and .NET • Explore Python's version of each C# / .NET feature DEVELOPMENTOR Michael Kennedy | @mkennedy | blog.michaelckennedy.net What is Python? • High-level programming language • Interpreted (sometimes JIT compiled) • Object-oriented (especially Python 3) • Strongly-typed with dynamic semantics • Syntax emphasizes readability • Supports modules and packages • Batteries included (large standard library [1]) DEVELOPMENTOR Michael Kennedy | @mkennedy | blog.michaelckennedy.net The ‘shape’ of a Python program • Python defines code blocks (known as suites in Python) using whitespace and colons. Things to note: def somemethod(name): • No semicolons if name == "Michael": print("Hi old friend") • Code blocks start with ‘:’ else: • Whitespace really really matters print("Nice to meet you") • There are no braces print("My name is … ") • There are no parentheses • Tabs are not your friend def main(): somemethod() Code suites DEVELOPMENTOR Michael Kennedy | @mkennedy | blog.michaelckennedy.net Python language demo DEVELOPMENTOR Michael Kennedy | @mkennedy | blog.michaelckennedy.net What's awesome about C# and .NET? System.Object: Everything is an object. LINQ IEnumerable + foreach loops Visual Studio / IDEs Class properties ( int Age {get; set;} ) Side-by-side execution (isolation) Anonymous types Iterator methods / yield return
    [Show full text]
  • Vcpkg, Un Outil Pour Acquérir Et Compiler Plus Simplement Les Librairies Open Source C++ Sur Windows
    043_044_204 24/01/17 21:59 Page43 microsoft 43 # 204 Vcpkg, un outil pour acquérir et compiler plus simplement les librairies open source C++ sur Windows. Eric Mittelette Acquérir une librairie open source, la compiler sur Windows et l’intégrer dans son Microsoft Corp. projet C++ reste une opération délicate, voire une galère. Pour une librairie donnée, il faut trouver les sources, les installer localement, compiler la librairie et enfin la mettre à disposition du projet dans lequel vous souhaitez l’utiliser. a phase de build est de loin la plus subtile et complexe, elle nécessi- source de la librairie. Nous voulions que cette collection de « port files » te souvent un peu d’adaptation (patch) si la librairie n’est pas encore soit open source et que la communauté des développeurs C++ puisse y Ldisponible pour la version de compilateur que vous utilisez, cette contribuer en ajoutant les librairies qu’ils maintiennent ou utilisent. adaptation nécessite encore l’usage d’incantations (sous forme de scripts, L’architecture générale en découle assez naturellement : pas de magie noire…), que seuls les grands « faiseurs » maîtrisent réelle- • Créer une liste de « port file » dans un repo Github ; ment. Nous savons par sondage et les appels au support technique de • Créer un outil en ligne de commande qui exploite cette liste et capable Microsoft que les librairies tierces restent pour plus de 30% des cas le blo- de lancer le processus de compilation au regard des instructions de queur a la migration vers les dernières versions du compilateur C++. Nous chaque « port file » ; savons également que 80% des projets C++ utilisent 2 ou 3 librairies • Installer le résultat de la compilation dans un répertoire local « « LibFolder » ; tierces en moyenne, et que la vaste majorité d’entre elles sont aujourd’hui • Permettre une intégration simple avec Visual studio, CMake ou tout des librairies open source.
    [Show full text]
  • Development Environment
    BLUESPAWN BLUESPAWN Dev Team Apr 28, 2021 CONTENTS 1 Our Mission 3 2 What is BLUESPAWN 5 3 Get Involved & Contribute to the project7 4 Why we made BLUESPAWN9 4.1 Contact Us................................................9 4.2 Sponsoring................................................9 4.3 Licensing.................................................9 4.4 Project Authors.............................................. 10 4.5 Publications............................................... 11 4.6 Hunts................................................... 11 4.7 Scan Mode................................................ 11 4.8 Mitigations................................................ 11 4.9 Reactions................................................. 11 4.10 Logging and Output........................................... 11 4.11 Agent7 Integration............................................ 11 4.12 Getting Started.............................................. 11 4.13 Examples of BLUESPWAN in Action.................................. 13 4.14 Using Mitigations............................................ 14 4.15 Getting Involved............................................. 18 4.16 Setting up your Development Environment............................... 18 4.17 Software Architecture Info........................................ 19 4.18 Project Roadmap............................................. 21 i ii BLUESPAWN CONTENTS 1 BLUESPAWN 2 CONTENTS CHAPTER ONE OUR MISSION BLUESPAWN helps blue teams monitor systems in real-time against active attackers by detecting
    [Show full text]
  • Designing Microsoft ASP.NET Applications by Douglas J
    Designing Microsoft ASP.NET Applications by Douglas J. Reilly ISBN: 0735613486 Microsoft Press © 2002 (402 pages) Move beyond simple ASP scripting --and learn how to build sophisticated Web applicatons with ASP.NET. Companion Web Site Table of Contents Designing Microsoft ASP.NET Applications Acknowledgments Introduction Chapter 1 - Introduction to ASP.NET Development Chapter 2 - Managed Code and the Common Language Runtime Chapter 3 - The .NET Framework Objects and Languages Chapter 4 - ASP.NET Development 101 Chapter 5 - Web Forms Chapter 6 - Creating ASP.NET Components Chapter 7 - Balancing Server and Client Functionality Chapter 8 - Time to Get the Data Chapter 9 - Data and ASP.NET Forms Chapter 10 - XML Web Services Appendix A - Configuring ASP.NET Applications in IIS Appendix B - What You Need to Know About HTML to Use This Book Index List of Figures List of Tables List of Listings List of Sidebars Designing Microsoft ASP.NET Applications Douglas J. Reilly PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2002 by Douglas J. Reilly All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Cataloging-in-Publication Data Reilly, Douglas J. Designing Microsoft ASP.NET Applications / Douglas J. Reilly. p. cm. Includes index. ISBN 0-7356-1348-6 1. Internet programming. 2. Active server pages. 3. Web servers. I. Title. QA76.625 .R45 2001 005.2’76—dc21 2001051310 Printed and bound in the United States of America.
    [Show full text]
  • Введение В Silverlight 3
    2 Здравствуйте, дорогой читатель! Мы очень рады продолжить добрую традицию и представить Вам первую книгу о технологии Microsoft Silverlight 3 на русском языке! Microsoft Silverlight позволяет разработчикам с помощью простых и мощных инструментов создавать интерактивные Интернет- приложения, которые становятся все популярнее среди широкого круга пользователей. Данная технология уже используется на многих известных ресурсах – как в мире, так и в России. Silverlight 3 – важный шаг в развитии технологии. Среди новых возможностей можно отметить 3D-трансформации, аппаратное ускорение, работа вне браузера и много другое. Уже более трети Интернет-устройств в мире имеют установленный Silverlight. Принимая во внимание текущую динамику, можно с уверенностью сказать, что данная технология будет и дальше распространяться среди пользователей во всем мире, и Россия здесь не исключение. Менее года назад мы выпустили электронную книгу «Введение в Microsoft Silverlight 2», за это время ее загрузило более 30000 читателей. Для перевода книги по Silverlight 3 мы вновь выбрали издание Лоуренса Морони, основываясь на положительных отзывах от Вас, российских разработчиков, и на международном опыте. Книга представляет комплексный обзор Silverlight 3, который будет интересен как тем, кто уже имеет опыт работы с прошлыми версиями данной технологии, так и для начинающих свой путь в мир Silverlight. В завершение хочу поблагодарить Вас за интерес к технологии Microsoft Silverlight и предлагаю окунуться в увлекательный мир интерактивности. Дмитрий Халин, Директор департамента стратегических технологий Майкрософт Россия 3 ОПУБЛИКОВАНО Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2009 by Laurence Moroney Все права защищены. Ни одна часть данной книги не может быть воспроизведена в любой форме или любыми средствами без письменного разрешения издателя.
    [Show full text]
  • Creating a Web Site with Expression Web
    05_115091 ch01.qxp 3/2/07 9:23 PM Page 7 Chapter 1 Creating a Web Site with Expression Web In This Chapter ᮣ Starting Expression Web for the first time ᮣ Exploring the workspace ᮣ Creating and saving a new Web site ᮣ Using a template to create a new Web site ᮣ Opening, closing, and deleting Web sites ᮣ Adding existing files to a Web site ᮣ Closing Expression Web n this chapter, you get started with Expression Web: You get familiar with Ithe workspace and find out how to create and save Web sites. Before you hang your shingle as a Web publisher, though, you should understand what you’re really doing when you create and publish a Web site. No doubt you’ve already seen a Web site. Web sites are the places you visit as you make your way around the World Wide Web. In the same way as a book is made up of individual pages, a Web site is made up of individual files called Web pages. Web pages contain the text, pictures, and other content you see when you visit a Web site. As you constructCOPYRIGHTED a Web site, you create WebMATERIAL pages and then string the pages together by using hyperlinks. Hyperlinks are the highlighted words and pic- tures inside the page that visitors can click to jump to a different location, page, or Web site. Hyperlinks can also initiate a download or pop open an e-mail window. After your site is complete, you publish it. In other words, you make the site visible to the rest of the world on the World Wide Web (or, if you’re working on an internal company site, on the company’s intranet).
    [Show full text]