Skip to content

Commit f5c4bf7

Browse files
omerdemirokactions-user
authored andcommitted
Eng 1535 ensure that we enable all the apis in our gcp projects (#2762)
GitOrigin-RevId: 635244cb61941a1f73a7e886d899e82caf51afe1
1 parent d02c308 commit f5c4bf7

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

sources/gcp/dynamic/adapters/.cursor/rules/dynamic-adapter-creation.mdc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,37 @@ TerraformResource: "google_compute_global_forwarding_rule",
212212
TerraformMethod: sdp.QueryMethod_GET,
213213
```
214214

215+
### 8. API Service Enablement
216+
217+
#### Ensure Required APIs Are Enabled:
218+
- **CRITICAL**: All GCP APIs used by the adapter must be enabled in the deployment configuration
219+
- Check if the API service is already included in `deploy/modules/ovm-services/gke.tf`
220+
- If the API is missing, add it to the `google_project_service` resource
221+
222+
#### Process:
223+
1. **Identify API Service**: Extract the API service name from the adapter's endpoint URLs
224+
- Example: `https://bigquerydatatransfer.googleapis.com/v1/...` → `bigquerydatatransfer.googleapis.com`
225+
2. **Check Current APIs**: Review the list in `deploy/modules/ovm-services/gke.tf`
226+
3. **Add Missing APIs**: If not present, add the API to the `overmind_apis` resource
227+
4. **Follow Naming Convention**: Use the full API endpoint URL format
228+
5. **Add Descriptive Comments**: Include a clear comment explaining what the API is for
229+
230+
#### Example:
231+
```hcl
232+
resource "google_project_service" "overmind_apis" {
233+
for_each = toset([
234+
"bigquerydatatransfer.googleapis.com", # BigQuery Data Transfer API
235+
"new-api.googleapis.com", # New API for your adapter
236+
// ... other APIs
237+
])
238+
}
239+
```
240+
241+
#### Verification:
242+
- Ensure all IAM permissions used in the adapter have their corresponding APIs enabled
243+
- Verify against the `PredefinedRoles` map in `sources/gcp/shared/predefined-roles.go`
244+
- All APIs referenced in predefined roles should be enabled in the deployment
245+
215246
## Reference Examples
216247

217248
### Project-level Resources
@@ -267,10 +298,13 @@ TerraformMethod: sdp.QueryMethod_GET,
267298
- [ ] API URLs match official GCP documentation exactly
268299
- [ ] Blast propagation covers all linked resources
269300
- [ ] Terraform resource name verified in registry
301+
- [ ] **Required APIs enabled in deployment**: All APIs used by the adapter are included in `deploy/modules/ovm-services/gke.tf`
270302

271303
## Key Resources
272304

273305
- **GCP API Documentation**: Always verify against official docs
274306
- **Terraform Registry**: https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/
275307
- **Existing Adapters**: Study patterns in `sources/gcp/dynamic/adapters/`
276308
- **SDP Types**: Check `sources/gcp/shared/item-types.go` for existing types
309+
- **Deployment Configuration**: Check `deploy/modules/ovm-services/gke.tf` for enabled APIs
310+
- **Predefined Roles**: Review `sources/gcp/shared/predefined-roles.go` for IAM permissions

0 commit comments

Comments
 (0)