Skip to content

feat(single-vm/aws): VPC flow logs + test(network): coverage (closes #9, #34)#41

Merged
dmchaledev merged 1 commit into
mainfrom
claude/merge-prs-recent-issues-xbozrp
Jun 26, 2026
Merged

feat(single-vm/aws): VPC flow logs + test(network): coverage (closes #9, #34)#41
dmchaledev merged 1 commit into
mainfrom
claude/merge-prs-recent-issues-xbozrp

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Re-implements two open PRs that couldn't be merged from their own branches (their mock-based tests fail once they pick up the now-merged changes, and I can't push fixes to the author branches). The feature code is theirs; I added the missing test mocks.

#9 — VPC Flow Logs for single-vm/aws (closes #9)

Opt-in VPC Flow Logs (enable_flow_logs, default true) → CloudWatch log group, with a least-privilege flow-log IAM role. Closes the gap vs SECURITY-DEFAULTS.md. Forwarded through asm-aws-single / sat-aws-single with a flow_log_group_name output (descriptions match core, so the new drift check stays clean).

  • Fix vs the original PR: the single-vm/aws basic tftest now mocks aws_cloudwatch_log_group with a valid ARN, so aws_flow_log.log_destination passes provider-side ARN validation under the mock provider (the original would have turned the test red).

#34terraform test coverage for the network modules (closes #34)

Adds .tftest.hcl for network/aws (basic apply + feature-flag plans) and network/azure (basic apply) — the only modules without native tests — and adds both to the terraform-test CI matrix.

  • Fix vs the original PR: network/azure mocks azurerm_network_security_group, and both network/aws tests mock aws_cloudwatch_log_group, with well-formed ARNs — required because the subnet→NSG association (added in fix(ci): repair trivy-action pin and close network/azure NSG gap #35) and the flow-log destination validate their ID/ARN format even under mocks.

Verification (local)

terraform validate, tflint, terraform test (single-vm/aws 5/5, network/aws 5/5, network/azure 1/1), checkov (1078 passed, 0 failed), trivy (0 findings), wrapper drift check (0 warnings) — all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AFfgnPaoyGhp52vQL2PVU3


Generated by Claude Code

…erage

Folds two open PRs that could not be merged from their own branches (their
mock-based tests broke once rebased and the branches are not pushable here);
re-implemented with the test gaps fixed.

#9 — VPC Flow Logs for single-vm/aws (closes #9):
  Adds opt-in VPC Flow Logs (enable_flow_logs, default true) sending ALL traffic
  to a CloudWatch log group, with a least-privilege flow-log IAM role. Closes the
  gap vs SECURITY-DEFAULTS.md. Forwarded through asm-aws-single / sat-aws-single
  with a flow_log_group_name output. The existing single-vm/aws basic test now
  mocks aws_cloudwatch_log_group with a valid ARN so aws_flow_log's
  log_destination passes provider-side ARN validation.

#34 — terraform test coverage for the network modules (closes #34):
  Adds .tftest.hcl suites for network/aws (basic apply + feature-flag plans) and
  network/azure (basic apply), and adds both to the terraform-test CI matrix —
  the only modules previously lacking native tests. The azure test mocks
  azurerm_network_security_group, and both network/aws tests mock
  aws_cloudwatch_log_group, with well-formed ARNs so the subnet-NSG association
  and flow-log destination validate under the mock provider.

Verified locally: terraform validate, tflint, terraform test (single-vm/aws 5/5,
network/aws 5/5, network/azure 1/1), checkov (1078 passed, 0 failed), trivy
(0 findings), and the wrapper drift check (0 warnings) all pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFfgnPaoyGhp52vQL2PVU3
@dmchaledev dmchaledev merged commit c8aeee3 into main Jun 26, 2026
47 checks passed
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.

2 participants