示例#1
0
        public async Task <List <SA_RdsInstance> > GetRDSInstanceList()
        {
            var lst      = new List <SA_RdsInstance>();
            var response = await client.DescribeDBInstancesAsync();

            var lstInstance = response.DBInstances;

            foreach (var instance in lstInstance)
            {
                SA_RdsInstance objInstance = new SA_RdsInstance
                {
                    DBInstanceIdentifier = instance.DBInstanceIdentifier,
                    DBInstanceArn        = instance.DBInstanceArn,
                    RdsEnvinronment      = environment,
                    Status  = instance.DBInstanceStatus,
                    MultiAZ = instance.MultiAZ
                };
                lst.Add(objInstance);
            }
            return(lst);
        }
示例#2
0
        public async Task <SA_RdsInstance> GetRDSInstance()
        {
            var response = await client.DescribeDBInstancesAsync();

            var lstInstance = response.DBInstances;

            foreach (var instance in lstInstance)
            {
                if (instance.DBSubnetGroup.DBSubnetGroupName.IndexOf(environment.ToString()) >= 0)
                {
                    SA_RdsInstance objInstance = new SA_RdsInstance
                    {
                        DBInstanceIdentifier = instance.DBInstanceIdentifier,
                        DBInstanceArn        = instance.DBInstanceArn,
                        RdsEnvinronment      = environment,
                        Status  = instance.DBInstanceStatus,
                        MultiAZ = instance.MultiAZ
                    };
                    return(objInstance);
                }
            }
            return(null);
        }