The Simplest Way to Make Argo Workflows and Cloudformation Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair argo workflows and cloudformation by running stack tasks inside Kubernetes pods. This setup lets your team build cloud resources and run container jobs in order. Argo handles the order of your steps inside the cluster. CloudFormation reads your templates and builds the cloud services you need. When you link them, one workflow can make a database and run a test. How argo workflows and cloudformation share roles and data Each step in an Argo workflow runs as its own pod in Kubernetes.

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.

You pair argo workflows and cloudformation by running stack tasks inside Kubernetes pods. This setup lets your team build cloud resources and run container jobs in order.

Argo handles the order of your steps inside the cluster. CloudFormation reads your templates and builds the cloud services you need. When you link them, one workflow can make a database and run a test.

How argo workflows and cloudformation share roles and data

Each step in an Argo workflow runs as its own pod in Kubernetes. To call AWS, that pod needs a valid cloud role with clear rules. The best way to log in is through cluster service account tokens.

Your cluster maps a Kubernetes service account to an AWS role. When the workflow pod starts, AWS checks the token and gives temporary keys. You do not need to save static keys inside your workflow files.

Data moves between the two tools through template inputs and stack outputs. An early step in your workflow can build an input list for the stack. The pod sends that list to AWS and waits for the stack to finish.

Once the stack is ready, the pod reads the new output values. It saves those values as workflow files so the next pod can read them. This keeps resource names and endpoints moving from step to step.

Common failure modes and how to scope roles

Many teams fail because they share one huge role across all workflow pods. If every pod can change any stack, one bad step can break production. Static keys stored in cluster secrets also create big risks when people leave.

Another common issue happens when a workflow times out while a stack still runs. Argo marks the pod as failed, but AWS keeps building the cloud resources. When the workflow tries again, it hits a conflict because the stack is busy.

Access Request Workflows + CloudFormation Guard: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix role bloat by making small service accounts for each task. Give the build step a role that can only touch one stack type. Give the cleanup step its own role with rules to delete only test stacks.

You also need to set up a service role for CloudFormation itself. The pod role should only have rules to start the stack run. CloudFormation then uses its own service role to make the actual cloud items.

Handling stack wait times and state drift

Cloud stacks often take a long time to finish their work. If a pod just fires a request and exits, the next step fails. Your workflow pod must poll the stack status until AWS reports a final state.

You should also add an exit handler to your workflow setup. If a test step fails, the exit step can trigger a stack cleanup. This stops broken test runs from leaving costly cloud items behind all week.

Make sure every stack name includes a unique run ID from the workflow. This stops two workflow runs from fighting over the same stack name. It also helps your team trace each cloud stack back to one workflow log.

Keep your network paths tight between the cluster and the cloud API. Use private endpoints inside your cloud network so stack calls stay off the internet. Check your cloud logs often to see which workflow pod started each change.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How does an Argo pod log in to run a CloudFormation stack?

Map a Kubernetes service account to an AWS role using web identity tokens. The pod gets short-lived keys when it starts and never stores static secrets.

What happens if an Argo step fails while a stack is still building?

The stack keeps running in AWS even after the pod stops in Kubernetes. Use an exit handler in your workflow to wait for or cancel the stack.

How do I pass CloudFormation outputs to the next workflow step?

Have the pod query the stack outputs after the build finishes and write them to a file. Argo can read that output file and pass the values to the next pod.

The query runs. The emails stay hidden.