'How to share cloudformation or cdk with shared development infrastructure?

I asked question about how to code cost-efficient way with CDK in here.

https://stackoverflow.com/questions/71836274/what-is-the-cost-efficient-approach-for-aws-serverless-team-development?noredirect=1#comment127052075_71836274

But the question is closed with [Questions related to pricing or costs of services are not acceptable here].

https://stackoverflow.com/users/405555/elliveny and https://stackoverflow.com/users/174777/john-rotenstein

advised me to share a single account for developers and I did.

But now my team says if they create 2 separate branches and deploy, they are overwriting each other's work on AWS.

  1. developer A creates branchA from develop
  2. developer B creates branchB from develop
  3. developer A develops API (appsync + lambda)
  4. developer b develops API (appsync + lambda)
  5. developer A deploy branchA
  6. developer B deploy branchB

and on aws developer A work is overwritten. only developer B work stays.

my question :

  1. Is this how aws cloudformation work? or our team doing something wrong?
  2. if yes, on what level does it overwrite? for example if it is stack level, we can make [2 developer chan't change same cdk stack same time] rule


Solution 1:[1]

Depending on what kind of recurses they are using in their branches. If the resources are regional such as lambda and API gateway, then they can depoly their branches to different regions. CloudFormation is regional, so they will not clash with each other.

But ideally, the developers A and B should have their own sandbox accounts for testing and development for maximum separation. Once their branches gets merged into master (or equivalent) then you, and only you, deploy these changes to a dedicated test/development account for further testing.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcin