You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 aws_service.go file to reset the configCache at the start of the generateConfig function.
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 regionconfigCache=nilifconfigCache!=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:
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: