Skip to content

Conversation

beetanz
Copy link

@beetanz beetanz commented Sep 2, 2025

After updating the maintenance emails to go from AWS Health managed notifications they utilize an HTML format instead of plaintext. This was causing the parsing to fail. Adding support for the HTML emails from AWS health and maintaining previous code for plaintext (SNS) emails.

@jvanderaa
Copy link
Contributor

Thank you for the PR. Let's get the tests cleared up and do you have an example of this new format?

@beetanz
Copy link
Author

beetanz commented Sep 3, 2025

Hi @jvanderaa ,
I ran ruff over it so that CI check shouldn't fail any more.
I have an example but would prefer not to send it on here. I can email or slack it over?

@jvanderaa
Copy link
Contributor

It would need to be obfuscated and added for the test. I can add it or you can add it. It would be better to come from you since you would know what would be sensitive and can change it. Such as circuit IDs from whatever format to something that uses all 1s and a's in the format.

@beetanz
Copy link
Author

beetanz commented Sep 4, 2025

here's the email without headers
`<!doctype html>

<title> =20 </title> <style type=3D"text/css"> #outlook a { padding:0; } body { margin:0;padding:0;-webkit-text-size-adjust:100%;-ms-text-size= -adjust:100%; } table, td { border-collapse:collapse;mso-table-lspace:0pt;mso-table-r= space:0pt; } img { border:0;height:auto;line-height:100%; outline:none;text-decora= tion:none;-ms-interpolation-mode:bicubic; } p { display:block;margin:13px 0; } </style> =20 <style type=3D"text/css"> @import url(https://fonts.googleapis.com/css?family=3DUbuntu:300,= 400,500,700); </style>

=20
=20
<style type=3D"text/css">
@media only screen and (min-width:480px) {
.mj-column-per-100 { width:100% !important; max-width: 100%; }
.mj-column-per-70 { width:70% !important; max-width: 70%; }
.mj-column-per-30 { width:30% !important; max-width: 30%; }
.mj-column-per-50 { width:50% !important; max-width: 50%; }
}
</style>
<style media=3D"screen and (min-width:480px)">
.moz-text-html .mj-column-per-100 { width:100% !important; max-width:=
100%; }
.moz-text-html .mj-column-per-70 { width:70% !important; max-width: 70%; }
.moz-text-html .mj-column-per-30 { width:30% !important; max-width: 30%; }
.moz-text-html .mj-column-per-50 { width:50% !important; max-width: 50%; }
</style>
=20
=20
<style type=3D"text/css">
=20
=20

@media only screen and (max-width:480px) {
  table.mj-full-width-mobile { width: 100% !important; }
  td.mj-full-width-mobile { width: auto !important; }
}

=20
</style>
<style type=3D"text/css">
=20
</style>
=20

=20 =20
=20 =20 =20 =20
=20
=20 =20 =20
=20
=20
=20
=20 =20 =20
=20

AWS Health= Event

=20
=20
=20 =20
=20 =20 =20
=20
=20 =20
=20
=20
=20
=20
=20
=20 =20 =20 =20
=20
=20
=20 =20 =20 =20 =20 =20
=20
View in Notification Center
=20
=20
AWS Direct Connect Planned Maintenance Notification [AWS Account: 11= 1111111111]
=20
=20
View details in service console
=20
=20
Hello,

Planned maintenance has been scheduled on an AWS Direct Connect endpo= int in Sonda Quilicura, Santiago from Tue, 16 Sep 2025 01:00:00 GMT to Tue,= 16 Sep 2025 05:00:00 GMT for 4 hours. During this maintenance window, your= AWS Direct Connect services listed below may become unavailable.

dxcon-abc12345
dxvif-1234hfjd
dxlag-fge1111
dxcon-ffucore
dxcon-fg885ug

This maintenance is scheduled to avoid disrupting redundant connectio= ns at the same time.

If you encounter any problems with your connection after the end of t= his maintenance window, please contact AWS Support[1].

[1] https://aws.amazon.com/support

.
=20
=20
=20
=20
=20 =20 =20 =20
=20
=20
=20 =20 =20 =20
=20

=20 =20 =20
=20
Message metadata
=20
=20
=20
=20
=20 =20 =20 =20 =20
=20
=20
=20 =20 =20 =20 =20 =20
=20

Affected account

111111111111

=20
=20

Event type code

AWS_DIRECTCONNECT_MAINTENANCE_SCHEDULED

=20
=20

Event region

sa-east-1

=20
=20

End time

Tue, 16 Sep 2025 05:00:00 GMT

=20
=20
=20 =20
=20 =20 =20 =20 =20
=20

Service

DIRECTCONNECT

=20
=20

Event type category

scheduledChange

=20
=20

Start time

Tue, 16 Sep 2025 01:00:00 GMT

=20
=20
=20
=20
=20 =20
=20
=20 =20 =20 =20 =20 =20 =20
=20
=20 =20
=20
=20
=20 =20 =20 =20
=20
AWS managed notification details
=20
=20
AWS Health: Operations events notifications are generated by AWS and= sent to selected account contacts. You can add additional delivery channel= s for these notifications using AWS managed notifica= tions subscriptions.
=20
=20
=20
=20
=20 =20 =20 =20
=20
=20
=20 =20 =20
=20

Event type

AWS Health Event

=20
=20
=20 =20
=20 =20 =20
=20

Category

Operations

=20
=20
=20
=20
=20 =20 =20 =20
=20
=20
=20 =20 =20 =20 =20
=20

=20 =20 =20
=20
Thank you,
=20
=20
Amazon Web Services
=20
=20
=20
=20
=20 =20 =20 =20
=20
=20
=20 =20 =20
=20
You are receiving this email because [email protected] is sub= scribed to AWS Health: Operations events notifications. If you do not wis= h to receive emails for these AWS managed notifications, you may unsubscribe. If you believe you've received this email by = error or are experiencing issues managing email subscription, please contact us.

Amazon Web Services, Inc. is a subsidiary of Amazon.com, Inc. AMA= ZON WEB SERVICES AWS, and related logos are trademarks of Amazon Web Servic= es, Inc. or its affiliates.

This message was produced and distributed by Amazon Web Services,= Inc. or its affiliates 410 Terry Ave. North, Seattle, WA = 98109.

=C2=A9 2025, Amazon Web Services, Inc. or its af= filiates. All rights reserved. Read our Privacy Notice. =20
=20
=20
=20
=20 =20
=20
=20 =20 =20 =20
=20

3D""

=20`

@beetanz
Copy link
Author

beetanz commented Sep 4, 2025

I've added the email to the docstring and broken the parsers into plaintext and html

@itdependsnetworks
Copy link
Contributor

I think the expectations is to add the sample to the tests, here is a prior PR that updated the capabilities of an existing parser that should be a good guide: https://github.com/networktocode/circuit-maintenance-parser/pull/256/files

@beetanz
Copy link
Author

beetanz commented Sep 15, 2025

Alright, I've got the tests in place and refactored the html parser into its own parser.

@beetanz
Copy link
Author

beetanz commented Sep 24, 2025

Can I get an update on this? This is critical for us to have this functionality working soon as possible

Copy link
Contributor

@jvanderaa jvanderaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one minor change that we shouldn't be making.

@jvanderaa
Copy link
Contributor

Apologies @beetanz was out of pocket most of last week due to travel.

@jvanderaa
Copy link
Contributor

And the tests are not passing.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants