winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
5.06k stars 198 forks source link

Compile "ownership tags" into the generated IaC #839

Open schosterbarak opened 1 year ago

schosterbarak commented 1 year ago

Summary

Compile "ownership tags" into the generated IaC

Feature Spec

One of the things I hear a lot from practitioners is the requirement to have "ownership" of cloud resources. Some are using IaC tags, Some runtime tags, and Some innovative ones are using CI logs to trace back the owner.

Ownership is required when you want to know, "who owns the resource that costs so much/ throws errors / has security misconfigs?". Baking tags into the resources helps in those pains.

At bridgecrew we used this util named yor to bake in "ownership" from git log data into IaC.

Maybe it would be interesting to do that in wing compilation-time instead of using tools like yor.

Use Cases

Automatically add tags like:

git_org
git_repo
git_last_modified_by
git_file
git_commit
git_last_modified date

More use cases are detailed here.

Implementation Notes

You can get a lot of data from the git command. It's likely to have it installed for most developers.

Component

Compiler

ShaiBer commented 1 year ago

Thanks @schosterbarak , I love it! It will probably take a while to implement though since we first prioritize development of the core functionality of the compiler, and still have much to complete there.

staycoolcall911 commented 1 year ago

Related to #493

staycoolcall911 commented 1 year ago

Seems like this is a good use case for #1218 - FYI @hasanaburayyan, @schosterbarak

hasanaburayyan commented 1 year ago

For sure! We often had the same pain at my last large org, so much so that tagging was enforced via SCP requiring certain tags to exist in order to create certain resoruces.

Inspired from these docs See: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_tagging.html

But for sure I can see a few ways that https://github.com/winglang/wing/pull/1218 can help with this.

github-actions[bot] commented 1 year ago

Hi,

This issue hasn't seen activity in 60 days. Therefore, we are marking this issue as stale for now. It will be closed after 7 days. Feel free to re-open this issue when there's an update or relevant information to be added. Thanks!