Amazon AWS SDK Guía de usuario

Busca en linea o descarga Guía de usuario para Software Amazon AWS SDK. Amazon AWS SDK User guide Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 71
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 0
AWS SDK for .NET
Developer Guide
Version v2.0.0
Vista de pagina 0
1 2 3 4 5 6 ... 70 71

Indice de contenidos

Pagina 1 - AWS SDK for .NET

AWS SDK for .NETDeveloper GuideVersion v2.0.0

Pagina 2

To create a new AWS Management Console project1. In Visual Studio, on the File menu, select New, and then click Project to open the New Projectdialog

Pagina 3 - Table of Contents

</appSettings></configuration>The Toolkit for Visual Studio adds two key-value pairs to appSettings, based on the values youspecified

Pagina 4 - Version v2.0.0

Programming with the AWS SDKfor .NETThis section provides general programming techniques and information for developing software with theAWS SDK for .

Pagina 5 - AWS SDK for .NET Developer

You can also configure an SDK for .NET application programmatically, by setting property values in theAWSConfigs class. The following example specifie

Pagina 6 - About Amazon Web Services

Topics• Using the SDK Store (p. 10)• Using a Credentials File (p. 10)• Using Credentials in an Application (p. 11)Using the SDK StoreThe preferred way

Pagina 7 - AWS Account and Credentials

[profile_name]aws_access_key_id = accessKeyaws_secret_access_key = secretKeyA profile can optionally include a session token. For more information, se

Pagina 8 - .NET Development Environment

<configuration> <appSettings> <add key="AWSProfileName" value="development"/> </appSettings></conf

Pagina 9 - Starting a New Project

AmazonS3Config config = new AmazonS3Config();config.ProxyCredentials = new NetworkCredential("foo", "bar");Earlier versions of the

Pagina 10

You can set multiple values at once, separated by commas. To set both log4net andSystem.Diagnostics logging in the .config file, use:<add key="

Pagina 11

To set service logging with the SDK for .NET API, set the AWSConfigs.ResponseLogging propertyto one of the values of the ResponseLoggingOption enumera

Pagina 12 - Programming with the AWS SDK

AWS SDK for .NET: Developer GuideCopyright © 2014 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.All trademarks not owned by Ama

Pagina 13 - Configuring AWS Credentials

By default, this setting is false, though Signature Version 4 may be used by default in some casesor with some regions. When the setting is true, Sign

Pagina 14 - Using a Credentials File

Asynchronous API for .NET 4.5, Windows Store,and Windows Phone 8The AWS SDK for .NET uses the new task-based asynchronous pattern for .NET 4.5, Window

Pagina 15 - Specifying a Profile

void Callback(IAsyncResult asyncResult)Object stateThe third parameter, state, is a user-defined object that is made available to the callback functio

Pagina 16 - Using Proxy Credentials

No Callback SpecifiedThe following example code calls BeginPutObject, performs some work, then calls EndPutObject toretrieve the service response.The

Pagina 17

}}The following line of code calls BeginPutObject and specifies the preceding callback function.Whenthe PutObject operation completes, the callback

Pagina 18

called. The callback function uses the Amazon S3 client object to call the EndPutObject method toretrieve the server response.The callback also extrac

Pagina 19

{ Console.WriteLine("Finished PutObject operation with simple callback"); Console.Write("\n\n"); }

Pagina 20 - AWS Region Selection

// Create a PutObject request // // You will need to change the BucketName below in order to run this // sample code.

Pagina 21 - Asynchronous API for .NET 3.5

See Also• Getting Started (p. 3)• Programming with the AWS SDK for .NET (p. 8)Migrating Your Code to the Latest Version of theAWS SDK for .NETThis gui

Pagina 22 - Examples

• The version 2 runtime for .NET 3.5 is similar to the existing version 1 runtime, which is based on theSystem.Net.HttpWebRequest class and uses the B

Pagina 23 - Callback with Client

Table of ContentsAWS SDK for .NET Developer Guide ... 1Ho

Pagina 24 - Callback with State Object

• All client interfaces have been renamed to follow the .NET convention of starting with the letter "I". Forexample, the AmazonEC2 class is

Pagina 25 - Complete Sample

• The GenerateMD5 property has been removed from PutObjectRequest and UploadPartRequestbecause this is now automatically computed as the object is bei

Pagina 26

Refer to the return value type of the Create* method for the service client that you're using to see whatvalues are returned. These are all liste

Pagina 27

This version of the SDK for .NET supports only the following services.This is the same set of servicesas those supported in the AWS SDK for Android an

Pagina 28

From the Manage NuGet Packages dialog box, select Online in the left pane.You can then search forthe package that you want to install using the search

Pagina 29 - Breaking Changes

AWS SDK for .NET Tutorials andExamplesThis chapter provides tutorials, walkthroughs, and examples of programming Amazon Web Services withthe AWS SDK f

Pagina 30 - Amazon S3

numbers of instances. It also doesn't work well for instances that are created by AWS on behalf of thecustomer, such as Spot Instances or instanc

Pagina 31 - Response and Result Classes

Walkthrough: Using IAM Roles to Retrieve anAmazon S3 Object from an Amazon EC2 InstanceIn this walkthrough, we consider a program that retrieves an ob

Pagina 32 - AWS SDK for Windows Phone 8

} FileStream s = new FileStream( "s3Object.txt", FileMode.Create ); StreamWriter writer = new StreamWriter( s );

Pagina 33 - NuGet from Solution Explorer

3. Edit the Source File to Remove the Credentials4. Transfer the Compiled Program to Your Amazon EC2 Instance5. Run the ProgramCreate the RoleThe firs

Pagina 34 - NuGet Package Manager Console

Conclusion ... 60Creating and Using an A

Pagina 35

your Amazon EC2 instance. When you create the Amazon EC2 instance, specify the IAM role that youcreated previously in the IAM console.When you create

Pagina 36 - Manage Your Credentials

using (GetObjectResponse response = client.GetObject(request)) { using (Stream responseStream = response.ResponseStream) {

Pagina 37

You should configure your Remote Desktop session so that you can access your local drives from theAmazon EC2 instance. If you use the shortcut provide

Pagina 38 - Instances

Run the ProgramRun the program. Ensure that the AWS assembly is either in the same directory as the program or thatyou have installed it in the Genera

Pagina 39 - Create the Role

Create the ASP.NET_SessionState TableWhen your application starts, it looks for an Amazon DynamoDB table named, by default,ASP.NET_SessionState. We re

Pagina 40

Configure the Session State ProviderTo configure an ASP.NET application to use DynamoDB as the session state server1. Add references to both AWSSDK.dl

Pagina 41

RegionRequired string attribute.The AWS region in which to use Amazon DynamoDB. For a list of availableAWS regions, go to the Regions and Endpoints do

Pagina 42

Tutorial: Creating Amazon EC2 Instances withthe AWS SDK for .NETThis topic demonstrates how to use the AWS SDK for .NET to create, start, and terminat

Pagina 43 - DynamoDB

var ec2Client = new AmazonEC2Client(RegionEndpoint.USEast1);The client object's permissions are determined by the policy that is attached to the

Pagina 44

To enumerate existing security groups1. Obtain a list of your account's security groups.DescribeSecurityGroupsRequest secGroupRequest = new Des

Pagina 45 - Web.config Options

AWS SDK for .NET DeveloperGuideThe AWS SDK for .NET is a single downloadable package that includes Visual Studio project templates,the AWS .NET librar

Pagina 46 - Security Considerations

CreateSecurityGroupResponse newGroupResponse = ec2Client.CreateSecurityGroup(newGroupRequest);Pass the request object to the Amazon EC2 client'

Pagina 47 - Create an Amazon EC2 Client

• Set the GroupName property to the security group name of.• Add the IpPermissionSpecification object from Step 1 to the group's IpPermissions co

Pagina 48 - Important

DescribeKeyPairsRequest keyPairDescriptionRequest = new DescribeKeyPairsRequest();DescribeKeyPairsResponse keyPairDescriptionResponse = ec2Client.

Pagina 49

var runInstancesRequest = new RunInstancesRequest(){ ImageId = "ami-62c44d52", InstanceType = "m1.small", MinCount = 1, MaxCou

Pagina 50

RunInstancesResponse runResponse = ec2Client.RunInstances(runInstances Request);3. You can use the returned RunInstancesResponse object to get a list

Pagina 51

The DescribeInstancesResponse object's DescribeInstancesResult.Reservations propertycontains a list of reservations. In this case, there is only

Pagina 52 - Launch Amazon EC2 Instances

DescriptionResourceSample code, documentation, tools, and additional resourcesto help you build applications on Amazon Web Services.Windows & .NET

Pagina 53

PrerequisitesThis tutorial assumes that you have signed up for AWS, set up your .NET development environment, andinstalled the AWS SDK for .NET. If yo

Pagina 54 - To check EC2 status

10 } catch (AmazonEC2Exception ae) { if (string.Equals(ae.ErrorCode, "InvalidGroup.Duplicate", StringCompar ison.InvariantCult

Pagina 55 - To terminate EC2 instances

throw; 15 } }You can also create the security group using the AWS Toolkit for Visual Studio. Go to the toolkitdocumentation for mor

Pagina 56 - Overview

Programming with the AWS SDK for .NET (p. 8)The basics of how to implement applications with the SDK for .NET that applies to all AWS services.This ch

Pagina 57 - Prerequisites

There are many ways to approach bidding for Spot instances. To get a broad overview of the variousapproaches, you should view the Bidding for Spot Ins

Pagina 58

be fulfilled.You can determine the types of available instances and the On-Demand prices for instancesby going to Amazon EC2 Pricing page.To request a

Pagina 59

SpotInstancesResult.SpotInstanceRequest) { describeRequest.SpotInstanceRequestId.Add(spotInstanceRequest.SpotIn stanceRequestId); 10 } 1 /

Pagina 60

Console.WriteLine(e.Message); } 50 if (anyOpen) { // Wait for the requests to go active.

Pagina 61

To terminate any outstanding instances, we use the instanceIds array, which we populated with theinstance IDs of those instances that transitioned to

Pagina 62

Create an Amazon SQS ClientYou will need an Amazon SQS client in order to create and use an Amazon SQS queue. Before configuringyour client, you shoul

Pagina 63

To create an Amazon SQS queue1. Create and initialize a CreateQueueRequest instance. Provide the name of your queue and specifya visibility timeout f

Pagina 64 - Conclusion

ImportantDue to the distributed nature of the queue, Amazon SQS cannot guarantee you will receivemessages in the exact order they are sent. If you req

Pagina 65 - Create an Amazon SQS Queue

ReceiveMessageResponse receiveMessageResponse = amazonSQSClient.ReceiveMessage(receiveMessageRequest);The method returns a ReceiveMessageResponse

Pagina 66 - Send an Amazon SQS Message

DeleteMessageResponse response = amazonSQSClient.DeleteMessage(deleteMessageRequest);Calling DeleteMessage unconditionally removes the message fro

Pagina 67

Getting Started with the AWS SDKfor .NETTo get started with the AWS SDK for .NET, set up the following:• AWS Account and Credentials• .NET Development

Pagina 68

Additional ResourcesHome Page for AWS SDK for .NETFor more information about the AWS SDK for .NET, go to the home page for the SDK athttp://amazonaws.

Pagina 69 - Related Resources

Document HistoryThe following table describes the important changes since the last release of the AWS SDK for .NETDeveloper Guide.Last documentation u

Pagina 70 - Additional Resources

inserted at build time. This approach ensures that your credentials are not unintentionally exposed withyour project on a public site. For more inform

Pagina 71 - Document History

To install the SDK for .NET1. Go to http://amazonaws.cn/sdkfornet.2. Click the Download button in the upper right corner of the page.Your browser will

Comentarios a estos manuales

Sin comentarios