Specify tags for elements that Waypoint creates in the aws-ecs plugin

Hello,

As part of an application deployment, we are using the aws-ecs plugin to deploy the pp in an AWS account. Everything is working properly, but now we would like to add some tags to the elements that Waypoint creates (tasks, services and so on). And I was wondering whether is possible to specify these tags in the waypoint.hcl file, so that we don’t need to tag them manually, and every element could have the same tags.

Our waypoint.hcl is similar to this piece of code:

app "api" {
    build {
        use "docker" {
            dockerfile = var.Dockerfile-name
        }
        registry {
            use "aws-ecr" {
                region     = "eu-west-2"
                repository = "api"
                tag        = "latest"
            }
        }
    }

    deploy {
        use "aws-ecs" {
            region = "eu-west-2"
            memory = 4096
            alb {
                certificate = var.api-aws-alb-certificate
                ingress_port = 443
                internal = false
                subnets = var.alb-subnets
                zone_id = var.alb-zone_id
                domain_name = var.api-aws-alb-domain_name
            }
            subnets = var.subnets
            security_group_ids = var.security_group_ids
        }
    }
}

And also, there is a *.wpvars.json file created for each environment.

Regards,
Miguel.

Hey MiguelAngelGarciaGom,

Great question! Out of curiosity, would you like to tag all of these resources with some kind of waypoint metadata (i.e. the waypoint project, app, workspace, etc), or some other custom metadata?

Hi @izaaklauer ,

Thank you for your reply :wink:

In this case, I’d like to tag the elements with custom metadata. We have other resources created with Terraform and we would like to tag the ones created with Waypoint with the same tags.

Regards,
Miguel.

I’m wondering if it would be better for you to be able to specify this metadata once and let waypoint apply it to all resources, or if you’d rather have it be configurable per-resource.

Do you need to apply the same set of kv pairs to each resource (load balancer, target group, ecs service, ecr registry, etc)?

In this case, I would need to apply the same set to each resource :wink:

Hey @MiguelAngelGarciaGom!

We’ve opened a feature request issue on GitHub for this: Specify tags for elements that Waypoint creates in the aws-ecs plugin - #4 by izaaklauer

If there’s more information or context that you would like to add, please feel free to comment on the issue so we can address it when we go to implement the issue! Thanks!

Thank you so much @briancain!

By the way, the request is opened here? Because I can’t see it :confused:

Hey there @MiguelAngelGarciaGom. Yes, the issue is here: core: Apply waypoint labels to resources created in the platform · Issue #4249 · hashicorp/waypoint · GitHub

Sorry, I forgot to share the URL on my previous post <3

2 Likes