Cloud Governance
Enforcing UK Data Residency Across AWS, Azure, and GCP Without Breaking CI/CD
Selecting London at checkout is not enough. Here is how to write technical guardrails using AWS SCPs, Azure Policy, and GCP Organization Policy constraints so workloads stay inside UK borders.
· 6 min read · Zolvexa Ltd
Picking London in a console drop-down sets a default. It does not stop a pipeline, a script or a colleague from creating a resource in us-east-1, and it does nothing about the replicas, backups and log exports that quietly follow the primary copy. If a contract or a regulator says the data stays in the UK, the restriction has to sit at the organisation policy layer, where no individual account or project can override it.
This article sets out how we enforce UK residency on each of the three major clouds, and how to stop those guardrails from breaking the deployment pipeline on the day they are switched on.
Decide what has to stay in the UK
Start with an inventory, not a policy. List the data sets the obligation covers, then follow each one: where the primary copy lives, where backups and snapshots are written, where logs are shipped, and which managed services process it on the way. Backups are the usual surprise. A cross-region backup rule set up for resilience can move a full copy of a database to Ireland or Frankfurt without anyone noticing.
- Primary storage: databases, object storage, file shares and block volumes.
- Copies: snapshots, backup vaults, replicas and disaster recovery targets.
- Telemetry: application logs, audit trails and metrics that contain personal data.
- Processing: managed analytics, AI and search services that read the data.
AWS: a region-deny service control policy
On AWS the control is a service control policy (SCP) attached to the organisation root or to the organisational units that hold regulated workloads. It denies any request whose aws:RequestedRegion is not eu-west-2. Global services such as IAM, Organizations, Route 53 and CloudFront are served from us-east-1 behind the scenes, so they are exempted with NotAction or the policy will lock you out of your own identity configuration.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideLondon",
"Effect": "Deny",
"NotAction": [
"iam:*",
"organizations:*",
"sts:*",
"route53:*",
"cloudfront:*",
"support:*",
"budgets:*",
"ce:*",
"health:*",
"account:*"
],
"Resource": "*",
"Condition": {
"StringNotEquals": { "aws:RequestedRegion": ["eu-west-2"] },
"ArnNotLike": { "aws:PrincipalARN": ["arn:aws:iam::*:role/BreakGlassAdmin"] }
}
}
]
}If you run AWS Control Tower, use its built-in Region deny control instead of writing your own. It applies the same logic and Control Tower keeps the exemption list current as AWS adds global services. Either way, keep a named break-glass role outside the deny and alert on every use of it.
Azure: Allowed locations at the root management group
Azure has two built-in policy definitions for this: Allowed locations, which applies to resources, and Allowed locations for resource groups. Assign both at the intermediate root management group with uksouth and ukwest as the only permitted values. The built-in definitions use the Deny effect and already ignore resources whose location is global, such as Azure DNS zones and Front Door profiles.
az policy assignment create \
--name allowed-locations-uk \
--display-name "Allowed locations: UK only" \
--policy e56962a6-4747-49cd-b67b-bf8b01975c4c \
--scope "/providers/Microsoft.Management/managementGroups/<root-mg-id>" \
--params '{ "listOfAllowedLocations": { "value": ["uksouth", "ukwest"] } }'Assign it at the management group, not at each subscription. A subscription owner can delete an assignment made at their own scope, but not one inherited from above.
Google Cloud: the resource locations constraint
Google Cloud uses the gcp.resourceLocations organisation policy constraint. Set it at the organisation node and allow only the London value group. The constraint is checked when a resource is created, so it will not move anything that already exists elsewhere. Run an asset inventory export first and deal with any stragglers by hand.
name: organizations/ORGANISATION_ID/policies/gcp.resourceLocations
spec:
rules:
- values:
allowedValues:
- in:europe-west2-locationsApply it with gcloud org-policies set-policy policy.yaml. Not every Google Cloud service supports the constraint, so check the supported services list for anything regulated data passes through.
Keep the pipeline working
Region guardrails rarely break applications. They break pipelines, because build tooling is full of quiet us-east-1 defaults. The fixes are routine once you know where to look.
- Set the region explicitly in every pipeline (AWS_REGION, the Azure location parameter, the gcloud compute/region property) instead of relying on a default.
- Keep Terraform state buckets and lock tables in eu-west-2. A state bucket created years ago in us-east-1 is the most common first failure.
- Declare a separate provider alias for the few resources that must live in us-east-1, such as ACM certificates for CloudFront, and add that exact action to the SCP exemption.
- Run the same rules as policy as code in CI (Checkov or OPA) so a pull request fails with a readable message instead of an AccessDenied halfway through an apply.
- Roll the guardrail out to a sandbox organisational unit first and read the denied calls in CloudTrail, Azure Activity Log or Cloud Audit Logs before widening it.
Show that it works
An auditor will ask for evidence that the control operates, not a copy of the policy. Produce a monthly report from AWS Config, Azure Policy compliance or Cloud Asset Inventory that lists every resource outside the permitted regions. The expected number is zero, and every exception should have a ticket explaining why it exists.
If you want a second pair of eyes on your residency controls, talk to us or read how we approach UK regulatory compliance.
