AWS SDK for .NETDeveloper GuideVersion v2.0.0
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
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
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 and System.Dia-gnostics logging in the .config file, use:<add key=&qu
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.The following are trademarks of
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
callback function uses the Amazon S3 client object to call the EndPutObject method to retrieve theserver response. The callback also extracts the star
{ 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 UploadPartRequest becausethis 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
NuGet from Solution ExplorerTo use NuGet from Solution Explorer, right-click on your project and select Manage NuGet Packages...from the context menu.
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
AWS SDK for .NET Tutorials andExamplesThe following tutorials and examples demonstrate how to use the AWS SDK for .NET to access AmazonWeb Services.Be
The AWS SDK for .NET includes AWS.SessionProvider.dll, which contains an ASP.NET sessionstate provider. Also included is the AmazonDynamoDBSessionProv
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
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
Creating and Using an Amazon SQS Queue ... 58Create an Amazon SQS Client ...
"Resource" : "arn:aws:dynamodb:us-east-1:<YOUR-AWS-ACCOUNT-ID>:table/ASP.NET_SessionState" } ]}Tutorial: Creating
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
{ Name = "vpc-id", Values = new List<string>() {vpcID}};var dsgRequest = new DescribeSecurityGroupsRequest();dsgRequest.Filters.
The CreateSecurityGroup method returns a CreateSecurityGroupResponse object.You can get the IDof the new security group from the response and then us
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
foreach (KeyPairInfo item in myKeyPairs){ Console.WriteLine("Existing key pair: " + item.KeyName); if (item.KeyName == keyPairName)
• 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
{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ &qu
{ DeviceIndex = 0, SubnetId = subnetID, Groups = groups, AssociatePublicIpAddress = true};List<InstanceNetworkInterfaceSpecification>
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
AWS SDK for .NET DeveloperGuideThe AWS SDK for .NET is a single downloadable package that includes Visual Studio project templates,the AWS .NET librar
Checking the State of Your InstanceUse the following procedure to get the current state of your instance. Initially, your instance is in thepending st
var deleteRequest = new TerminateInstancesRequest(){ InstanceIds = instanceIds};var deleteResponse = ec2Client.TerminateInstances(deleteRequest);fo
The following walkthrough uses a sample program that retrieves an object from Amazon S3 using theAWS credentials that you've configured. Next, we
responseBody = reader.ReadToEnd(); } } using (FileStream s = new FileStream( "s3Object.txt", FileMode.Cre
• To launch an EC2 instance using the console, follow the directions in Launching a Windows Instancein the Amazon Elastic Compute Cloud User Guide for
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
Spot Instances perform exactly like other Amazon EC2 instances while running, and like other AmazonEC2 instances, Spot Instances can be terminated whe
5 CreateSecurityGroupRequest securityGroupRequest = new CreateSecurity GroupRequest(); securityGroupRequest.GroupName = "GettingStar
Comparison.InvariantCulture)) { 10 Console.WriteLine(ae.Message); } else { throw; 15 } }You can
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
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
describeRequest.SpotInstanceRequestId.Add(spotInstanceRequest.SpotIn stanceRequestId); 10 } 1 // Create a variable that will track whether t
50 if (anyOpen) { // Wait for the requests to go active. Console.WriteLine("Requests still in open stat
this array to the InstanceId member of a TerminateInstancesRequest object, then passing thatobject to the ec2.TerminateInstances API. 1 if (insta
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
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
ResourceRecords = new List<ResourceRecord> {new ResourceRecord { Value = "192.0.2.235"}} }; Change change1 = new Cha
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
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
• 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
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
Document HistoryThe following table describes the important changes since the last release of the AWS SDK for .NETDeveloper Guide.Last documentation u
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
To configure the .NET CLRTo ensure the best performance of your server-based applications on systems with multiple processorsor processor cores, we re
Kommentare zu diesen Handbüchern