Skip to content
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

Add validation to CloudWatch metric query name #280

Closed
cab105 opened this issue May 3, 2021 · 4 comments · Fixed by #286
Closed

Add validation to CloudWatch metric query name #280

cab105 opened this issue May 3, 2021 · 4 comments · Fixed by #286
Assignees

Comments

@cab105
Copy link
Contributor

cab105 commented May 3, 2021

For context, the metric query name is used by the source to populate the ID field used to identify the query with CloudWatch for follow-up queries and manipulation. The name must adhere to the following regexp as per AWS (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html):

[a-z][a-zA-Z0-9_]*
@antoineco
Copy link
Contributor

Tip: the second part can we shortened to \w*.

@cab105
Copy link
Contributor Author

cab105 commented May 3, 2021

Doesn't \w include more than alphanumeric?

@antoineco
Copy link
Contributor

Regex101.com says

\w matches any word character (equivalent to [a-zA-Z0-9_])

I wouldn't have known without it to be honest 😄

@cab105
Copy link
Contributor Author

cab105 commented May 3, 2021

Wow my memory is getting rusty:
https://media.giphy.com/media/83QtfwKWdmSEo/giphy.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants