Migration Troubleshooting
This page covers common issues encountered during NTC module migrations and their solutions.
For version-specific migration issues, refer to the individual module migration guides (e.g., v1→v2 NTC Organizations).
Provider Issues
Error: Unsupported AWS Provider Version
Symptom:
Error: Unsupported Terraform Core version
This configuration does not support Terraform version X.X.X
Solution: Update your Terraform CLI to minimum requirements:
# Check current version
terraform version
# Update via package manager (example for macOS)
brew upgrade terraform
# Or download from terraform.io
Error: Provider Configuration Not Present
Symptom:
Error: Provider configuration not present
provider "registry.terraform.io/hashicorp/aws"
Solution:
Run terraform init -upgrade to fetch the new provider version:
terraform init -upgrade
Error: Invalid Provider Configuration
Symptom:
Error: Unsupported argument
on main.tf line X: region attribute is not expected
Solution: This occurs when using v2 module configuration with AWS Provider v5. Ensure you've updated to provider v6:
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0" # Must be v6
}
}
State Migration Issues
Resources Being Recreated Instead of Moved
Symptom:
terraform plan shows:
# module.ntc_organizations... will be destroyed
# module.ntc_organizations... will be created
Solution:
-
Verify state addresses - List current resources:
terraform state list | grep ntc_delegated_admins -
Check moved block accuracy - Ensure
fromaddress matches exactly:# If your state shows:
# module.ntc_delegated_admins_euc1.aws_organizations_delegated_administrator.admin["config.amazonaws.com"]
# Your moved block should be:
moved {
from = module.ntc_delegated_admins_euc1.aws_organizations_delegated_administrator.admin["config.amazonaws.com"]
to = module.ntc_organizations.module.admin_delegations.aws_organizations_delegated_administrator.ntc_delegated_admin["config.amazonaws.com"]
} -
Apply in stages - Comment out unrelated moved blocks and migrate incrementally
Error: Moved Block Conflicts
Symptom:
Error: Moved object to conflicting destination
Solution: Two moved blocks may target the same destination. Check for duplicates:
grep -n "to =" state_migrations.tf | sort -k2
Remove or correct duplicate moved blocks.
Error: Resource Not Found in State
Symptom:
Error: Invalid move operation
The source object does not exist in current state
Solution:
This means the from address doesn't exist. Possible causes:
- Already migrated - Resource may have been migrated in a previous run
- Typo in address - Verify with
terraform state list - Resource never existed - Remove the moved block
# Check if resource exists
terraform state show 'module.ntc_delegated_admins_euc1.aws_organizations_delegated_administrator.ntc_delegated_admin["config.amazonaws.com"]'
Configuration Issues
Missing Required Argument
Symptom:
Error: Missing required argument
The argument "X" is required, but no definition was found.
Solution: Check the module documentation for the target version to identify new required arguments. Add the missing argument to your configuration:
module "example" {
source = "github.com/nuvibit-terraform-collection/terraform-aws-ntc-module?ref=X.X.X"
new_required_argument = "value" # Add missing argument
# ... rest of configuration
}
Invalid Variable Type or Structure
Symptom:
Error: Invalid value for "variable_name" variable
Solution: Variable structures may change between versions. Review the migration guide for the specific module to understand the new structure. Common patterns:
- Flat list → nested map
- String → object with multiple attributes
- Single value → list of values
Check the module's migration documentation for before/after examples.
Provider Alias Configuration Errors
Symptom:
Error: provider.aws.alias: no suitable version installed
Solution: Ensure all required provider aliases are configured:
provider "aws" {
alias = "alias_name"
region = "region-name"
}
Review the module documentation to understand which provider aliases are required.
AWS Sovereign Cloud Issues
Region Not Available in Sovereign Cloud
Symptom:
Error: Invalid AWS Region
The specified region is not available in this partition
Solution:
AWS European Sovereign Cloud has different region codes:
| Commercial Region | ESC Region |
|---|---|
| eu-central-1 | Not available (use eusc-de-east-1) |
| us-east-1 | Not available |
Update your region configuration for ESC:
region = "eusc-de-east-1" # ESC region
Service Not Available in Sovereign Cloud
Symptom:
Error: Service X is not available in this region
Solution:
Some AWS services aren't available in sovereign clouds. Check service availability:
- Review AWS documentation for service availability in your partition
- disable unsupported features
locals {
is_sovereign_cloud = data.aws_partition.current.partition != "aws"
}
module "ntc_organizations" {
source = "..."
# NOTE: service quota templates are currently not supported in the ESC
service_quota_templates = []
}
Performance Issues
Terraform Plan Takes Very Long
Symptom: Plan operation takes 5+ minutes
Solution:
-
Use targeted plans during migration:
terraform plan -target=module.ntc_organizations -
Break migration into steps:
- First migrate state (with moved blocks)
- Then update configuration
- Finally clean up
-
Reduce parallelism if API throttling occurs:
terraform plan -parallelism=5
API Rate Limiting
Symptom:
Error: ThrottlingException: Rate exceeded
Solution:
AWS Organizations API has rate limits. Options:
- Retry with exponential backoff (automatic in most cases)
- Reduce parallelism:
terraform apply -parallelism=3 - Request limit increase from AWS Support (if frequent issue)
Validation Issues
Resources Exist But Not in Expected State
Symptom: After migration, resources look different in AWS Console
Solution:
-
Check resource attributes:
terraform state show 'module.ntc_organizations.aws_organizations_organization.ntc_org' -
Refresh state:
terraform refresh
terraform plan -
Compare with AWS Console to identify drift
Rollback Procedures
Rolling Back a Failed Migration
If migration fails and you need to rollback:
-
Restore Terraform state backup:
# Local state
cp terraform.tfstate.backup terraform.tfstate
# S3 state
aws s3 cp ./terraform.tfstate.backup s3://your-bucket/path/to/terraform.tfstate -
Revert configuration changes:
git revert <migration-commit-sha> -
Revert provider version (if changed):
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0" # Revert to previous version
}
} -
Re-initialize:
terraform init -upgrade
terraform plan # Should show no changes
Getting More Help
If you're still stuck:
1. Enable Debug Logging
export TF_LOG=DEBUG
export TF_LOG_PATH=./terraform-debug.log
terraform plan
Review the log for detailed error information.
2. Contact Support
Provide this information when contacting support:
- Module name and versions (e.g., v1.x → v2.x)
- Terraform version (
terraform version) - Provider versions (e.g., AWS Provider version)
- Redacted error messages
- Relevant configuration snippets
- Debug logs (if applicable)