Ssh_password with dynamic value

The ssh_password is dynamically set to instanceId of the AWS instance when the instance comes up. How do I specify this as ssh_password in the builder section. If I were to use user variable how do I extract it from dynamic instanceID of aws instance.

I was thinking of using vault to add the instanceId when packer brings the instance from the AMI image an put some pause in the builder. However this is not automation. Any help or pointer or example will help