Skip to main content

Long-running environments operations

Some operations on namespaces in the Cloud Platform can take a long time to complete, e.g. upgrading an RDS instance from one version to another.

This means a scheduled apply pipeline run might try to operate on a namespace while it is being modified.

We use Terraform state locking to ensure that this does not cause serious problems, but at the least it would cause the Apply Pipeline to timeout with an error if it can’t acquire a lock on the target namespace’s terraform state.

For this reason, we have a mechanism to allow the Apply Pipeline to skip individual namespaces during long-running operations.

To use this feature:

  1. Prepare the terraform code change which implements your namespace change.
  2. Before raising your PR, include a file called APPLY_PIPELINE_SKIP_THIS_NAMESPACE (this file merely has to exist - its contents are irrelevant).

The file needs to be in the top-level folder for your namespace, e.g: namespaces/live-1.cloud-platform.service.justice.gov.uk/mynamespace/APPLY_PIPELINE_SKIP_THIS_NAMESPACE

  1. Raise your PR, and approve it when it is merged.
  2. After your change has completed successfully, raise another PR to remove the APPLY_PIPELINE_SKIP_THIS_NAMESPACE file.

Skip “live-1” environments during migration

When you migrate your namespace environment to “live”, a file called MIGRATED_SKIP_APPLY_THIS_NAMESPACE is added to your namespace repository in live-1, this will allow the Apply Pipelines to skip individual namespaces in “live-1”, to avoid resource conflicts during migration.

This page was last reviewed on 17 November 2021. It needs to be reviewed again on 17 February 2022 .
This page was set to be reviewed before 17 February 2022. This might mean the content is out of date.