-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature: set up uptime monitoring #623
Conversation
terraform/uptime.tf
Outdated
<Request Method="GET" Version="1.1" Url="https://dev-benefits.calitp.org/healthcheck" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" /> | ||
</Items> | ||
</WebTest> | ||
XML |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Annoyingly, this is a bit more complex than most Terraform resources. Thankfully, was mostly able to copy-and-paste from an example.
Example alert email. The resolution message looks almost identical, except it says "alert deactivated." |
9ee9a6e
to
9c927e5
Compare
Ready for review! If someone feels strongly, I can split out the minimal Terraform setup from adding the uptime monitor; this pull request currently adds both. This configuration has been applied, i.e. the uptime monitors are live. |
|
||
[dev-benefits.calitp.org](https://dev-benefits.calitp.org) is currently deployed into a Microsoft Azure account provided by [California Department of Technology (CDT)'s Office of Enterprise Technology (OET)](https://techblog.cdt.ca.gov/2020/06/cdt-taking-the-lead-in-digital-transformation/), a.k.a. the "DevSecOps" team. More specifically, it uses [custom containers](https://docs.microsoft.com/en-us/azure/app-service/configure-custom-container) on [Azure App Service](https://docs.microsoft.com/en-us/azure/app-service/overview). | ||
|
||
The infrastructure is configured as code via [Terraform](https://www.terraform.io/), for [various reasons](https://techcommunity.microsoft.com/t5/fasttrack-for-azure/the-benefits-of-infrastructure-as-code/ba-p/2069350). We are adding existing resources to the configuration progressively. In other words, not _all_ our resources in Azure show up under [`terraform/`][terraform-dir], but we are [moving that direction](https://github.com/cal-itp/benefits/issues/618). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this caveat.
9c927e5
to
9226150
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm new to Terraform and still learning, but based on your explanation/demo yesterday, these changes look good to me. The documentation added here is really helpful too 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the walkthrough yesterday, and agreed with @angela-tran this looks good!
I do think we should just use the Production subscription values everywhere though - the https://dev-benefits.calitp.org domain is already pointing there and think it will be easier to focus on one subscription w/slots going forward.
9226150
to
f297e14
Compare
f297e14
to
93bde90
Compare
Refactor the uptime code to be in a module to be reusable.
1178112
to
81b275c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
We should combine the common Azure-related docs from deployment/README.md
and deployment/azure.md
somewhere.
Will do that as a follow-up. |
Closes #449.
This is a proof of concept to show two things:
About halfA lot of the additions in the pull request are just Terraform boilerplate. Uptime-specific stuff is interraform/uptime.tf
. Note this doesn't bring any existing Azure resources into management by Terraform.If people are 👍 on the approach, I would want to do the following from here:
local
Terraform backendFeedback welcome!