When your customer won't run your Terraform

  • Alon Gubkin
5 min read

Your customer's security team just read your Terraform module.

They said no.

You're surprised. Terraform is the standard. Their own platform team uses it every day. You spent a week making the module clean.

But they didn't reject Terraform. They rejected what your module asks them to trust.

Why they said no

Look at your module the way their reviewer does. They read every line, because they are responsible for what it does to their account.

It's big. A module that installs a real product creates VPCs, buckets, queues, IAM roles and policies. That's hundreds of lines across a dozen files, plus the modules it pulls in.

It needs admin to apply. Creating IAM roles takes IAM permissions. So someone with near-admin credentials has to run terraform apply on code they didn't write.

It changes every release. Version 1.4 adds a queue. Version 1.5 widens a policy. Each version is a new review, and the module doesn't say which changes matter.

It doesn't say what you can do afterwards. The reviewer's real question is "what can the vendor do in our account once this is applied?" The answer is spread across aws_iam_policy_document blocks in five files.

It doesn't fit how they work. Some teams only deploy through their own pipeline. Some standardize on CloudFormation, or on Argo CD for anything in Kubernetes. Some want to click through the console and see each resource.

None of these is about the tool. Rewriting the same install in CloudFormation gets the same answer.

What they would say yes to

The same teams usually accept an install that looks like this.

They run it once. They apply it with their own credentials, in their own process, and then it's done.

A short list of what you can do afterwards. Which identity you use, what it may touch, and how they turn it off.

A diff per release. When a release needs them again, they review what changed, not the whole thing.

That's a different install, not a different file format.

Make the install small

Split your stack into two kinds of resources.

Some resources hold the customer's data or define the trust boundary: the bucket with their documents, the network, the role you manage the deployment with. These the customer's admin creates once. After that, you can't change or delete them.

Everything else can change with each release: functions, containers, queues, an index you can rebuild. You manage these with a scoped role the install created.

Alien calls these frozen and live resources:

alien.ts
export default new alien.Stack("acme-docs")
  .add(documents, "frozen") // the admin creates it at initial setup
  .add(index, "live")       // Alien updates it on every release
  .add(processor, "live")
  .build()

The reviewer now reads a short install: the frozen resources and one management role. They review it once.

The role is where the trust goes, so it has to be narrow. On AWS, Alien's management role can be assumed only by Alien's managing role, named by exact ARN. Its permissions are scoped to the deployment's resource name prefix. Every IAM role it creates must carry a permissions boundary, so it can't grant itself admin access. The customer revokes everything by deleting the role or the stack. The AWS guide has the full policy.

That gives the reviewer the short list they asked for:

QuestionAnswer
Who can act in our account?One role, assumable only by one ARN
What can it touch?Resources with the deployment's name prefix
Can it escalate?No. Every role it creates carries a permissions boundary
What can it never change?The frozen resources
How do we turn it off?Delete the role or the stack

Then give it to them their way

Once the install is small, the format matters less. Ship it in the formats admins already accept:

Their team usesGive them
The AWS consoleA CloudFormation template they open, read and launch
Terraform, in their own pipelineTerraform modules, pinned per release
Argo CD or FluxA Helm chart and one file to commit
NeitherA setup CLI they run with their own credentials
Google CloudGoogle sign-in, with no package at all

Their reviewer can read any of them before anything runs. With Alien, alien render writes the CloudFormation template, Terraform modules or Helm chart on your machine:

alien render --format cloudformation --stack .alien/build/aws/stack.json --output review/

For a customer who wants to create everything by hand, the short list helps too. But every hand-built setup ends up slightly different, and nobody can tell later whether it still matches. Use it for one customer, not ten.

When a release needs them again

Most releases change only live resources, so they roll out without the customer.

A release that changes a frozen resource or needs a new permission is different. Alien holds it for that deployment, and the deployment keeps running the previous release. The admin reruns the install with the method they used the first time, reviewing only what changed.

Keep these releases rare. Tell the customer before you ship one.

Where Alien fits

You may not need Alien for this. One customer on one cloud, with a careful module and a written permission list, is a fine answer.

It gets hard at the second and third customer. One wants CloudFormation, one wants Helm, one wants to click through the console, and each format drifts from the others.

Alien builds the CloudFormation template, Terraform modules, Helm chart and setup CLI from one stack definition, for every release. The deployment portal hands each admin the method their team accepts. Your control plane stays in your cloud. Only the data plane goes into theirs, and it connects out. See setup packages, frozen and live resources and the Infrastructure product page.

Related reading: what BYOC is, how to update software in customer clouds and debugging customer deployments without SSH.