I am using terraform to create an ec2 instance and install docker containers using a docker compose file. I am able to install influxdb docker container, for setting it up i am using the command - docker exec influxdb influx setup --org <organization_name> --bucket <bucket_name> --username <user_name> --password <password> --force
This command is running perfectly if i am running it manually on created ec2. But when i am trying to run command using remote-exec provisioner it’s giving following error - Error: failed to determine if instance has been configured: Get "http://localhost:8086/api/v2/setup": dial tcp 127.0.0.1:8086: connect: connection refused
.
I have verified 8086 port is open. Any solution for this?