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).
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"
}
This resource supports the following arguments:
resource_arn
- (Required) Amazon Resource Name (ARN) of the ECS resource to tag.key
- (Required) Tag name.value
- (Required) Tag value.This resource exports the following attributes in addition to the arguments above:
id
- ECS resource identifier and key, separated by a comma (,
)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