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
    / 73
  • 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 ... 72 73

Indice de contenidos

Pagina 1 - AWS SDK for .NET

AWS SDK for .NETDeveloper GuideVersion v2.0.0

Pagina 2

3. Use the AWS Access Credentials dialog box to configure your application.• Specify which account profile your code should use to access AWS.To use a

Pagina 3 - Table of Contents

For more information about configuring an AWS application, see Configuring Your AWS SDK for .NETApplication (p. 8).Version v2.0.07AWS SDK for .NET Dev

Pagina 4

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 - To sign up for an AWS account

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

Pagina 8 - Install the AWS SDK for .NET

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

Pagina 9 - Start 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 and System.Dia-gnostics logging in the .config file, use:<add key=&qu

Pagina 11 - Application (p. 8)

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.The following are trademarks of

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

callback function uses the Amazon S3 client object to call the EndPutObject method to retrieve theserver response. The callback also extracts the star

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 UploadPartRequest becausethis 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

NuGet from Solution ExplorerTo use NuGet from Solution Explorer, right-click on your project and select Manage NuGet Packages...from the context menu.

Pagina 29 - Breaking Changes

Install-Package AWSSDK -Version 1.5.1.0The NuGet website provides a page for every package that is available through NuGet such as theAWSSDK and AWS.E

Pagina 30 - Amazon S3

AWS SDK for .NET Tutorials andExamplesThe following tutorials and examples demonstrate how to use the AWS SDK for .NET to access AmazonWeb Services.Be

Pagina 31 - Response and Result Classes

The AWS SDK for .NET includes AWS.SessionProvider.dll, which contains an ASP.NET sessionstate provider. Also included is the AmazonDynamoDBSessionProv

Pagina 32 - AWS SDK for Windows Phone 8

NoteIf you decide not to create the table beforehand, the session state provider will create the tablefor you during its initialization. See the web.c

Pagina 33 - Installation

AWSSecretKeySecret key to use.This can be set either in the providers section or in the appSettings section.We recommend not using this setting. Inste

Pagina 34 - NuGet Package Manager Console

Creating and Using an Amazon SQS Queue ... 58Create an Amazon SQS Client ...

Pagina 35 - Version v2.0.0

"Resource" : "arn:aws:dynamodb:us-east-1:<YOUR-AWS-ACCOUNT-ID>:table/ASP.NET_SessionState" } ]}Tutorial: Creating

Pagina 36

Create a Security Group Using the SDK for .NETCreate a security group, which acts as a virtual firewall that controls the network traffic for one or m

Pagina 37

{ Name = "vpc-id", Values = new List<string>() {vpcID}};var dsgRequest = new DescribeSecurityGroupsRequest();dsgRequest.Filters.

Pagina 38 - Web.config Options

The CreateSecurityGroup method returns a CreateSecurityGroupResponse object.You can get the IDof the new security group from the response and then us

Pagina 39 - Security Considerations

FromPort and ToPortThe beginning and end of the port range.This example specifies a single port, 3389, which isused to communicate with Windows over R

Pagina 40

foreach (KeyPairInfo item in myKeyPairs){ Console.WriteLine("Existing key pair: " + item.KeyName); if (item.KeyName == keyPairName)

Pagina 41

• Checking the State of Your Instance (p. 46)• Connecting to Your Running Instance (p. 46)Launching an EC2 InstanceYou launch an instance in either EC

Pagina 42 - Creating a Security Group

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ &qu

Pagina 43

{ DeviceIndex = 0, SubnetId = subnetID, Groups = groups, AssociatePublicIpAddress = true};List<InstanceNetworkInterfaceSpecification>

Pagina 44 - Enumerating Your Key Pairs

3. (Optional) To launch the instance with an IAM role (p. 47), specify an IAM instance profile in theRunInstancesRequest.Note that an IAM user can&apo

Pagina 45

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 - Launching an EC2 Instance

Checking the State of Your InstanceUse the following procedure to get the current state of your instance. Initially, your instance is in thepending st

Pagina 47

var deleteRequest = new TerminateInstancesRequest(){ InstanceIds = instanceIds};var deleteResponse = ec2Client.TerminateInstances(deleteRequest);fo

Pagina 48

The following walkthrough uses a sample program that retrieves an object from Amazon S3 using theAWS credentials that you've configured. Next, we

Pagina 49

responseBody = reader.ReadToEnd(); } } using (FileStream s = new FileStream( "s3Object.txt", FileMode.Cre

Pagina 50

• To launch an EC2 instance using the console, follow the directions in Launching a Windows Instancein the Amazon Elastic Compute Cloud User Guide for

Pagina 51

a. Click Download Remote Desktop File. When your browser prompts you to do so, save the.rdp file.When you have finished, you can click Close to dismis

Pagina 52

Spot Instances perform exactly like other Amazon EC2 instances while running, and like other AmazonEC2 instances, Spot Instances can be terminated whe

Pagina 53 - Create an IAM Role

5 CreateSecurityGroupRequest securityGroupRequest = new CreateSecurity GroupRequest(); securityGroupRequest.GroupName = "GettingStar

Pagina 54

Comparison.InvariantCulture)) { 10 Console.WriteLine(ae.Message); } else { throw; 15 } }You can

Pagina 55 - Overview

To request a Spot Instance, you simply need to build your request with the parameters we have specifiedso far. We start by creating a RequestSpotInsta

Pagina 56 - Prerequisites

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

describeRequest.SpotInstanceRequestId.Add(spotInstanceRequest.SpotIn stanceRequestId); 10 } 1 // Create a variable that will track whether t

Pagina 58

50 if (anyOpen) { // Wait for the requests to go active. Console.WriteLine("Requests still in open stat

Pagina 59

this array to the InstanceId member of a TerminateInstancesRequest object, then passing thatobject to the ec2.TerminateInstances API. 1 if (insta

Pagina 60

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 61

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

Pagina 62 - 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 63 - Create an Amazon SQS Queue

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

Pagina 64 - Send an Amazon SQS Message

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

Pagina 65 - Important

4. Monitor the change to verify that it is complete.The example is a simple console application that shows how to use the SDK for .NET to implement th

Pagina 66

ResourceRecords = new List<ResourceRecord> {new ResourceRecord { Value = "192.0.2.235"}} }; Change change1 = new Cha

Pagina 67 - Adding Resource Record Sets

Getting Started with the AWS SDKfor .NETTo get started with the AWS SDK for .NET, complete the following tasks:Tasks• Create an AWS Account and Creden

Pagina 68 - To run this example

The profile must grant permissions for the actions that you intend to use—the Amazon Route 53actions in this case. Attempts to call actions that lack

Pagina 69

• Action – The action to be taken for this resource record set: CREATE, DELETE, or UPSERT.For more information on these actions, see Elements. This ex

Pagina 70 - To create a hosted zone

Additional ResourcesHome Page for AWS SDK for .NETFor more information about the AWS SDK for .NET, go to the home page for the SDK at http://aws.amazo

Pagina 71 - To monitor update status

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

Pagina 72 - Additional Resources

The preferred approach for handling credentials is to create a profile for each set of credentials in theSDK Store.You can create and manage profiles

Pagina 73 - Document History

To configure the .NET CLRTo ensure the best performance of your server-based applications on systems with multiple processorsor processor cores, we re

Comentarios a estos manuales

Sin comentarios