Support Questions

Find answers, ask questions, and share your expertise

Cloudbreak - Tagging EC2 Instances?

avatar
Master Guru

Is there a way to tag EC2 instances created by cloudbreak?

1 ACCEPTED SOLUTION

avatar
Super Collaborator
@Sunile Manjee

you can define custom tags with cloudbreak 1.3.0 or higher versions.

If you set CB_AWS_DEFAULT_CF_TAG variable in your Profile like CB_AWS_DEFAULT_CF_TAG=testtag then every resource which will be deployed by cloudbreak will be tagged with CloudbreakId:testtag.

Other option is to set CB_AWS_CUSTOM_CF_TAGS variable. If you set CB_AWS_CUSTOM_CF_TAGS=tag1:apple,tag2:lemon then every resource will be tagged with tag1:apple and with tag2:lemon also.

Documentation link

View solution in original post

5 REPLIES 5

avatar
Super Collaborator

We are already adding tags to the instances. Do you want to add some custom tags?

avatar
Master Guru

@rdoktorics yes custom tags.

avatar
Contributor

What I did was write a boto based python script that does all the tagging, I download ind run it using a recipe

The recipe is as simple as this

#!/bin/bash
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
curl "https://<repo with my tagging script>/hdp_tagging.py" -o "hdp_tagging.py"
python ./get-pip.py
pip install boto
pip install argparse
python ./hdp_tagging.py --key '' --secret ''

avatar
Master Guru

@Liam MacInnes This is a neat work around. I would like to see capablities from CB to add custom tags to each host group.

avatar
Super Collaborator
@Sunile Manjee

you can define custom tags with cloudbreak 1.3.0 or higher versions.

If you set CB_AWS_DEFAULT_CF_TAG variable in your Profile like CB_AWS_DEFAULT_CF_TAG=testtag then every resource which will be deployed by cloudbreak will be tagged with CloudbreakId:testtag.

Other option is to set CB_AWS_CUSTOM_CF_TAGS variable. If you set CB_AWS_CUSTOM_CF_TAGS=tag1:apple,tag2:lemon then every resource will be tagged with tag1:apple and with tag2:lemon also.

Documentation link