Repository navigation
Commit 185ca42
authored
chore(iac/aws/networking): remove redundant Secrets Manager VPC endpoint (#915)
* chore(iac/aws/networking): remove redundant Secrets Manager VPC endpoint
The interface endpoint was unconditional and redundant: every env runs
fck-NAT (enable_nat_gateway = true), so in-VPC Secrets Manager consumers
(main Lambda, cleanup Lambda, Fargate) will reach SM over NAT regardless.
Removes:
- aws_vpc_endpoint.secretsmanager (~$14/mo across 2 AZs)
- aws_security_group.vpc_endpoints (the endpoint was its sole consumer)
- the three matching outputs (vpc_endpoints_security_group_id,
secretsmanager_endpoint_id, secretsmanager_endpoint_dns -- grep
confirmed no consumers)
Header comment updated to reflect actual topology (NAT present,
per-service interface endpoints removed).
Precondition for safety: enable_nat_gateway must remain true in every
environment. If a future change turns NAT off, this endpoint (and
likely the ECR ones too) needs to be reintroduced first.
* fix(iac/networking): enforce NAT-or-IPv4-endpoint precondition (CR on #915)
Add lifecycle.precondition to aws_subnet.private that fails at plan time
when enable_nat_gateway is false. Without NAT, module-created private subnets
have no IPv4 path to AWS services (Secrets Manager, ECR, etc.) and the module
previously planned successfully in this broken configuration.
Addresses CodeRabbit Major finding on PR #915.
* fix(iac/aws/networking): address CR + pre-commit on SM endpoint removal (#915)
- Remove unused data "aws_region" "current" (the SM endpoint was its
sole consumer; tflint flagged it as unused).
- Restore trailing newline on outputs.tf.
- Add lifecycle.precondition on aws_vpc.main that fails the plan when
enable_nat_gateway is false: in-VPC workloads (Lambda, Fargate) need
NAT for AWS API egress now that per-service interface endpoints are
gone. Fails fast instead of relying on doc-only safety as flagged by
CodeRabbit.
* fix(iac/aws/networking): drop duplicate NAT precondition on aws_vpc.main
Commit e395c03 already adds the same precondition on aws_subnet.private,
which is the more accurate trigger (it fires only when private subnets
are actually being created). Keeping both checked the same variable twice
and emitted redundant errors. Drop the one on aws_vpc.main.1 parent d29a3e0 commit 185ca42
2 files changed
Lines changed: 10 additions & 90 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
405 | 406 | | |
406 | 407 | | |
407 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
408 | 416 | | |
409 | 417 | | |
410 | 418 | | |
| |||
683 | 691 | | |
684 | 692 | | |
685 | 693 | | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
0 commit comments