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

WIP Upgrade aws provider to 5.x. Create SNS Topic, SNS Sub, and Cloudwatch alarm for worker instance StatusCheckFailed #12

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tdipiazza
Copy link
Contributor

@tdipiazza tdipiazza commented Jan 8, 2024

Setting up a cloudwatch alarm for ec2 instance statuscheckfailed, currently just on the worker but we might as well do it on web instances too

TODO:

  • Add to web.tf ??
  • Add alert action to reboot (do we want that everywhere?)

tags = {
Name = "${var.project_environment}-${var.project_name}"
}
tags_all = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tricia, what is the difference between these?

@@ -76,7 +76,7 @@ resource "aws_lb_target_group" "production" {
vpc_id = aws_vpc.production-internal.id
health_check {
enabled = true
matcher = "200,301"
matcher = "200"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe change this back or investigate using https for health check?

Copy link
Member

Choose a reason for hiding this comment

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

internally we should have a health check endpoint that is better than / and should not redirect. The actual endpoints it is checking are not https, but they will redirect if they think they are being called over http. We might be able to override that by setting X-Forwarded-By and similar
https://docs.aws.amazon.com/elasticloadbalancing/latest/application/x-forwarded-headers.html

resource "aws_sns_topic_subscription" "ec2-alarm_email_target" {
topic_arn = aws_sns_topic.ec2-alarm.arn
protocol = "email"
endpoint = "alerts@tenforwardconsulting.com"
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be a variable instead of hard coded

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.

None yet

2 participants