Background:
The Consul auto-join feature supports access-keys to discover nodes it should join. Ideally you should be using a role that has the describe-instance permission attached to it. This works great if your cluster is entirely within a single account.
However, there is currently no way use the auto join feature across AWS accounts with IAM roles. The solution for now is to use a AWS access keys to be able to describe instances in a different account.
Background: The Consul auto-join feature supports access-keys to discover nodes it should join. Ideally you should be using a role that has the describe-instance permission attached to it. This works great if your cluster is entirely within a single account.
However, there is currently no way use the auto join feature across AWS accounts with IAM roles. The solution for now is to use a AWS access keys to be able to describe instances in a different account.
Problem: The run-consul script does not support access keys. https://github.com/hashicorp/terraform-aws-consul/blob/db3d81e030f03da3832e3865806193400a7b576a/modules/run-consul/run-consul#L253
Solution Add the ability to set both
access_key_id
andsecret_access_key
to theretry_join
block as mentioned here: https://www.consul.io/docs/agent/cloud-auto-join.html#amazon-ec2