The Simplest Way to Make Step Functions and Ubiquiti Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Step Functions and Ubiquiti work together by running cloud state machines that manage local network gear. Teams use this setup to automate port changes, reboot hardware, and check site health. A cloud workflow orders each step, handles retries, and logs the outcome. Your local network controller receives these requests and updates switches, routers, and Wi-Fi access points. Putting them together turns manual network chores into repeatable jobs. How step functions and ubiquiti pass data and ke

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.

Step Functions and Ubiquiti work together by running cloud state machines that manage local network gear. Teams use this setup to automate port changes, reboot hardware, and check site health.

A cloud workflow orders each step, handles retries, and logs the outcome. Your local network controller receives these requests and updates switches, routers, and Wi-Fi access points. Putting them together turns manual network chores into repeatable jobs.

How step functions and ubiquiti pass data and keys

First, an event in your cloud account starts a state machine run. The state machine calls a small compute task to talk to your network controller. That task reads a stored secret to log in to the Ubiquiti API.

Next, the compute task sends an HTTPS request to the controller endpoint. The controller checks the user role attached to that login key. If the role allows the action, the controller applies the change to the local hardware.

Then, the controller sends a status reply back to the cloud task. The state machine reads that reply and picks the next step in the workflow. If a device is busy, the state machine waits and tries the call again later.

Good setups separate read tasks from write tasks. A health check workflow only needs a read role on the network controller. A workflow that changes firewall rules or VLAN tags needs a narrow write role. Keeping these roles separate limits the damage if a key leaks.

Common failure modes and how to scope network paths

Many teams start by sharing one master admin account across all cloud workflows. This shared account makes it impossible to see which workflow broke a network rule. If an automation script goes wrong, it can lock out the whole site.

Broad API keys create another big risk. A key with full site admin rights can wipe out Wi-Fi settings or open ports. You should create a dedicated local user for each workflow instead. Give each user only the permissions needed for its specific job.

Cloud Functions IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network reachability between the cloud and local gear also causes trouble. Opening your local controller port to the public internet invites constant attacks. Teams should link their cloud VPC to the local site over a private VPN tunnel. This private path keeps all API traffic off the public web.

Unlogged queries and blind retries can also hurt your local controller. If a workflow retries too fast, it can flood the controller and drop active sessions. Set clear retry limits and back-off timers in every state machine step.

Finally, watch out for personal data in device logs. Client lists often hold user emails and phone numbers. Masking rewrites matched fields in results so raw emails or phone numbers do not leak into cloud logs. Always record who triggered the state machine and what change the controller made.

Designing safe retry and error rules

Network gear takes time to apply new settings and reboot ports. If a cloud task times out too soon, the state machine marks the step as failed. In reality, the switch might still be finishing the update.

Build a status check loop into your state machine design. After sending a change request, wait thirty seconds and read the device state. Only move to the final step when the controller reports the device is ready.

When a step fails after three tries, send an alert to the network team. Include the workflow run ID and the target site name in that message. Clear error steps stop bad changes from spreading across your other office sites.

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

How does a cloud state machine reach a local Ubiquiti controller?

The state machine triggers a worker task inside a private cloud network. That worker sends requests through a site-to-site VPN tunnel to the local controller IP.

Why should we avoid using one admin login for all workflows?

A shared admin login hides which workflow made a bad change during an outage. Separate accounts let you limit permissions and revoke one key without breaking other jobs.

How do we handle controller rate limits during big updates?

Add wait states and slow back-off timers between steps in your state machine. You can also limit how many branches run at once so the controller stays stable.

The query runs. The emails stay hidden.