CloudWatch: Handle permissions error and update docs (#88524)

This commit is contained in:
Isabella Siu
2024-05-31 14:36:38 -04:00
committed by GitHub
parent 73905695e3
commit be2e420e6b
5 changed files with 58 additions and 1 deletions
@@ -135,6 +135,15 @@ func TestCloudWatchResponseParser(t *testing.T) {
})
})
})
t.Run("when receiving a permissions error should pass it to the user", func(t *testing.T) {
getMetricDataOutputs, err := loadGetMetricDataOutputsFromFile("./testdata/permissions-error-output.json")
require.NoError(t, err)
aggregatedResponse := aggregateResponse(getMetricDataOutputs)
assert.True(t, aggregatedResponse["a"].HasPermissionError)
assert.Equal(t, "Access denied when getting data - please check that you have the pi:GetResourceMetrics permission", aggregatedResponse["a"].PermissionErrorMessage)
})
}
func Test_buildDataFrames_parse_label_to_name_and_labels(t *testing.T) {