Can you leave your managed AWS provider?
How to leave a managed AWS hosting provider without lock-in: who owns the account, the code, DNS and backups, and what a written exit should cover.
·
4 min read
Terraform is HashiCorp's infrastructure as code tool: you describe the cloud and on-premises resources you want in configuration files, then Terraform creates, changes or removes them to match. The habits around three commands, init, plan and apply, are what decide whether a change to your infrastructure is safe. Skip the review, or treat the state file casually, and it is easy to change the wrong thing.
You write the desired infrastructure in .tf files. terraform init is the first command after you write a new configuration or clone one from version control. It initialises the working directory, installs the required provider plugins, and sets up the state backend. It is safe to run more than once, and it will not delete your configuration or state.
This example pins the AWS provider, uses eu-west-2 (London), and declares one bucket.
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
}
provider "aws" {
region = "eu-west-2"
}
resource "aws_s3_bucket" "logs" {
bucket = "example-company-logs"
}
terraform plan compares current state with your configuration and proposes the create, update and destroy actions that would make the real infrastructure match. It does not carry out those changes. terraform apply executes a plan. Without a saved plan file, Terraform generates a new plan, prompts you to approve it, then performs the work. If you pass a saved plan file, it applies that plan and does not prompt again: passing the file is the approval.
terraform init
terraform plan -out=tfplan
terraform apply tfplan
A plan run without -out is a speculative plan: it shows what would happen, but it is not the plan you will apply. A later terraform apply generates a fresh plan, and other changes in the meantime can make the result different. Re-check the final, saved plan before you apply it, and read it for destroy and replace actions, not only creates. A saved plan file is applied without a second confirmation, so skip that review and you can apply a plan you never saw, including destroys that were not in the earlier output.
By default, Terraform stores state in a local file named terraform.tfstate, which maps your configuration to the real resources. If you lose it, Terraform no longer knows what it manages. On a shared account, put state in a remote backend with locking and access control, and keep it out of version control. A local or committed state file can expose secrets and cannot stop two people applying at once. Treat saved plan files the same way.
If the backend supports it, Terraform locks state automatically for every operation that could write it. If it cannot acquire the lock, it stops. Not every backend supports locking. On the S3 backend, locking is opt-in: set use_lockfile to true, because it defaults to false. DynamoDB-based locking is deprecated and will be removed in a future minor version. You can configure both while migrating off it. Turn on versioning on the state bucket as well, so you can recover the state if a bad write overwrites it.
If you need to document an existing estate in Terraform, or to set up remote state and locking on a shared account, that is a good point to bring in help.
In the terraform block, required_providers should name the source and a version constraint. In a root module, use a ~> constraint, which lets only the rightmost version component increment and so sets an upper bound. version = "~> 6.0" accepts later 6.x releases of the AWS provider and refuses 7.0. Leave it unpinned and a later init can pull a breaking major release into a working estate. If Terraform cannot satisfy the constraint, it will not run plan, apply or state operations. After init, commit the dependency lock file so later inits select the same provider versions.
Do not put passwords, API tokens or access keys in .tf files, and do not commit them to git. Marking a variable sensitive = true only redacts it in the CLI output. Terraform still stores those values in state and plan files, and anyone who can read the files can read the secrets. Keep state and saved plans out of git, and use a remote backend with access control and encryption at rest.
Do not begin by importing a whole production account. Write a small configuration, like the bucket above, run the workflow, and read the plan. Once you know how to use Terraform on something small you can afford to get wrong, widen the scope. If you are moving an existing app onto AWS, describe the new side in code and prove it before you cut over.
The AWS accounts should be yours, not a supplier's login. That is the same ownership point as leaving a freelancer with your AWS root login: you keep the account, and anyone helping you works inside it. Eight Mile builds and runs infrastructure on AWS as code, and can document an existing estate in Terraform, with UK and EU regions as the default.
If you want infrastructure described in code, on accounts you own, talk to an engineer. The conversation is a free scoping chat; you get a written scope and price, and billing starts only once that scope is agreed.
How to leave a managed AWS hosting provider without lock-in: who owns the account, the code, DNS and backups, and what a written exit should cover.
·
4 min read
Moving your app onto AWS without a weekend of downtime: build a staging copy first, plan the DNS switch, and keep a way back.
·
4 min read
Why your AWS bill and your management fee are two different bills, what the fee should cover, and how to keep usage charges predictable.
·
4 min read
What managed AWS hosting includes, and what stays on you: patching, backups, monitoring, and the account, app, data and access decisions you still own.
·
4 min read
Leaving a freelancer with your AWS root login is a risk even after a good build. How to take back control with named IAM, MFA and a handoff.
·
4 min read
When you need Terraform (and when you don’t): honest triggers for IaC vs console, scripts, or managed PaaS.
·
3 min read
The EC2 server nobody has patched since launch is a risk once the OS is out of support. What to check, and what managed patching should include.
·
4 min read
Cloud bill went up and nobody can say why: usually orphaned resources, missing tags, or one shared account. Fix ownership first.
·
3 min read
AWS vs managed hosting for a small SaaS: when simple platforms fit, and when owned cloud, IAM and infra in git win.
·
3 min read
Why the AWS bill now includes AI, how agent workflows make that spend move, and what to put in place before a pilot becomes a surprise.
·
3 min read
Can AI extract your invoices and job sheets? What it can pull, where a person should still check, and how a first build is scoped.
·
3 min read
What AI can safely do in your customer portal, the UK GDPR points to check, and how to start with one small feature.
·
4 min read
What to check before you inherit a custom app: code and deploy-key control, tests, patches, and whether a fix can ship tomorrow.
·
4 min read
What a website quote should include beyond the build: hosting, domain ownership, care and who fixes the site at 2am.
·
4 min read
When the office broadband dies and nobody has a backup, work stops. What fails, why a hotspot is not a plan and what tested failover looks like.
·
3 min read
The agency that built your website has disappeared. How to recover access, move hosting and DNS into the business, and choose care or a rebuild.
·
4 min read
CRM for a small firm off the shelf or built: when HubSpot-class tools fit, and when a system on your own job data serves trades and clinics better.
·
4 min read
Uptime monitoring for a small business website only works with a named engineer and response path. What a care plan or managed hosting should cover.
·
3 min read
If your website form still emails one person's Gmail, enquiries vanish when they're away, and a shared lead list with an owner fixes it.
·
4 min read
When WhatsApp is running your jobs, groups and voice notes become the job board. What a proper ops system replaces, without taking phones away.
·
4 min read