-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors in multi region AWS resources import #1887
Comments
A quick workaround that helped me was to clear the config cache explicitly before initiating the import for each region. You can achieve this by modifying the Here's a brief patch that you might find useful: func (s *AWSService) generateConfig() (aws.Config, error) {
// Clear the cache to ensure a fresh config is generated for each region
configCache = nil
if configCache != nil {
return *configCache, nil
}
...
} This change forces Terraformer to generate a new configuration for each region, which should prevent the errors you’re seeing. If you're not comfortable modifying the source code directly, you might want to split your imports by region and run them sequentially in separate commands: terraformer import aws --resources=identitystore --regions=us-east-1 --profile=terraform-imdiots
terraformer import aws --resources=identitystore --regions=us-west-1 --profile=terraform-imdiots |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
When running "terraformer import aws..." with multiple regions in the --regions option, errors are generated on the second region resources import:
ERROR: Read resource response is null for resource
ERROR: Unable to refresh resource
That is happening because of the caching of configuration in provider/aws/aws_service.go:
in
func (s *AWSService) generateConfig() (aws.Config, error) there is piece of code:
if configCache != nil {
return *configCache, nil
}
The text was updated successfully, but these errors were encountered: