Narrow group 1 managed resources

This commit is contained in:
2026-11-14 13:42:43 +09:00
parent f1f60740ae
commit 94a5c2bf55
7 changed files with 12 additions and 117 deletions
+1 -30
View File
@@ -7,35 +7,6 @@ resource "aws_cloudwatch_log_group" "this" {
tags = each.value.tags
}
resource "aws_cloudwatch_dashboard" "cost_check" {
dashboard_name = var.dashboard_name
dashboard_body = jsonencode({
widgets = [{
type = "metric"
x = 0
y = 0
width = 23
height = 7
properties = {
view = "timeSeries"
stacked = true
metrics = [
["AWS/NATGateway", "BytesOutToSource", "AvailabilityZone", "ap-northeast-1a", "NatGatewayId", var.dashboard_nat_gateway_id],
[".", "BytesOutToDestination", ".", ".", ".", "."],
[".", "BytesInFromDestination", ".", ".", ".", "."],
[".", "BytesInFromSource", ".", ".", ".", "."],
[".", "BytesInFromDestination", ".", "ap-northeast-1c", ".", "."],
[".", "BytesInFromSource", ".", ".", ".", "."],
[".", "BytesOutToDestination", ".", ".", ".", "."],
[".", "BytesOutToSource", ".", ".", ".", "."],
]
region = var.region
title = "NAT Gayeway通信量"
}
}]
})
}
resource "aws_cloudwatch_metric_alarm" "billing" {
provider = aws.us_east_1
@@ -49,7 +20,7 @@ resource "aws_cloudwatch_metric_alarm" "billing" {
statistic = "Maximum"
threshold = 16
actions_enabled = true
alarm_actions = [aws_sns_topic.notify_me.arn]
alarm_actions = var.billing_alarm_action_arns
dimensions = {
Currency = "USD"