Skip to main content

Manually Plan/Apply Namespace Resources

These steps are more or less what the concourse pipeline does.

Start in the appropriate branch of the environments repo

cd cloud-platform-environments
git checkout main
git pull
git checkout -b [BRANCH-NAME] origin/[BRANCH-NAME]

Set pingdom environment variables(Optional)

If the changes involve applying “pingdom_check”, set the environment variables for pingdom. The values are stored as secrets in manager cluster - concourse-main namespace.


Target the live-1 cluster

export AWS_PROFILE=moj-cp
export KOPS_STATE_STORE=s3://cloud-platform-kops-state
kops export kubecfg

Set some environment variables

export TF_VAR_cluster_name="live-1"
export TF_VAR_cluster_state_bucket=cloud-platform-terraform-state
export TF_VAR_cluster_state_key="cloud-platform/live-1/terraform.tfstate"
#needed by tf k8s provider
export KUBE_CONFIG_PATH=${HOME}/.kube/config

Set the namespace name

I’m using offender-events-dev for this example. Use whatever is relevant for your case.

export NAMESPACE=offender-events-dev

cd namespaces/${NAMESPACE}/resources

Terraform Init

terraform init \
  -backend-config="bucket=cloud-platform-terraform-state" \
  -backend-config="key=cloud-platform-environments/${NAMESPACE}/terraform.tfstate" \
  -backend-config="region=eu-west-1" \

Terraform Plan/Apply

terraform plan
This page was last reviewed on 7 July 2021. It needs to be reviewed again on 7 October 2021 by the page owner #cloud-platform .
This page was set to be reviewed before 7 October 2021 by the page owner #cloud-platform. This might mean the content is out of date.