Let me begin by thanking the developers of vyos and vyos-cloudinit. This is a fantastic router for AWS. I am using the AWS AMIs listed at the vyos-cloudinit GH repo. I am having some troubles using the AWS CLI to gather info to be used in the vyos config at boot time. I have a service role attached to the instance that permits all EC2 actions. I verified this works after the vyos instances boots.
What is the log file location used by vyos-cloudinit?
Why does the AWS CLI seem to fail when executed in the context of vyos cloud-init?
vyos@konekti:/tmp$ curl http://169.254.169.254/2018-08-17/user-data/
aws ec2 describe-instances --region us-east-1 > /tmp/ec2
curl -s http://icanhazip.com > /tmp/myip
export VGWaddress1=$(aws ec2 describe-vpn-connections --query ‘VpnConnections.VgwTelemetry.OutsideIpAddress’ --region us-east-1 | sed s’/"//g’)
export VGWaddress2=$(aws ec2 describe-vpn-connections --query ‘VpnConnections.VgwTelemetry.OutsideIpAddress’ --region us-east-1 | sed s’/"//g’)
echo “My VGW addresses are $VGWaddress1 and $VGWaddress2” > /tmp/VGWs
set system host-name vyos1
set interfaces ethernet eth0 description ‘RouterOutsideInt’
I know my instance has Internet connectivtity as the /tmp/myip file contains the instance’s public IP address. The /tmp/ec2 and /tmp/VGWs files are empty. The AWS CLI commands work when executed manually post-boot.