Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terraform-trailwatch-modules/terraform-aws-vpc
This Terraform module creates CloudWatch Log Metric Filters and associated Alarms for monitoring Virtual Private Clouds (VPCs) based on specified event names.
https://github.com/terraform-trailwatch-modules/terraform-aws-vpc
aws aws-vpc terraform-module terraform-trailwatch trailwatch vpc
Last synced: 15 days ago
JSON representation
This Terraform module creates CloudWatch Log Metric Filters and associated Alarms for monitoring Virtual Private Clouds (VPCs) based on specified event names.
- Host: GitHub
- URL: https://github.com/terraform-trailwatch-modules/terraform-aws-vpc
- Owner: terraform-trailwatch-modules
- License: mit
- Created: 2024-10-28T10:23:47.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-10-30T13:55:48.000Z (2 months ago)
- Last Synced: 2024-10-31T21:08:35.532Z (2 months ago)
- Topics: aws, aws-vpc, terraform-module, terraform-trailwatch, trailwatch, vpc
- Language: HCL
- Homepage: https://registry.terraform.io/modules/terraform-trailwatch-modules/vpc/aws/latest
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Virtual Private Cloud
## About
This Terraform module creates CloudWatch Log Metric Filters and associated Alarms for monitoring Virtual Private Clouds (VPCs) based on specified event names. It helps ensure that critical changes to VPCs are monitored effectively and alerts are sent to a pre-existing SNS topic.## Features
- Creates CloudWatch Log Metric Filters for specified VPCs.
- Creates CloudWatch Alarms that trigger based on metrics from the filters.
- Flexible configuration for events to monitor and alarm settings.## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | ~> 1.0 |
| [aws](#requirement\_aws) | ~> 5.46 |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [cw\_log\_group\_name](#input\_cw\_log\_group\_name) | The name of the CloudWatch log group storing CloudTrail logs. | `string` | n/a | yes |
| [cw\_metric\_filter\_alarm\_actions](#input\_cw\_metric\_filter\_alarm\_actions) | The list of actions to execute when the alarm transitions into an ALARM state from any other state. | `list(string)` | `[]` | no |
| [cw\_metric\_filter\_alarm\_comparison\_operator](#input\_cw\_metric\_filter\_alarm\_comparison\_operator) | The comparison operator for the CloudWatch metric filter alarm. | `string` | `"GreaterThanOrEqualToThreshold"` | no |
| [cw\_metric\_filter\_alarm\_evaluation\_periods](#input\_cw\_metric\_filter\_alarm\_evaluation\_periods) | The number of periods over which data is compared to the specified threshold. | `number` | `1` | no |
| [cw\_metric\_filter\_alarm\_period](#input\_cw\_metric\_filter\_alarm\_period) | The period in seconds over which the specified statistic is applied. | `number` | `300` | no |
| [cw\_metric\_filter\_alarm\_statistic](#input\_cw\_metric\_filter\_alarm\_statistic) | The statistic to apply to the alarm's associated metric. | `string` | `"Sum"` | no |
| [cw\_metric\_filter\_alarm\_threshold](#input\_cw\_metric\_filter\_alarm\_threshold) | The value against which the specified statistic is compared. | `number` | `1` | no |
| [cw\_metric\_filter\_namespace](#input\_cw\_metric\_filter\_namespace) | The namespace for the CloudWatch metric filter. | `string` | `"VPC/Monitoring"` | no |
| [cw\_metric\_filter\_value](#input\_cw\_metric\_filter\_value) | The value to publish to the CloudWatch metric. | `string` | `"1"` | no |
| [vpc\_event\_names](#input\_vpc\_event\_names) | The list of event names to monitor for each Virtual Private Cloud. | `list(string)` |[| no |
"DeleteVpc",
"ModifyVpcAttribute",
"CreateSubnet",
"DeleteSubnet",
"ModifySubnetAttribute",
"CreateInternetGateway",
"DeleteInternetGateway",
"AttachInternetGateway",
"DetachInternetGateway",
"CreateNatGateway",
"DeleteNatGateway",
"CreateRouteTable",
"DeleteRouteTable",
"AssociateRouteTable",
"DisassociateRouteTable",
"CreateNetworkAcl",
"DeleteNetworkAcl",
"CreateNetworkAclEntry",
"DeleteNetworkAclEntry",
"AssociateNetworkAcl",
"DisassociateNetworkAcl"
]
| [vpc\_ids](#input\_vpc\_ids) | The list of Virtual Private Cloud IDs to monitor. | `list(string)` | n/a | yes |## Simple Example
```hcl
module "terraform_trailwatch_vpc" {
source = "terraform-trailwatch-modules/vpc/aws"
vpc_ids = ["vpc-12345678", "vpc-87654321"]
cw_log_group_name = "the-cloudtrail-log-group"
cw_metric_filter_alarm_actions = ["arn:aws:sns:region:account-id:sns-topic"]
}
```## Advanced Example
```hcl
module "terraform_trailwatch_vpc" {
source = "terraform-trailwatch-modules/vpc/aws"
vpc_ids = ["vpc-12345678", "vpc-87654321"]
vpc_event_names = ["DeleteVpc", "ModifyVpcAttribute"]
cw_log_group_name = "the-cloudtrail-log-group"
cw_metric_filter_namespace = "VPC/Monitoring"
cw_metric_filter_value = "1"
cw_metric_filter_alarm_comparison_operator = "GreaterThanOrEqualToThreshold"
cw_metric_filter_alarm_evaluation_periods = 1
cw_metric_filter_alarm_period = 300
cw_metric_filter_alarm_statistic = "Sum"
cw_metric_filter_alarm_threshold = 1
cw_metric_filter_alarm_actions = ["arn:aws:sns:region:account-id:sns-topic"]
}
```## Changelog
For a detailed list of changes, please refer to the [CHANGELOG.md](CHANGELOG.md).## License
This module is licensed under the [MIT License](LICENSE).