The Simplest Way to Make Crossplane and Ec2 Systems Manager Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Crossplane and ec2 systems manager work together to build cloud resources and run host tasks. Crossplane creates the servers and roles, while Systems Manager handles host patching and commands. Platform teams often struggle to link Kubernetes control planes with guest operating system agents. When you pair these two tools, you manage the whole server lifecycle from one place. Your cluster creates the virtual machines and attaches the right cloud permissions at boot time. Then the host agent rep

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Crossplane and ec2 systems manager work together to build cloud resources and run host tasks. Crossplane creates the servers and roles, while Systems Manager handles host patching and commands.

Platform teams often struggle to link Kubernetes control planes with guest operating system agents. When you pair these two tools, you manage the whole server lifecycle from one place. Your cluster creates the virtual machines and attaches the right cloud permissions at boot time. Then the host agent reports in and runs your startup scripts without manual setup.

How crossplane and ec2 systems manager share roles and data

The workflow starts inside your Kubernetes cluster where Crossplane controllers watch your custom resource files. When a team asks for a new server, Crossplane talks to the cloud API. It creates the virtual machine, the network links, and the instance profile role.

That instance profile role is the bridge between the two systems. The cloud provider attaches this role to the new server when it starts up. Inside the server, the Systems Manager agent wakes up and reads those role keys. The agent then calls the Systems Manager service endpoint to register the new machine.

Crossplane can also create Systems Manager documents, parameter store entries, and maintenance windows. When Crossplane writes a secret or config value to the parameter store, the host reads it. This data flow keeps state inside Kubernetes while the cloud service handles host execution. Neither tool needs direct network access to the other tool to finish the job.

Common failure modes and how to scope permissions

Many teams make the mistake of giving the Crossplane controller role full admin rights. If someone compromises the cluster, they gain control over every cloud server and secret. A shared service account with broad tokens makes it hard to track who changed what. You should split your Crossplane provider roles by team or by workload type.

Another common problem happens on the host side with broad instance profiles. Teams often attach default managed policies that let a server read every parameter store key. If an app on one server gets hacked, the attacker can read keys for other apps. Instead, let Crossplane build a narrow role for each server group. That role should only read parameter paths that match the specific app tag.

GCP Access Context Manager + Crossplane Composition Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network paths also cause silent failures when servers boot in private subnets without internet routes. If the host agent cannot reach the cloud API, the server never shows up as online. Use Crossplane to set up private VPC endpoints for the Systems Manager service first. Make your server compositions wait until those network endpoints are ready before booting machines.

Unlogged commands and parameter reads create blind spots during security audits. Turn on cloud audit logs for all parameter store reads and remote command runs. When you pair strict role scoping with clear audit logs, you prevent lateral movement across hosts.

Managing drift between cluster state and host state

A big challenge with these two tools is handling changes made outside of Kubernetes. Crossplane watches the cloud API and fixes drift on resources it owns. If someone changes a security group or a parameter value in the console, Crossplane reverts it.

Still, Systems Manager runs scripts inside the guest operating system where Crossplane cannot see. If a script changes a file on disk, Crossplane does not know about that change. To fix this gap, keep your host scripts idempotent and store their config in Kubernetes. Let Crossplane manage the document content so every change goes through version control first.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can Crossplane install the Systems Manager agent on a new server?

Crossplane does not install software inside the guest operating system directly. Instead, pick a base machine image that already has the agent installed, or pass a startup script through the Crossplane server spec.

How do we pass database secrets from Crossplane to EC2 hosts?

Have Crossplane write the generated secret into a secure parameter store entry. Then grant the server instance profile permission to read that specific parameter path on boot.

Why does my Crossplane server show as ready while Systems Manager cannot see it?

Crossplane marks a server ready as soon as the cloud API creates the virtual machine. If Systems Manager cannot see it, check that the subnet has outbound routes and the instance profile has the right permissions.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

The query runs. The emails stay hidden.