title: How should I organise my micro-services for to enable independent deployment via CloudFormation
body: <p>I am trying to develop an application that is made up of multiple components that I want to be able to deploy independently. </p>
  
  <p>Each component may contain parts packaged into Docker containers deployed into ECS or just Lambda functions. There will be some shared infra eg. VPC/Subnets/ALB/Databases etc</p>
  
  <p>I am just wondering how can I manage this. It appears the easiest is I put everything into 1 repo with 1 large SAM/Cloudformation template but that does not seem scalable. </p>
  
  <p>I was thinking of having: </p>
  
  <ul>
  <li>1 base stack defining API Gateway, ALB, ECS Cluster, Subnets &amp; Security Groups</li>
  <li>Each app will then define its own ECR/ECS Tasks/Services to be attached to the ECS Cluster, define its own ALB Target Group. Or if its lambda functions configure itself to link up with API Gateway. </li>
  </ul>
  
  <p>But starting to find this very challenging. I think when I deploy 1 part it will remove APIs from the other services in such a setup? </p>
  
  <p>Whats the recommended way around this? </p>