# How to add custom EC2 tags to instances

**URL:** <https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315>\
**Category:** Elastic CI Stack for AWS\
**Created:** [October 19, 2023, 11:24pm UTC](https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315 "2023-10-19T23:24:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![surajthakur](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@surajthakur](https://forum.buildkite.community/u/surajthakur)\
**Post date:** [October 19, 2023, 11:24pm UTC](https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315/1 "2023-10-19T23:24:48Z")

</div>

Hi Team,

Is there a way/configuration to add new tags to the instances created in the elastic-ci setup?  
We want to exclude it from our AWS Inspector scanning.

Thanks  
Regards  
Suraj

---

<div class="post-metadata">

**Author:** ![james.s](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/james.s/32/1305_2.png) [@james.s](https://forum.buildkite.community/u/james.s)\
**Post date:** [October 19, 2023, 11:41pm UTC](https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315/2 "2023-10-19T23:41:22Z")

</div>

Hello @surajthakur!

Hope you are well - and thanks for the question! 👋

As of right now, there isn’t a _inbuilt_ parameter within the CI Stack’s CloudFormation template that will add specific tags to EC2 instances that its scaler will spin up. Though of course, if you do want them added to each instance that the stack does create, I’d suggest using something like the `aws-cli`’s `create-tags` [command](https://docs.aws.amazon.com/cli/latest/reference/ec2/create-tags.html) that can add them to each instance upon their boot within a bootstrap script (passed through within the stack as `BootstrapScriptUrl`).

You could always open a [PR](https://github.com/buildkite/elastic-ci-stack-for-aws/pulls) or raise an [Issue](https://github.com/buildkite/elastic-ci-stack-for-aws/issues?q=is%3Aissue+is%3Aopen+) on the CI Stack’s repository if you’d like too.

Hope that assists!

---

<div class="post-metadata">

**Author:** ![surajthakur](https://avatars.discourse-cdn.com/v4/letter/s/96bed5/32.png) [@surajthakur](https://forum.buildkite.community/u/surajthakur)\
**Post date:** [October 20, 2023, 1:32am UTC](https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315/3 "2023-10-20T01:32:52Z")

</div>

> [@james.s](#):
>
> to

Hello @james.s

Thanks for the update on that. I will try to plug in aws-cli tags association command.

Have a good day.

Thanks & Regards  
Suraj

---

<div class="post-metadata">

**Author:** ![james.s](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/james.s/32/1305_2.png) [@james.s](https://forum.buildkite.community/u/james.s)\
**Post date:** [October 20, 2023, 1:42am UTC](https://forum.buildkite.community/t/how-to-add-custom-ec2-tags-to-instances/3315/4 "2023-10-20T01:42:25Z")

</div>

No worries @surajthakur!

Hope that works out for your use case - do let us know if anything else comes to mind. Door always open for a PR/Issue on the GitHub repo in tandem.

Cheers 🙂
