amazon-web-servicesamazon-ec2amazon-data-pipelineaws-data-pipeline

AWS data pipeline name tag option for EC2 resource


I'm running a shell activity in EC2 resource sample json for creating EC2 resource.

{
 "id" : "MyEC2Resource",
 "type" : "Ec2Resource",
 "actionOnTaskFailure" : "terminate",
 "actionOnResourceFailure" : "retryAll",
 "maximumRetries" : "1",
 "instanceType" : "m5.large",
 "securityGroupIds" : [
  "sg-12345678",
  "sg-12345678"
 ],
 "subnetId": "subnet-12345678",
 "associatePublicIpAddress": "true",
 "keyPair" : "my-key-pair"
}

Above json is creating EC2 resource using data pipeline but I want to give a name to the above resource when I will open EC2 resource in AWS console it will show EC2 resource name with other attributes, currently it's showing blank.

See attached image for more details enter image description here


Solution

  • You have to tag the instance with:

     Key: Name
     Value: MyName
    

    MyName is an example name. You need to change it to what you want it to be.

    Adding the tag to the pipeline should propagate the tags to instances. From docs:

    Applying a tag to a pipeline also propagates the tags to its underlying resources (for example, Amazon EMR clusters and Amazon EC2 instances)

    But probably it does not work retrospectively. If you already have a pipeline with instances, its unlikely new tags will propagate. Propagation usually only works at the resource creation. For existing instances you may need to use EC2 console instead.