If I create a compute engine instance with no external IP assigned. I can successfully login to the node using gcloud compute ssh "vm_name" --tunnel-through-iap
I would now like to transfer files to the vm from a storage bucket using gsutil, for example (after connecting to vm with ssh) :
gsutil cp gs://bucket_name/file_name outfile_name
I receive, after a while, this message:
INFO 1106 09:11:03.773168 retry_util.py] Retrying request, attempt #1...
The transfer is never successful. I think it cannot connect.
It seems that IAP works over port 22 at least, but does not work with gsutil. I realise the instance has no internet connection, as it has no external IP assigned, but I am trying to use gsutil to copy a file from a Google Cloud bucket in the same region, so anticipated this would work.
How can I get gsutil to work in this case? (or otherwise how can I transfer a file from a storage bucket to an instance without an external IP - I could not find it documented how to do this)
Thanks
Solved! Go to Solution.
Hi @jomram,
Welcome to Google Cloud Community!
A few approaches to achieve your goal of transferring files from a storage bucket to an instance without an external IP:
1. Use a temporary external IP:
This approach is straightforward, but it requires managing the external IP address lifecycle.
2. Use Cloud Storage Transfer Service:
This approach is automated and doesn't require manual IP management, but it might involve additional configuration depending on your specific needs.
3. Use a jump server:
This approach requires managing another server, but it allows you to keep the target instance without an external IP for security reasons.
4. Use a Cloud Storage FUSE client:
This approach provides seamless access to the bucket, but it requires installing additional software on the instance and might not be suitable for all workloads.
Choose the approach that best suits your needs and security requirements. Remember to remove the temporary external IP address if you use that option and ensure proper IAM permissions are configured for each method.