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 support for AWS Account ID in s3 fast sync bucket #58

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions indexer/indexer_monitors.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ module "indexer_monitors" {
team = var.monitoring_team
url = var.indexer_url
enable_precautionary_monitors = var.enable_precautionary_monitors
aws_account_id = var.monitoring_aws_account_id
}
6 changes: 6 additions & 0 deletions indexer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ variable "monitoring_team" {
default = "v4-indexer"
}

variable "monitoring_aws_account_id" {
type = string
description = "Account ID for the AWS account"
default = ""
}

variable "enable_precautionary_monitors" {
type = bool
description = "Whether to enable precautionary monitors"
Expand Down
1 change: 1 addition & 0 deletions modules/indexer_monitors/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ locals {
tick_frequency = 300 # 5 minutes
retry_interval = 3000 # 3 seconds in milliseconds
retry_count = 3 # 3 retries
snapshot_bucket_prefix = var.aws_account_id == "" ? var.environment : "${var.aws_account_id}-${var.environment}"

api_http_synthetic_monitor_configurations = {
"height" : {
Expand Down
2 changes: 1 addition & 1 deletion modules/indexer_monitors/monitors.tf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ resource "datadog_monitor_json" "fast_sync_snapshots" {
"id": 131752782,
"name": "[${var.environment}] Indexer fast sync snapshots haven't been uploaded in the last day",
"type": "query alert",
"query": "sum(last_1d):sum:aws.s3.put_requests{bucketname:${var.environment}-full-node-snapshots}.as_count() < 1",
"query": "sum(last_1d):sum:aws.s3.put_requests{bucketname:${local.snapshot_bucket_prefix}-full-node-snapshots}.as_count() < 1",
"message": "Indexer fast sync snapshots haven't been uploaded in the last day. Please investigate the snapshotting full node.\n\n${local.monitor_suffix_literal}",
"tags": [
"team:${var.team}",
Expand Down
5 changes: 5 additions & 0 deletions modules/indexer_monitors/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ variable "enable_precautionary_monitors" {
type = bool
description = "Whether to enable precautionary monitors"
}

variable "aws_account_id" {
type = string
description = "Account ID for the AWS account"
}