Bug Report - AWS Community AMI fails when deployed to a private subnet

If the community AMI is deployed to a private subnet instead of a public subnet, the host will not assigned a public IP address and neo4j will not start. It is desirable to deploy neo4j to a private subnet for security reasons.

The line in /etc/neo4j/pre-neo4j.sh that needs to be repaired where EXTERNAL_IP_ADDR is set below. To bypass this problem set EXTERNAL_IP_ADDR to the private IP address and start neo4j.

export MAC_ADDR=$(curl --silent $API/meta-data/network/interfaces/macs/)
export INTERNAL_IP_ADDR=$(curl --silent $API/meta-data/network/interfaces/macs/$MAC_ADDR/local-ipv4s)
export EXTERNAL_IP_ADDR=$(curl --silent $API/meta-data/network/interfaces/macs/$MAC_ADDR/public-ipv4s)
export INSTANCE_ID=$(curl --silent $API/meta-data/instance-id)
export AVAILABILITY_ZONE=$(curl --silent $API/meta-data/placement/availability-zone)
export REGION=`curl -s|grep region|awk -F\" '{print $4}'`
1 Like

Thanks for the bug report, and for the detail you've put into this. I can see exactly what you mean and we'll make sure this fix gets into the next release of the cloud images.