Resource: aws_ecs_tag

Manages an individual ECS resource tag. This resource should only be used in cases where ECS resources are created outside Terraform (e.g., ECS Clusters implicitly created by Batch Compute Environments).

Example Usage

resource "aws_batch_compute_environment" "example" {
  compute_environment_name = "example"
  service_role             = aws_iam_role.example.arn
  type                     = "UNMANAGED"
}

resource "aws_ecs_tag" "example" {
  resource_arn = aws_batch_compute_environment.example.ecs_cluster_arn
  key          = "Name"
  value        = "Hello World"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_ecs_tag using the ECS resource identifier and key, separated by a comma (,). For example:

import {
  to = aws_ecs_tag.example
  id = "arn:aws:ecs:us-east-1:123456789012:cluster/example,Name"
}

Using terraform import, import aws_ecs_tag using the ECS resource identifier and key, separated by a comma (,). For example:

% terraform import aws_ecs_tag.example arn:aws:ecs:us-east-1:123456789012:cluster/example,Name