terraform-provider-sumologic
terraform-provider-sumologic copied to clipboard
Uninformative error message when using sumologic_cloudwatch_source
Steps to reproduce
Define a sumologic_cloudwatch_source for CloudWatch metrics collection without specifying the regions, e.g.
path {
type = "CloudWatchPath"
limit_to_namespaces = ["AWS/S3"]
}
Run terraform apply
Observed
(depending on your AWS account setup)
│ Error: {
│ "status" : 400,
│ "id" : "22EJJ-WDXTN-WPBSV",
│ "code" : "collectors.validation.fields.invalid",
│ "message" : "Invalid IAM role: 'errorMessage=null'."
│ }
│
which is not a helpful error message
Expected
A helpful error message
Workaround and context
My guess is that when regions are not specified, Sumo Logic tries to access all of them it knows. But my AWS account might not have all regions enabled and thus failes.
Adding:
limit_to_regions = ["us-west-2"]
made the problem go away.
Maybe one way to address it is to make the limit_to_regions mandatory?
Not sure. The error message still should say what was the problem.