Organizations as large as NASA and as small as one techie hosting their own blog use Amazon Web Services (AWS) features. AWS is open to all developers, and the AWS Toolkit for Visual Studio makes special features available to .NET developers. Here's a look at installing and using this Visual Studio add-in.
The AWS Toolkit for Visual Studio is available as a free download (msi file) from the AWS site and includes the AWS SDK for .NET, AWS Explorer, and AWS CloudFormation Deployment. After the add-in downloads, you are guided through the installation via a couple of windows.Figure A shows the second window that appears during installation; it allows you to choose various options such as whether the AWS SDK for .NET is installed and the Visual Studio versions (2010 and 2012 in my case) to use. Once the toolkit is installed, you may work with AWS features via the AWS Explorer or use templates to build AWS-aware applications. Let's start with the AWS Explorer. Figure A
AWS Toolkit for Visual Studio installation options. (Click the image to enlarge.)
AWS ExplorerOnce the AWS Toolkit for Visual Studio is installed, a new option called AWS Explorer is available via the Visual Studio View menu (Figure B). The AWS Explorer provides an easy way to administer your Amazon infrastructure. This includes CloudFront, DynamoDB, EC2, RDS, S3, SimpleDB, SNS, SQS, CloudFormation, and Elastic Beanstalk along with Identity and Access Management. Figure B
Using AWS Explorer to interact with AWS services in Visual Studio. (Click the image to enlarge.)Figure C shows the basic AWS Explorer interface when opened for the first time (without an account) in Visual Studio 2012. Your services appear once account credentials are entered. Figure D shows the AWS Explorer populated once an account has been set up. Figure C
AWS Explorer before account setup. (Click the image to enlarge.)Figure D
Entering AWS credentials to set up AWS Explorer. (Click the image to enlarge.)The AWS Explorer allows you to work with the various services like creating, viewing, and editing S3 objects or SimpleDB items and attributes. You can right-click the services listed in Figure E to work with the services. Also, you can expand services to work with individual objects like the SimpleDB instances displayed in Figure E. Figure E
AWS Explorer displays services/options once an account is configured. (Click the image to enlarge.)Figure F shows the contents of the petboard-ctester SimpleDB instance with the SQL statement displayed above the data. You can make changes to the data and click the Commit Changes button to make them permanent. Figure F
Manipulating AWS SimpleDB instances via AWS Explorer. (Click the image to enlarge.)
Working with AWS project templates
As well as managing your Amazon infrastructure, the AWS Toolkit for Visual Studio simplifies building .NET applications that use AWS services via project templates. These templates use the AWS SDK for .NET, which can be utilized via the templates or by adding the library to other projects. The library is called AWSSDK and it is utilized by adding a reference to the AWS SDK for .NET DLL (the default installation location is C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll).AWS templates are available when creating a new project (Figure G). The current version includes templates for Console and Web projects, as well as an empty project. Figure G
AWS project templates available in Visual Studio. (Click the image to enlarge.)Once you create a new project based on an AWS template, you may enter AWS account credentials or use credentials already entered (Figure H). These credentials will be used to interact with AWS -- the access and security keys are added to the application's configuration file (app.config for console application and web.config for Web application). Figure H
Choose AWS Account when creating an AWS-enabled project. (Click the image to enlarge.)Figure I shows the code for the default Program.cs file included in a basic AWS Console application. Notice the using statements that include references to the base Amazon namespace as well as S3 specific namespaces. There are libraries for each of the Amazon services like Amazon.SimpleDB for SimpleDB services. Figure I
Amazon libraries utilized in AWS-enabled code. (Click the image to enlarge.)
Leapfrog into AWS development with Visual Studio
AWS can be overwhelming whether you're a newbie or an experienced developer. If you don't believe me, take a look around the AWS Management Console and the overwhelming number of options.
While the AWS Toolkit for Visual Studio will not make AWS easier to learn or navigate, it does provide everything needed to quickly get up and running with building applications that use AWS features in .NET applications. The AWS Explorer is a good example, as it is much more user friendly (for a .NET developer) than navigating the AWS site.Keep your engineering skills up to date by signing up for TechRepublic's free Software Engineer newsletter, delivered each Tuesday.
Tony Patton has worn many hats over his 15+ years in the IT industry while witnessing many technologies come and go. He currently focuses on .NET and Web Development while trying to grasp the many facets of supporting such technologies in a production environment on a daily basis.