ExercisesExercisesContact ↗Contact ↗ (opens in a new tab)
GitHubGitHub (opens in a new tab)
  • Introduction
    • Prerequisites
    • Git
    • Linode API
    • Akamai API
    • Declarative Language
    • Core Workflow
    • Providers
    • Data Sources
    • Resources
    • Outputs
      • Variables
      • Locals
      • Environment Variables
    • Expressions
      • References to Values
      • Conditionals
      • For Iterations
      • Dynamic Blocks
    • Meta-Arguments
      • depends_on
      • count
      • for_each
      • lifecycle
    • Built-In Functions
      • Root & Child Modules
      • Module Outputs
    • State File
      • State Storage
      • State Locking
      • State Best Practices
    • Imports
    • Troubleshooting
    • Akamai Examples
    • Akamai Terraform Provider (opens in a new tab)
    • Linode Terraform Provider (opens in a new tab)
    • All Exercises
  • 3 Ex Providers
  • 4 Ex Data Sources
  • 5 Ex Resources
  • 6 Ex Outputs
  • 7a Ex Variables
  • 7b Ex Locals
  • 7c Ex Env Variables
  • 8b Ex Conditionals
  • 8c Ex for Loops
  • 8d Ex Dynamic Blocks
  • 9a Ex Depends On
  • 9b Ex Count
  • 9c Ex for Each
  • 9d Ex Lifecycle
  • 10 Ex Built in Functions
  • 11 Ex Modules
  • 12 Ex State Storage
  • 13 Ex Imports
  • 14 Ex Troubleshooting
Question? Give us feedback → (opens in a new tab)Edit this page
Exercises
8b Ex Conditionals

Configure

Define a new variable named ab_test and give it a default value of "A".

Update

In your property created in the Exercise #2 in module 5. Resources create a condition for the origin name based on the variable ab_test. That is if ab_test="A" go to Origin A (e.g. origin-a.example.com), else go to Origin B (e.g. origin-b.example.com).

Plan/Apply

Run terraform a few times and modify the value of ab_test each time.

Commit

  1. Commit your change and push it to GitHub.
7c Ex Env Variables8c Ex for Loops

2024 Advanced Solutions Team - Akamai Technical Documentation