Common issues and solutions for the TechCorp Infrastructure lab.
Problem: AWS credentials not configured.
Solution:
# Set environment variables
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
# Or configure AWS CLI
aws configureProblem: S3 backend bucket doesn't exist or you don't have access.
Solution:
# For the lab, you may need to use local backend temporarily
# Comment out the backend block in backend.tf and run:
terraform initProblem: Infoblox API credentials not set.
Solution:
export BLOXONE_API_KEY="your-api-key"
export BLOXONE_CSP_URL="https://csp.infoblox.com"Problem: Resource was created outside of Terraform (manual UI creation).
Solution:
# Import the existing resource into Terraform state
terraform import <resource_type>.<name> <resource_id>
# Or remove the manually-created resource from the UI and re-run
terraform applyProblem: Another Terraform process has the state locked, or a previous run crashed.
Solution:
# Force unlock (use with caution — make sure no one else is running)
terraform force-unlock <lock-id>Problem: Someone modified resources manually via the UI.
Solution:
# Review the drift
terraform plan
# Accept and fix the drift
terraform applyProblem: Infoblox Ansible collection not installed.
Solution:
ansible-galaxy collection install infoblox.universal_ddiProblem: API credentials are wrong or expired.
Solution:
# Verify your credentials
echo $BLOXONE_API_KEY
echo $BLOXONE_CSP_URL
# Test with curl
curl -s -H "Authorization: Token $BLOXONE_API_KEY" \
"$BLOXONE_CSP_URL/api/ddi/v1/ipam/ip_space"Problem: Required variables not passed to the playbook.
Solution:
# Pass required variables with -e
ansible-playbook ansible/playbooks/dns-records.yml \
-e "zone_id=your-zone-id"Problem: Network connectivity to the Infoblox CSP API.
Solution:
# Test connectivity
curl -v "$BLOXONE_CSP_URL/api/ddi/v1/dns/auth_zone"
# Check if behind a proxy
echo $http_proxy
echo $https_proxyProblem: SSH key not configured for GitHub.
Solution:
# Generate SSH key
ssh-keygen -t ed25519 -C "your-email@example.com"
# Add to SSH agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Copy public key and add to GitHub Settings > SSH Keys
cat ~/.ssh/id_ed25519.pubProblem: Wrong repo URL or no access.
Solution:
# Use HTTPS instead of SSH
git clone https://github.com/<org>/techcorp-infrastructure.gitProblem: Workflow file not in the default branch or path filters don't match.
Solution:
- Ensure workflow files are in
.github/workflows/on themainbranch - Check that your changes match the
pathsfilter in the workflow - Use
workflow_dispatchto trigger manually
Problem: GitHub Secrets not configured for the repository.
Solution:
- Go to Repository Settings > Secrets and variables > Actions
- Add the following secrets:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYBLOXONE_API_KEYBLOXONE_CSP_URL
Problem: The if condition prevents apply on PRs (by design).
Solution:
- Terraform Apply only runs on merge to
main, not on PRs - PRs only trigger
terraform planfor review - Merge the PR to trigger the full apply
| Issue | Solution |
|---|---|
| Terminal unresponsive | Refresh the browser tab |
| VS Code not loading | Wait 30 seconds, then refresh |
| Environment variables reset | Re-run the setup script or source the env file |
| Terraform state corrupted | Delete .terraform/ directory and re-run terraform init |
| Issue | Solution |
|---|---|
| Multiple Terraform versions | Use tfenv to manage versions |
| Python version conflicts | Use pyenv or virtual environments |
| Ansible version mismatch | Use pipx install ansible for isolation |
- Check this troubleshooting guide
- Review the error message carefully — it usually tells you what's wrong
- Ask the instructor or TA
- Check the Infoblox Universal DDI documentation
- Check the Terraform BloxOne Provider documentation