Need Help With Neo4j AWS CloudFormation


I'm trying to set up Neo4j server on an EC2 VM with CloudFormation. Everything works fine except for the fact that the tags don't get read and put into the neo4j.conf file. When running, I get the follow error $ 45: export: aws:cloudformation:logical_id: bad variable name. Is the tagging system for updating the config files incompatible with CloudFormation?

it works fine with cloudformation, however it seems that the way this bug you're seeing comes about is because you may have some configuration somewhere that's applying extra metadata tags to your VMs. The code that's triggering this is trying to take those metadata tags and export them as environment variables. This won't work for a metadata tag that includes the colon character because that isn't a legal bash env var name.

This export process is done so that the neo4j process itself can have access to configuration parameters that are set via the VM metadata.

The work around (temporary) would be to ensure that you don't have metadata on your VMs that work this way; alternatively you could edit to just skip or substitute those variable names

@david.allen. Thanks for the help! I edited the to ignore the tags and that worked wonderfully. But now, I've run into another issue. When I run systemctl restart neo4j the following error is displayed neo4j : user NOT in sudoers ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/tee /etc/neo4j/password-reset.log. I've already reset the password for the instance but the shell script still prints Changed password for user 'neo4j'. Thu Jun 11 19:38:32 UTC 2020 Default password reset to AWS instance...

You need to use sudo to do certain system commands. So, to restart neo4j:

sudo systemctl restart neo4j

Further documentation on how the cloud images work can be found here: