1

I am attempting to create an AWS RDS database. Any engine would be OK.

rdsClient = new Amazon.RDS.AmazonRDSClient(<aws_credentials>, <some_region>);

try
{
    rdsClient.CreateDBInstance(new CreateDBInstanceRequest(identifier, allocatedStorage, instanceSize, engine, username, password));
    MessageBox.Show(String.Format("{0} was succesfully created!", identifier));
}
catch (AmazonRDSException ex)
{
    MessageBox.Show(ex.Message);
}

So I am loading my credentials into an RDS Client and attempting to create a database. This works fine except I cannot specify a database version. Is there any alternative way of creating a database or specifying a version?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Ibn Masood
  • 1,093
  • 1
  • 14
  • 31

1 Answers1

2

I haven't tried it myself yet, but I think you would want to do something like this (the capitalization below is almost certainly wrong):

var dbr = new CreateDBInstanceRequest();

   dpr.EngineVersion = <yourvalue>;
   dbr.Identifier = <yourvalue>;
   dbr.AllocatedStorage = <yourvalue>;
   dbr.InstanceSize = <yourvalue>;
   dbr.Engine = <yourvalue>;
   dbr.Username = <yourvalue>;
   dbr.Password = <yourvalue>;
   //also set any other values

 try
        {
            rdsClient.CreateDBInstance(dbr);
            MessageBox.Show(String.Format("{0} was succesfully created!", identifier));
        }
        catch (AmazonRDSException ex)
        {
            MessageBox.Show(ex.Message);
        }

https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Services/RDS/Generated/Model/CreateDBInstanceRequest.cs

E.J. Brennan
  • 45,870
  • 7
  • 88
  • 116