Commit 6e4559a
fix(vpc-endpoints): resolve critical testing infrastructure issues … (#1)
* fix(vpc-endpoints): resolve critical testing infrastructure issues and YAML operation failures
## Summary
Fixed multiple critical issues in VPC endpoints testing infrastructure that were preventing
successful test execution and YAML operations. Resolved project ID parsing failures, cloud
provider mismatches in deletion operations, and flawed verification logic.
## Issues Fixed
### 1. VPC Endpoints YAML Project ID Resolution
- **Problem**: VPC endpoint YAML configurations weren't being parsed for project ID resolution
- **Error**: "failed to resolve project ID for '': project '' not found in organization"
- **Root Cause**: getProjectID() function only handled SearchIndex resources, not VPCEndpoint
- **Fix**: Enhanced getProjectID() to extract projectName from VPCEndpoint resource specs
- **Impact**: YAML operations (plan/apply/destroy) now work correctly with VPCEndpoint resources
### 2. Multi-Provider Deletion Support
- **Problem**: AWS endpoints deleted successfully, but GCP and Azure endpoints failed deletion
- **Root Cause**: All deletion commands hardcoded to use "--cloud-provider AWS"
- **Fix**: Dynamic cloud provider extraction using jq from Atlas API responses
- **Impact**: Multi-provider tests now pass cleanup phase, preventing resource leaks
### 3. Verification Logic Alignment with Atlas API
- **Problem**: Tests searched for YAML metadata names that don't exist in Atlas responses
- **Root Cause**: Atlas VPC endpoints don't store user-defined names, only system IDs
- **Fix**: Replaced name-based verification with endpoint count and provider validation
- **Impact**: All verification phases now pass correctly with accurate results
## Technical Changes
### Enhanced Project ID Parsing (cmd/infra/apply.go)
- Added VPCEndpoint support to getProjectID() function
- Enhanced parsing for DatabaseUser, NetworkAccess, and Cluster resources
- Improved error handling for project resolution across all resource types
### Multi-Provider Deletion Logic (scripts/test/vpc-endpoints-lifecycle.sh)
- Replaced hardcoded AWS provider with dynamic extraction
- Added jq-based provider and ID extraction from Atlas API responses
- Enhanced cleanup_all_vpc_endpoints() with proper provider handling
- Updated all deletion operations to use correct cloud providers
### Verification Logic Overhaul
- Replaced grep searches for non-existent names with jq length counting
- Added cloud provider verification using jq -r '.[].cloudProvider'
- Implemented robust endpoint existence checking based on actual API responses
- Enhanced error handling and null value validation
## Files Modified
- cmd/infra/apply.go: Enhanced getProjectID() with comprehensive resource support
- scripts/test/vpc-endpoints-lifecycle.sh: Fixed deletion logic and verification methods
## Test Results
### Before Fix
- YAML operations: Failed with project ID resolution errors
- Multi-provider deletion: GCP/Azure endpoints not deleted (resource leaks)
- Verification: All attempts failed searching for non-existent names
- Test suite: Consistent failures in YAML phase
### After Fix
✅ VPC endpoint YAML operations work correctly with proper project ID resolution
✅ Multi-provider deletion works for AWS, Azure, and GCP endpoints
✅ Verification logic checks actual endpoint existence and cloud provider types
✅ Complete test suite passes all phases including multi-provider scenarios
## Verification
**Project ID Resolution Test:**
```bash
$ matlas infra plan -f vpc-endpoint.yaml --preserve-existing
Execution Plan plan-1755680190
Project 68961f3e6a4bb94d55e6404c (resolved from YAML)
Stage 0 (1 operations)
Resource Type Operation Resource Name Risk Duration
VPCEndpoint Create test-vpc-endpoint-123 low 30s
Multi-Provider Support:
- AWS: ✅ Uses --cloud-provider AWS correctly
- Azure: ✅ Uses --cloud-provider AZURE correctly
- GCP: ✅ Uses --cloud-provider GCP correctly
Impact
The VPC endpoints feature is now fully operational and comprehensively tested:
- Complete dual interface support (CLI + YAML)
- Multi-cloud provider support (AWS/Azure/GCP)
- Enterprise-grade testing with proper resource lifecycle management
- Robust cleanup and preservation mechanisms
- Reliable verification based on actual Atlas API responses
Resolves VPC endpoint testing infrastructure issues and enables full YAML workflow support.
* fix: golangci-lint errors and windows matrix workflow
* fix: lint and fmt
---------
Co-authored-by: Danny Teller <danny.teller@tipalti.com>1 parent bc002a0 commit 6e4559a
53 files changed
Lines changed: 8500 additions & 593 deletions
File tree
- .github/workflows
- cmd
- atlas
- search
- vpc-endpoints
- infra
- docs
- examples
- features
- internal
- apply
- output
- services/atlas
- types
- scripts
- test
- test
- infrastructure
- performance
- reliability
- integration/infra
- tracking
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| 54 | + | |
51 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
| |||
100 | 112 | | |
101 | 113 | | |
102 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
103 | 118 | | |
| 119 | + | |
104 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
105 | 125 | | |
106 | 126 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 127 | + | |
110 | 128 | | |
111 | 129 | | |
112 | 130 | | |
| |||
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
| 201 | + | |
| 202 | + | |
183 | 203 | | |
184 | 204 | | |
185 | 205 | | |
| |||
191 | 211 | | |
192 | 212 | | |
193 | 213 | | |
194 | | - | |
195 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
196 | 218 | | |
197 | 219 | | |
198 | 220 | | |
199 | 221 | | |
200 | 222 | | |
201 | | - | |
| 223 | + | |
202 | 224 | | |
203 | 225 | | |
204 | 226 | | |
205 | | - | |
| 227 | + | |
206 | 228 | | |
207 | 229 | | |
208 | 230 | | |
| |||
216 | 238 | | |
217 | 239 | | |
218 | 240 | | |
219 | | - | |
220 | | - | |
| 241 | + | |
| 242 | + | |
221 | 243 | | |
222 | 244 | | |
223 | | - | |
224 | | - | |
| 245 | + | |
| 246 | + | |
225 | 247 | | |
226 | 248 | | |
227 | 249 | | |
| |||
243 | 265 | | |
244 | 266 | | |
245 | 267 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | 268 | | |
254 | 269 | | |
255 | 270 | | |
| |||
258 | 273 | | |
259 | 274 | | |
260 | 275 | | |
261 | | - | |
| 276 | + | |
262 | 277 | | |
263 | 278 | | |
264 | 279 | | |
| |||
271 | 286 | | |
272 | 287 | | |
273 | 288 | | |
274 | | - | |
| 289 | + | |
275 | 290 | | |
276 | 291 | | |
277 | | - | |
278 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
279 | 302 | | |
280 | 303 | | |
281 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
24 | 47 | | |
| 48 | + | |
25 | 49 | | |
26 | 50 | | |
27 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
0 commit comments