1

我正在尝试创建 AWS RDS 数据库。任何引擎都可以。

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);
}

因此,我将凭据加载到 RDS 客户端并尝试创建数据库。除了我无法指定数据库版本外,这很好用。有没有其他方法可以创建数据库或指定版本?

4

1 回答 1

2

我自己还没有尝试过,但我想你会想做这样的事情(下面的大写几乎肯定是错误的):

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

于 2018-12-22T09:15:16.607 回答