in our software-project we have a git-project for creating the infrastructure in aws (ec2-instances). On the other hand every microservice has its onw git-repo and a automatic deployment for special branches (e.g. a checkin to production-branch leads to a redeployment in the production environment). So far so fine.
(Technically we user docker for our services.)
My question: I’m still a bit unsure how to make the initial software deployment after recreating an new ec2-instance in aws. One way could be: Let the infrastructure-project only create the infrastrucure. But then you have somehow to populate your services to this new created environment. E.g. by manually(Ohh) triggering the deploy-CI-Pipeline part. Or I could do the initial software deployment as part of the infrastructure project. But in this case I have to duplicate my docker-compose files. I need it then in both: The infrastructure-project AND the specific microservice project.
What ist best practice?