Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Set task tags #195

Merged
merged 1 commit into from
Jul 27, 2020
Merged

Set task tags #195

merged 1 commit into from
Jul 27, 2020

Conversation

aiordache
Copy link
Contributor

Add project and service name to task tags and container docker labels.

Before

 },
    "TestTaskDefinition": {
      "Properties": {
        "ContainerDefinitions": [
          {
            "Environment": [
         ....
        "RequiresCompatibilities": [
          "FARGATE"
        ]
      },
      "Type": "AWS::ECS::TaskDefinition"
    },

After

"DemoTaskDefinition": {
      "Properties": {
        "ContainerDefinitions": [
          {
            "DockerLabels": {
              "com.docker.compose.project": "test",
              "com.docker.compose.service": "demo"
            },
            "Environment": [
        ....
        "RequiresCompatibilities": [
          "FARGATE"
        ],
        "Tags": [
          {
            "Key": "com.docker.compose.project",
            "Value": "test"
          },
          {
            "Key": "com.docker.compose.service",
            "Value": "demo"
          }
        ]
      },
      "Type": "AWS::ECS::TaskDefinition"
    },

closes https://github.com/docker/ecs-plugin/issues/188

Signed-off-by: aiordache <anca.iordache@docker.com>
Copy link
Contributor

@chris-crone chris-crone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours glours merged commit 1a949c6 into master Jul 27, 2020
@glours glours deleted the add_task_tags branch July 27, 2020 08:28
DisableNetworking: service.NetworkMode == "none",
DnsSearchDomains: service.DNSSearch,
DnsServers: service.DNS,
DockerLabels: map[string]string{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will create docker engine labels, not available on AWS API
You should have set service.PropagateTags
see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html#cfn-ecs-service-propagatetags

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tasks are not tagged while other resources are
4 participants