Skip to main content
The CloudFormation template puts the Observer Agent on a small EC2 instance in a VPC and subnet you choose. From there the agent checks what that subnet can reach, such as private databases, internal APIs and Prometheus. It only makes outbound calls: the stack opens no inbound port. Your cloud’s pricing applies to everything the stack creates.

What the stack creates

  • An EC2 instance named observer-agent: Amazon Linux 2023 (arm64), t4g.nano by default, an encrypted 8 GB gp3 volume, IMDSv2 required.
  • A security group with outbound rules only.
  • A Secrets Manager secret that holds the agent key. The instance reads it at first boot, so the key never appears in the instance user data.
  • An IAM role for the instance. It may read that one secret, and it carries AmazonSSMManagedInstanceCore so you can open a shell with Session Manager instead of SSH.
At first boot the instance runs the install script, which installs the agent binary as the observer-agent systemd service.

Before you start

  • Create the agent in Observer: Agents, Add agent, then Cloud platforms. Copy the key. Observer shows it once.
  • Pick the VPC of the services the agent should check, and a subnet in it with outbound internet access. Either:
    • a public subnet, with a public IP (the default), or
    • a private subnet behind a NAT gateway, with the public IP turned off.
    The public IP carries outbound traffic only. Nothing listens on it.
  • Deploy in the region of that VPC.
To list the subnets of a VPC:

Parameters

Deploy with the AWS CLI or CloudShell

1

Download the template

2

Create the stack

In a private subnet behind a NAT gateway, add AssignPublicIp=false to the overrides. Add --region <region> when the VPC is not in your default region. CAPABILITY_IAM lets the stack create the instance role. The command waits until the stack is created.

Deploy from the AWS console

There is no Launch Stack button yet. Upload the template instead:
1

Download the template

Save observer-agent.yaml to your computer.
2

Create the stack

Open CloudFormation in the region of your VPC and choose Create stack, With new resources (standard). Keep Choose an existing template, then pick Upload a template file, select observer-agent.yaml and choose Next.
3

Fill in the parameters

Name the stack (for example observer-agent). Paste the key into Agent key, then pick the VPC and the Subnet. For a private subnet behind a NAT gateway, set Public IP for outbound traffic to false. Choose Next, keep the stack options, and choose Next again.
4

Create it

Tick the acknowledgement that CloudFormation might create IAM resources, then choose Submit. The stack reaches CREATE_COMPLETE in a few minutes.

Check that it connected

A few minutes after the stack completes, the Add agent screen shows Connected and the Agents page marks the agent as running. The instance first boots, then downloads and installs the agent. If it does not connect, read the agent’s logs. The stack’s Logs output holds the command:
Open a shell on the instance with Session Manager: in the EC2 console select the instance, then Connect, Session Manager, Connect. From the AWS CLI with the Session Manager plugin installed:
Then:
The agent logs every failed call to Observer with the reason. The most common cause is a wrong or replaced agent key. If the observer-agent service does not exist, the install at first boot failed: its output is in /var/log/cloud-init-output.log. The usual cause is a subnet without outbound internet access, which also stops Session Manager from connecting.

Add settings and secrets

The agent reads its environment from /etc/observer-agent/agent.env. To add a variable, such as PROMETHEUS_SERVER_URL or a secret that a probe references by name (connection_string_ref and the like), edit the file and restart the service:
After a key rotation, put the new key in AGENT_KEY in the same file. Updating the stack’s AgentKey parameter does not reach a running instance: the instance reads the secret only at first boot. See Environment variables for every setting.

Upgrades

The stack installs the agent binary with the install script. To upgrade, run the script again from a Session Manager shell. It replaces the binary, restarts the service, and keeps the key and your settings:
To install a given release, add -s -- --version <X.Y.Z> after sh.

Remove

Or select the stack in the CloudFormation console and choose Delete. Deleting the stack deletes everything it created: the instance and its volume, the security group, the role and the secret. Delete the agent in Observer (Agents) too if you no longer need it.