Guest User

Untitled

a guest
Dec 4th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. client = boto3.client('rds', region_name=region)
  2. source_snaps = client.describe_db_cluster_snapshots(DBClusterIdentifier = 'main-production')['DBClusterSnapshots']
  3. source_snap = sorted(source_snaps, key=byTimestamp, reverse=True)[0]['DBClusterSnapshotIdentifier']
  4.  
  5. response = client.restore_db_cluster_from_snapshot(
  6. DBClusterIdentifier='main-development',
  7. SnapshotIdentifier=source_snap,
  8. Port=port,
  9. Engine='aurora-postgresql')
  10.  
  11. i = client.create_db_instance(
  12. DBName='main',
  13. DBInstanceIdentifier='main-development',
  14. DBInstanceClass='db.r4.large',
  15. Engine='aurora-postgresql',
  16. MasterUsername='mab_admin',
  17. MasterUserPassword='mypassword',
  18. AllocatedStorage=20,
  19. DBClusterIdentifier='main-development')
Add Comment
Please, Sign In to add comment