AWS SDK for .NETDeveloper GuideVersion v2.0.0
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
</appSettings></configuration>The Toolkit for Visual Studio adds two key-value pairs to appSettings, based on the values youspecified
Programming with the AWS SDKfor .NETThis section provides general programming techniques and information for developing software with theAWS SDK for .
You can also configure an SDK for .NET application programmatically, by setting property values in theAWSConfigs class. The following example specifie
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
[profile_name]aws_access_key_id = accessKeyaws_secret_access_key = secretKeyA profile can optionally include a session token. For more information, se
<configuration> <appSettings> <add key="AWSProfileName" value="development"/> </appSettings></conf
AmazonS3Config config = new AmazonS3Config();config.ProxyCredentials = new NetworkCredential("foo", "bar");Earlier versions of the
You can set multiple values at once, separated by commas. To set both log4net andSystem.Diagnostics logging in the .config file, use:<add key="
To set service logging with the SDK for .NET API, set the AWSConfigs.ResponseLogging propertyto one of the values of the ResponseLoggingOption enumera
AWS SDK for .NET: Developer GuideCopyright © 2014 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.All trademarks not owned by Ama
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
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
void Callback(IAsyncResult asyncResult)Object stateThe third parameter, state, is a user-defined object that is made available to the callback functio
No Callback SpecifiedThe following example code calls BeginPutObject, performs some work, then calls EndPutObject toretrieve the service response.The
}}The following line of code calls BeginPutObject and specifies the preceding callback function.Whenthe PutObject operation completes, the callback
called. The callback function uses the Amazon S3 client object to call the EndPutObject method toretrieve the server response.The callback also extrac
{ Console.WriteLine("Finished PutObject operation with simple callback"); Console.Write("\n\n"); }
// Create a PutObject request // // You will need to change the BucketName below in order to run this // sample code.
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
• 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
Table of ContentsAWS SDK for .NET Developer Guide ... 1Ho
• All client interfaces have been renamed to follow the .NET convention of starting with the letter "I". Forexample, the AmazonEC2 class is
• The GenerateMD5 property has been removed from PutObjectRequest and UploadPartRequestbecause this is now automatically computed as the object is bei
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
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
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
AWS SDK for .NET Tutorials andExamplesThis chapter provides tutorials, walkthroughs, and examples of programming Amazon Web Services withthe AWS SDK f
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
Walkthrough: Using IAM Roles to Retrieve anAmazon S3 Object from an Amazon EC2 InstanceIn this walkthrough, we consider a program that retrieves an ob
} FileStream s = new FileStream( "s3Object.txt", FileMode.Create ); StreamWriter writer = new StreamWriter( s );
3. Edit the Source File to Remove the Credentials4. Transfer the Compiled Program to Your Amazon EC2 Instance5. Run the ProgramCreate the RoleThe firs
Conclusion ... 60Creating and Using an A
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
using (GetObjectResponse response = client.GetObject(request)) { using (Stream responseStream = response.ResponseStream) {
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
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
Create the ASP.NET_SessionState TableWhen your application starts, it looks for an Amazon DynamoDB table named, by default,ASP.NET_SessionState. We re
Configure the Session State ProviderTo configure an ASP.NET application to use DynamoDB as the session state server1. Add references to both AWSSDK.dl
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
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
var ec2Client = new AmazonEC2Client(RegionEndpoint.USEast1);The client object's permissions are determined by the policy that is attached to the
To enumerate existing security groups1. Obtain a list of your account's security groups.DescribeSecurityGroupsRequest secGroupRequest = new Des
AWS SDK for .NET DeveloperGuideThe AWS SDK for .NET is a single downloadable package that includes Visual Studio project templates,the AWS .NET librar
CreateSecurityGroupResponse newGroupResponse = ec2Client.CreateSecurityGroup(newGroupRequest);Pass the request object to the 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
DescribeKeyPairsRequest keyPairDescriptionRequest = new DescribeKeyPairsRequest();DescribeKeyPairsResponse keyPairDescriptionResponse = ec2Client.
var runInstancesRequest = new RunInstancesRequest(){ ImageId = "ami-62c44d52", InstanceType = "m1.small", MinCount = 1, MaxCou
RunInstancesResponse runResponse = ec2Client.RunInstances(runInstances Request);3. You can use the returned RunInstancesResponse object to get a list
The DescribeInstancesResponse object's DescribeInstancesResult.Reservations propertycontains a list of reservations. In this case, there is only
DescriptionResourceSample code, documentation, tools, and additional resourcesto help you build applications on Amazon Web Services.Windows & .NET
PrerequisitesThis tutorial assumes that you have signed up for AWS, set up your .NET development environment, andinstalled the AWS SDK for .NET. If yo
10 } catch (AmazonEC2Exception ae) { if (string.Equals(ae.ErrorCode, "InvalidGroup.Duplicate", StringCompar ison.InvariantCult
throw; 15 } }You can also create the security group using the AWS Toolkit for Visual Studio. Go to the toolkitdocumentation for mor
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
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
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
SpotInstancesResult.SpotInstanceRequest) { describeRequest.SpotInstanceRequestId.Add(spotInstanceRequest.SpotIn stanceRequestId); 10 } 1 /
Console.WriteLine(e.Message); } 50 if (anyOpen) { // Wait for the requests to go active.
To terminate any outstanding instances, we use the instanceIds array, which we populated with theinstance IDs of those instances that transitioned to
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
To create an Amazon SQS queue1. Create and initialize a CreateQueueRequest instance. Provide the name of your queue and specifya visibility timeout f
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
ReceiveMessageResponse receiveMessageResponse = amazonSQSClient.ReceiveMessage(receiveMessageRequest);The method returns a ReceiveMessageResponse
DeleteMessageResponse response = amazonSQSClient.DeleteMessage(deleteMessageRequest);Calling DeleteMessage unconditionally removes the message fro
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
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.
Document HistoryThe following table describes the important changes since the last release of the AWS SDK for .NETDeveloper Guide.Last documentation u
inserted at build time. This approach ensures that your credentials are not unintentionally exposed withyour project on a public site. For more inform
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