Updating script to handle the key pair and security group creation and cleanup.