AWS is introducing new validation requirements for their MetricStreams resource that enforces OneOfExcludeFilters or IncludeFilters. Currently, our template renders each of these Parameters as an empty list [] if no namespaces are set, but this is invalid according to the new logic and results in an error and failed stack creation. This PR updates the conditions to set only one of IncludeFilters and ExcludeFilters depending on the value of FilterMethod, so they will no longer both be set to [] when no namespaces are specified.
The streams stack currently fails to create with the following error:
ResourceType:AWS::CloudWatch::MetricStream, ResourceStatusReason:Properties validation failed for resource DatadogMetricStreamAllNamespaces with message: [#: #: 2 subschemas matched instead of one]
Testing Guidelines
Tested by creating a stack in our sandbox AWS account in one of the regions (e.g., ap-northeast-1) where this error was observed. The stack was successfully created with each include/exclude parameter combination with these changes.
Additional Notes
Sorry my IDE insisted on changing all the quotes and formatting 💀 I commented on the lines with the only significant changes
Note: Please remember to review the contribution guidelines if you have not yet done so.
What does this PR do?
AWS is introducing new validation requirements for their
MetricStreams
resource that enforcesOneOf
ExcludeFilters
orIncludeFilters
. Currently, our template renders each of these Parameters as an empty list[]
if no namespaces are set, but this is invalid according to the new logic and results in an error and failed stack creation. This PR updates the conditions to set only one ofIncludeFilters
andExcludeFilters
depending on the value ofFilterMethod
, so they will no longer both be set to[]
when no namespaces are specified.Motivation
https://datadoghq.atlassian.net/browse/AWSMC-954
The streams stack currently fails to create with the following error:
Testing Guidelines
Tested by creating a stack in our sandbox AWS account in one of the regions (e.g.,
ap-northeast-1
) where this error was observed. The stack was successfully created with each include/exclude parameter combination with these changes.Additional Notes
Sorry my IDE insisted on changing all the quotes and formatting 💀 I commented on the lines with the only significant changes