こんにちわ。
職人見習いの小森です。
今回は、AWS Toolkit for Visual Studioについてです。VisualStudioは、C++6.0の頃から使っていたこともあり、興味が湧いたので触れてみます。
今回はスタートということで、Visual C# 2010 Expressをダウンロードしてきました。
そして、.NET 用 AWS SDKからAWSToolsAndSDKForNet.msiをダウンロードしてきます。
インストールは、Visual C#をインストールした後に、AWSToolsAndSDKForNet.msiをインストールするだけです。
新規作成を開き、今回はConsole Projectを選択します。

尚、新規プロジェクト作成時に、AccessKeyIDとSecretAccessKey、AccountNumberを入力する必要があります。
今回は、DynamoDBでテーブルを作成してみました。
Program.cs
namespace AWS_Console_App1
{
class Program
{
public static void Main( string[] args)
{
Console.Write(GetServiceOutput());
Console.Read();
}
public static AmazonDynamoDB client;
public static string GetServiceOutput()
{
AmazonSecurityTokenServiceClient st = new AmazonSecurityTokenServiceClient();
RefreshingSessionAWSCredentials sc = new RefreshingSessionAWSCredentials (st);
client = new AmazonDynamoDBClient (sc);
client.CreateTable( new CreateTableRequest
{
TableName = "Test",
ProvisionedThroughput = new ProvisionedThroughput { ReadCapacityUnits = 5, WriteCapacityUnits = 5 },
KeySchema = new KeySchema
{
HashKeyElement = new KeySchemaElement { AttributeName = "Title", AttributeType = "S" },
RangeKeyElement = new KeySchemaElement { AttributeName = "Released", AttributeType = "S" }
}
});
StringBuilder sb = new StringBuilder(1024);
return sb.ToString();
}
}
}

上記のようにテーブルが簡単に作成できました。
※この記事は、なかの人(spitz8008)が書いています。