Skip to content

Instantly share code, notes, and snippets.

@aldenw
Last active March 15, 2019 16:21
Show Gist options
  • Save aldenw/e29da119eb4ebb3d49f6b2dfcb2c0f5c to your computer and use it in GitHub Desktop.
Save aldenw/e29da119eb4ebb3d49f6b2dfcb2c0f5c to your computer and use it in GitHub Desktop.
Export AWS RDS instances into a format for HeidiSQL import
aws rds describe-db-instances --query='DBInstances[*].{Address:Endpoint.Address,Port:Endpoint.Port,Id:DBInstanceIdentifier}[*].[Address,Port,Id]' --output=text | sed -E "s/(\S+)\s+(\S+)\s+(\S+)/Servers\\\\\3\\\\Host<|||>1<|||>\\1\r\nServers\\\\\3\\\\LoginPrompt<|||>3<|||>1\r\nServers\\\\\3\\\\Port<|||>1<|||>\\2\r\nServers\\\\\3\\\\NetType<|||>3<|||>0\r\nServers\\\\\3\\\\Compressed<|||>3<|||>1/" | unix2dos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment