coiled / feedback

A place to provide Coiled feedback
14 stars 3 forks source link

Update tagging practices #18

Closed ericdill closed 3 years ago

ericdill commented 4 years ago

Our internal requirements are that everything gets tagged with the following 7 tags

 common_tags = {
    Owner       = "eric.dill@dtn.com"
    Project     = "DSPlatform"
    Department  = "DataScience"
    Client      = "DTN"
    Environment = "Development"
    Name        = "Coiled"
    CostCenter  = "AWS-71510-764O"
  }

In order to achieve this, we've got common_tags defined above in main.tf. The ask here is for you to go through and figure out which of the resources (a) support tagging and (b) to switch them to merge local.common_tags with whatever else coiled needs. For example, this is what would be required for the cloudwatch.tf module:

diff --git a/modules/coiled/cloudwatch.tf b/modules/coiled/cloudwatch.tf
index 7e3f115..cb85f1b 100644
--- a/modules/coiled/cloudwatch.tf
+++ b/modules/coiled/cloudwatch.tf
@@ -1,17 +1,13 @@
 resource "aws_cloudwatch_log_group" "coiled_cloud_web" {
   name = "/ecs/${var.resource_prefix}cloud-${var.environment}"

-  tags = {
-    Environment = var.environment
-    Application = "${var.resource_prefix}cloud-web"
-  }
+  tags = merge(local.common_tags,
+               {Application = "${var.resource_prefix}cloud-web"})
 }

 resource "aws_cloudwatch_log_group" "coiled_image_builder" {
   name = "/ecs/${var.resource_prefix}builder-${var.environment}"

-  tags = {
-    Environment = var.environment
-    Application = "${var.resource_prefix}cloud-image-builder"
-  }
+  tags = merge(local.common_tags,
+               {Application = "${var.resource_prefix}cloud-image-builder"})
 }

There's a bunch of other modules that need to get updated for the tagging policy at DTN. This isn't time critical, but it is important. Maybe within the next month or so?

necaris commented 4 years ago

@ericdill thanks for this, I'll update the tagging logic right away. I'm assuming the same set of tags need to be added to cluster resources (e.g. ECS task definitions and tasks) by the Django application too?

FabioRosado commented 3 years ago

Hello, I am going through the open issues and closing off some of them. I can see that Rami has updated the tagging logic, I will close this issue. Please feel free to re-open or create a new issue if you feel that there is still work that needs to be done regarding this.