EC2 VPN connections should have logging enabled¶
This control checks whether an AWS Site-to-Site VPN connection has Amazon CloudWatch Logs enabled for both tunnels. The control fails if a Site-to-Site VPN connection doesn't have CloudWatch Logs enabled for both tunnels.
How to fix¶
Resource aws_vpn_connection must exist.
Implementation options¶
Choose the option that matches how you manage Terraform. All options satisfy this control.
Option 1: Terraform AWS provider resources¶
If you manage resources directly, configure the relevant Terraform AWS provider resources to meet this control. See docs for the resources involved: aws_vpn_connection.
resource "aws_vpn_connection" "this" {
customer_gateway_id = "cgw-abc123"
type = "ipsec.1"
vpn_gateway_id = "vgw-abc123"
tunnel1_log_options {
cloudwatch_log_options {
log_enabled = true
}
}
tunnel2_log_options {
cloudwatch_log_options {
log_enabled = true
}
}
}
Which option should I choose?
- Compliance.tf module (recommended): controls enforced by default and mapped to frameworks.
- Open source module (
terraform-aws-modules): compatible by design with compliance.tf. Same variable names for an easy, low-change migration path when you are ready. - Terraform AWS provider resources: manage Terraform resources directly.
Tool mappings¶
Use these identifiers to cross-reference this control across tools, reports, and evidence.
Compliance.tf (CTF) Control:
vpc_vpn_connection_logging_enabledAWS Config Managed Rule:
EC2_VPN_CONNECTION_LOGGING_ENABLEDPowerpipe Control:
aws_compliance.control.vpc_vpn_connection_logging_enabled