I've never considered ownership in an IaC repo down to the individual resource and I'm struggling to see the usecase.<p>We also use tags/labels to link the generated "thing" back to the repository that created it with:<p>- The repo URL<p>- The pipeline URL<p>- The commit hash (also retrievable from the pipeline details)<p>These are all discovered via GitLab CI variables [1].<p>From this we would use the Git repository to identify ownership.
We have the benefit of our Infosec team having wide access to our GitLab instance, which might hamper other companies.<p>How would you handle a situation where someone creates a resource but then leaves?<p>The good thing about looking at an entire repository is that it gives you the entire history and who else might have worked on it. In hierarchical Git providers (eg. GitLab), it can also indicate where the project sits relative to others. If you just have a single person, you may struggle to find out who now owns a resource.<p>[1] <a href="https://docs.gitlab.com/ci/variables/predefined_variables/" rel="nofollow">https://docs.gitlab.com/ci/variables/predefined_variables/</a>