My top file looks like this.
base:
'G@roles:docker':
- states/docker
'G@roles:sb-monolith-ecr':
- states/aws-ecr-logged-in
- states/sb-monolith-ecr
'G@roles:web-applications-ecr':
- states/aws-ecr-logged-in
- states/web-applications-ecr
The aws-ecr-loggin-in state:
aws-erc-logged-in:
cmd.run:
- name: $(aws ecr get-login --region={{ pillar['aws']['region'] }})
I am expecting the login state to trigger once and before the states that require the authentication to AWS ECR. Today when I refreshed my minions some of them had authentication errors. What is the best way to ensure the login command is run at the right time?