Skip to main content

WWW Deployment SOP (discountcloud.io)

This document describes how to configure and deploy the www site for discountcloud.io using Terraform and Cloudflare. The setup manages DNS and Cloudflare Zero Trust so that only opsZero team members can access the site.

Overview​

The Cloudflare configuration for the site is located in:

infra/cloudflare/

Terraform creates and manages:

  • A DNS CNAME record for www
  • A Cloudflare Access application
  • An Access policy allowing only @opszero.com users

Prerequisites​

You will need:

  • Access to the Cloudflare account for discountcloud.io
  • A Cloudflare API token with:
    • Zone: Read/Write
    • Access: Edit

Create a local terraform.tfvars file (this file should not be committed):

terraform.tfvars
api_token = "YOUR_CLOUDFLARE_API_TOKEN"
zone_id = "f40bdf9b2a36fb51a6dc324a922c99a3"
domain = "discountcloud.io"

Deployment​

From the Cloudflare directory:

cd infra/cloudflare

Initialize Terraform:

terraform init

Preview changes:

terraform plan

Apply the configuration:

terraform apply

Approve with yes when prompted.

Terraform will create the DNS record, Access application, and allow policy.

Verification​

DNS​

In Cloudflare → DNS, confirm the entry:

CNAME  www  discountcloud.io  Proxied

Access Application​

Cloudflare Zero Trust → Access → Applications

You should see an application for:

www.discountcloud.io

Access Policy​

Inside the application, ensure the policy allows:

*@opszero.com

Test​

Open:

https://www.discountcloud.io

In an incognito window, it should show the Cloudflare Access login.

caution

Only users with @opszero.com email addresses will be able to access the site.

Updating​

Any time Terraform files are changed:

terraform plan
terraform apply

Terraform will update the existing Cloudflare resources.