Skip to content

Provisioning PLTE Environments

How to create and manage Production-Like Test Environments.

Ephemeral PLTE Lifecycle

Step 1: Trigger

PLTE provisioning is triggered by:

  • Merge to main branch
  • Release candidate creation
  • Manual request for topic branch testing

Step 2: Provision (5-10 minutes)

Create infrastructure from IaC templates:

# Terraform example
terraform init
terraform plan -var="environment=plte-${BUILD_ID}"
terraform apply -auto-approve

Step 3: Deploy

Install application and seed test data:

# Deploy application
kubectl apply -f k8s/deployment.yaml

# Seed test data
./scripts/seed-test-data.sh

Step 4: Test (1-4 hours)

Run acceptance and extended tests:

# Acceptance tests (IV, OV, PV)
r2r eac test acceptance

# Extended tests (performance, security)
r2r eac test extended

Step 5: Destroy

Tear down infrastructure after testing:

terraform destroy -auto-approve

Infrastructure as Code Template

# plte/main.tf
variable "environment" {
  description = "PLTE environment identifier"
}

resource "azurerm_resource_group" "plte" {
  name     = "rg-plte-${var.environment}"
  location = "westeurope"

  tags = {
    environment = "plte"
    ephemeral   = "true"
    build_id    = var.environment
  }
}

# Add app services, databases, etc.

Cost Management

  • Short-lived: Hours, not days
  • Automated cleanup: Destroy after testing
  • Resource limits: Prevent overprovisioning
  • Scheduled cleanup: Nightly job to catch orphans
# Cleanup orphaned PLTEs older than 24 hours
./scripts/cleanup-old-plte.sh --max-age 24h

PLTE Characteristics

  • Production-like infrastructure
  • Production-like configuration (without production credentials)
  • Realistic test data (anonymized)
  • Isolated per feature/release
  • Network isolation for security

Tutorials | How-to Guides | Explanation | Reference

You are here: Explanation — understanding-oriented discussion that clarifies concepts.