After posting my question, I kept digging and found what I suspect is the 
source of my 
problem: 
https://github.com/mitchellh/vagrant-aws/blob/master/lib/vagrant-aws/action/read_ssh_info.rb#L32:

# read attribute override ssh_host_attribute = machine.provider_config. 
get_region_config(machine.provider_config.region).ssh_host_attribute # 
default host attributes to try. NOTE: Order matters! ssh_attrs = [
:public_ip_address, :dns_name, :private_ip_address] ssh_attrs = 
(Array(ssh_host_attribute) 
+ ssh_attrs).uniq if ssh_host_attribute # try each attribute, get out on 
first value host_value = nil while !host_value and attr_name = 
ssh_attrs.shift begin host_value = server.send(attr_name) rescue 
NoMethodError @logger.info("SSH host attribute not found #{attr_name}") end 
end
So apparently there is no way to override this order.
Is there anything I'm missing?

Thanks.

On Wednesday, 4 March 2015 15:56:37 UTC+11, Amos S wrote:
>
> Our setup: VPC network, connected from the office via Direct Connect.
>
> A colleague is trying to setup a Vagrant box inside this AWS VPC using 
> vagrant-aws which requires a public IP in order to access external 
> resources.
>
> When he tried to add 'aws.elastic_ip = true' or 'aws.associate_public_ip = 
> true', vagrant brought the box up alright but keeps trying to ssh into it 
> through the public IP, not through the private IP which is perfectly 
> accessible directly.
>
> The ssh port on the public IP is blocked, of course, so Vagrant fails.
>
> Is there a way to tell Vagrant to keep using the private IP even though it 
> assigned it an external IP?
>
> Digging through vagrant-aws' source code didn't come up with anything for 
> me.
>
> Thanks,
>
> --Amos
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to