Delete an RDS instance
(self, args, name)
| 250 | return response['DBInstances'] |
| 251 | |
| 252 | def _delete_rds_instance(self, args, name): |
| 253 | """ Delete an RDS instance """ |
| 254 | rds = self._get_aws_client('rds', args) |
| 255 | |
| 256 | debug('Deleting RDS instance: {}...'.format(name)) |
| 257 | try: |
| 258 | rds.delete_db_instance( |
| 259 | DBInstanceIdentifier=name, |
| 260 | SkipFinalSnapshot=True, |
| 261 | DeleteAutomatedBackups=True |
| 262 | ) |
| 263 | except Exception as e: |
| 264 | error(str(e)) |
| 265 | |
| 266 | # Wait for completion |
| 267 | while True: |
| 268 | try: |
| 269 | rds.describe_db_instances(DBInstanceIdentifier=args.name) |
| 270 | except rds.exceptions.DBInstanceNotFoundFault: |
| 271 | return |
| 272 | except Exception as e: |
| 273 | error(str(e)) |
| 274 | |
| 275 | time.sleep(5) |
| 276 | |
| 277 | def _delete_security_group(self, args, id): |
| 278 | """ Delete a security group """ |
no test coverage detected