PHPackages                             c0ntax/aws-ec2-check-tag - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. c0ntax/aws-ec2-check-tag

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

c0ntax/aws-ec2-check-tag
========================

A very simple service that pulls the tags for a given instance to see if a particular key = a particular value.

1.1.1(1y ago)02.2kApache-2.0PHPPHP &gt;=8.1 &lt;9.0

Since Aug 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/c0ntax/aws-ec2-check-tag)[ Packagist](https://packagist.org/packages/c0ntax/aws-ec2-check-tag)[ RSS](/packages/c0ntax-aws-ec2-check-tag/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (7)Used By (0)

aws-ec2-check-tag
=================

[](#aws-ec2-check-tag)

A very simple library that checks that, for the EC2 instance that this is run on, does a key === a certain value.

Introduction
------------

[](#introduction)

This was built to scratch a particular itch where I only wanted cron commands and other services to run on one of a set of EC2 instances. This way you can deploy one AMI for a set of load balanced machines and simply tag one of them that you want to execute something on. For example, say we have 3 instances running the code base, but we only want a particular bit of code to run on one of them. Simply set a tag for that instance such as

```
RunHere: True

```

And then all you need to do so check that `RunHere` has been set to `True`

Usage
-----

[](#usage)

Using the above example, you could use the following code:

```
use C0ntax\Aws\Ec2\CheckTag\Exceptions\KeyNotFoundException;
use C0ntax\Aws\Ec2\CheckTag\Exceptions\NotOnEc2InstanceException;

public function doSomething()
{
  try {
    if (!$this->getCheckService()->check('RunHere', 'True')) {
      return;
    }
  } catch (NotOnEc2InstanceException $exception) {
    // This is probably running on a local instance so we might want to allow this to run
    // (i.e. we are just going to catch and ignore the exception)
  } catch (KeyNotFoundException $exception) {
    // The 'RunHere' key was not found. It's up to you how you've implimented it. It's probably not an error in most cases
    // It just means that you don't want to run anything here

    return;
  }

  print 'I am doing something';
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~231 days

Recently: every ~289 days

Total

6

Last Release

570d ago

PHP version history (3 changes)1.0.0PHP ^7.4

1.0.4PHP &gt;=7.4 &lt;9.0

1.1.0PHP &gt;=8.1 &lt;9.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ba87ed8350747900018388ddee04fdf35cec7345986cdb7eb3b20abe0db9c1bb?d=identicon)[c0ntax](/maintainers/c0ntax)

---

Top Contributors

[![c0ntax](https://avatars.githubusercontent.com/u/1075300?v=4)](https://github.com/c0ntax "c0ntax (12 commits)")

---

Tags

awsec2tagsinstance

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/c0ntax-aws-ec2-check-tag/health.svg)

```
[![Health](https://phpackages.com/badges/c0ntax-aws-ec2-check-tag/health.svg)](https://phpackages.com/packages/c0ntax-aws-ec2-check-tag)
```

###  Alternatives

[aws/aws-sdk-php-laravel

A simple Laravel 9/10/11/12/13 service provider for including the AWS SDK for PHP.

1.7k35.6M75](/packages/aws-aws-sdk-php-laravel)[aws/aws-sdk-php-symfony

A Symfony bundle for v3 of the AWS SDK for PHP

36517.7M22](/packages/aws-aws-sdk-php-symfony)[dumpk/elastcoder

AWS Elastic Transcoder Service Integration

2819.7k](/packages/dumpk-elastcoder)[pluginscart/dynamodb-php

Access AWS DynamoDB through simpler interface in PHP.

1114.0k](/packages/pluginscart-dynamodb-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
