Tag
Manages an individual ECS resource tag. This resource should only be used in cases where ECS resources are created outside the provider (e.g., ECS Clusters implicitly created by Batch Compute Environments).
NOTE: This tagging resource should not be combined with the resource for managing the parent resource. For example, using
aws.ecs.Cluster
andaws.ecs.Tag
to manage tags of the same ECS Cluster will cause a perpetual difference where theaws.ecs.Cluster
resource will try to remove the tag being added by theaws.ecs.Tag
resource. NOTE: This tagging resource does not use the providerignore_tags
configuration.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.batch.ComputeEnvironment;
import com.pulumi.aws.batch.ComputeEnvironmentArgs;
import com.pulumi.aws.ecs.Tag;
import com.pulumi.aws.ecs.TagArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleComputeEnvironment = new ComputeEnvironment("exampleComputeEnvironment", ComputeEnvironmentArgs.builder()
.computeEnvironmentName("example")
.serviceRole(aws_iam_role.example().arn())
.type("UNMANAGED")
.build());
var exampleTag = new Tag("exampleTag", TagArgs.builder()
.resourceArn(exampleComputeEnvironment.ecsClusterArn())
.key("Name")
.value("Hello World")
.build());
}
}
Content copied to clipboard
Import
aws_ecs_tag
can be imported by using the ECS resource identifier and key, separated by a comma (,
), e.g.,
$ pulumi import aws:ecs/tag:Tag example arn:aws:ecs:us-east-1:123456789012:cluster/example,Name
Content copied to clipboard