You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
project_id = "my-project-id" # Google Cloud project ID used to run the Cloud Asset query to fetch all project IDs and create CSPM IAM resources (Cloud Asset API must be enabled)
For more examples and use cases, please refer to the examples folder in the repository.
288
298
289
299
## Providing Project ID List
290
300
291
-
By default we fetch all projects and use that project list, but you can also provide your own list of project IDs by populating the `projects_list` local. To accommodate this, ensure to remove the `data "google_projects"` and then replace the local `projects_list` with your list.
301
+
By default we fetch all active projects and use that project list, but you can also provide your own list of project IDs by populating the `projects_list` local. To accommodate this, ensure to remove the `module.aqua_gcp_org_projects` and then replace the local `projects_list` with your list.
292
302
293
303
```hcl
294
304
locals {
295
305
projects_list = [
296
-
"my-project-id-1",
297
-
"my-project-id-2",
298
-
// Add more project IDs as needed
306
+
"my-project-id-1",
307
+
"my-project-id-2",
308
+
// Add more project IDs as needed
299
309
]
300
310
}
301
311
```
302
312
303
-
For more examples and use cases, please refer to the examples folder in the repository.
313
+
## Excluding Projects Using Regex
314
+
315
+
You can exclude specific projects from getting onboarded by using regular expressions.
316
+
317
+
To exclude projects by id, add the variable `projects_ids_exclude="regex1, regex2, regex3"` to the module `aqua_gcp_org_projects`.
318
+
319
+
To exclude projects by name, add the variable `projects_names_exclude="regex1, regex2, regex3"` to the module `aqua_gcp_org_projects`.
320
+
321
+
Here are some examples of traditional exclusions following the instructions above:
322
+
323
+
1. Exclude Projects Starting with `test-`:
324
+
- Regex: `^test-.*$`
325
+
- Description: This regex pattern matches GCP project names that start with `test-`.
326
+
327
+
2. Exclude Projects Ending with `-test`:
328
+
- Regex: `^.*-test$`
329
+
- Description: This regex pattern matches GCP project names that end with `-test`.
304
330
331
+
3. Exclude Projects which include test anywhere:
332
+
- Regex: `.*test.*`
333
+
- Description: This regex pattern matches GCP project names containing the word `test` anywhere in the name.
305
334
306
335
## Using an Existing Dedicated Project
307
336
@@ -365,15 +394,15 @@ When using a dedicated project, the `<project_id>` should follow the format `"aq
Copy file name to clipboardExpand all lines: examples/organization-dedicated-project/README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Before running this example, ensure that you have the following:
24
24
25
25
## Providing Project ID List
26
26
27
-
You can provide your own list of project IDs by populating the `projects_list` local. To accommodate this, ensure to remove the `data "google_projects"` and then replace the local `projects_list` with your list.
27
+
You can provide your own list of project IDs by populating the `projects_list` local. To accommodate this, ensure to remove the `module.aqua_gcp_org_projects` and then replace the local `projects_list` with your list.
28
28
29
29
```hcl
30
30
locals {
@@ -38,9 +38,10 @@ locals {
38
38
39
39
## What's Happening
40
40
41
-
1. The `aqua_gcp_dedicated_project` module is called to create a dedicated GCP project with the name `aqua-agentless-<tenant_id>-<org_hash>`, where `org_hash` is the first six characters of the SHA1 hash of your organization name.
42
-
2. The `aqua_gcp_onboarding` module is called to provision the necessary resources (service accounts, roles, networking, etc.) in the dedicated GCP project.
43
-
3. The `aqua_gcp_project_attachment` module is called for each GCP project in the organization to create the required IAM resources and trigger the Aqua API to onboard the project.
41
+
1. The `aqua_gcp_org_projects` module is called to fetch all GCP active projects ids.
42
+
2. The `aqua_gcp_dedicated_project` module is called to create a dedicated GCP project with the name `aqua-agentless-<tenant_id>-<org_hash>`, where `org_hash` is the first six characters of the SHA1 hash of your organization name.
43
+
3. The `aqua_gcp_onboarding` module is called to provision the necessary resources (service accounts, roles, networking, etc.) in the dedicated GCP project.
44
+
4. The `aqua_gcp_project_attachment` module is called for each GCP project in the organization to create the required IAM resources and trigger the Aqua API to onboard the project.
44
45
45
46
## Outputs
46
47
@@ -49,4 +50,3 @@ locals {
49
50
## Cleanup
50
51
51
52
To remove the resources created by this example, including the organization-level resources, dedicated project, and attached projects, run `terraform destroy`.
Copy file name to clipboardExpand all lines: examples/organization-same-project-list/README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,9 @@ Before running this example, ensure that you have the following:
25
25
26
26
## What's Happening
27
27
28
-
1. The `aqua_gcp_onboarding` module is called for each GCP project specified in the `projects_list` variable to provision the necessary resources (service accounts, roles, networking, etc.).
29
-
2. The `aqua_gcp_project_attachment` module is called for each specified GCP project to create the required IAM resources and trigger the Aqua API to onboard the project.
28
+
1. The `aqua_gcp_cspm_iam` module is called to create the CSPM IAM resources once per organization.
29
+
2. The `aqua_gcp_onboarding` module is called for each GCP project specified in the `projects_list` variable to provision the necessary resources (service accounts, roles, networking, etc.).
30
+
3. The `aqua_gcp_project_attachment` module is called for each specified GCP project to create the required IAM resources and trigger the Aqua API to onboard the project.
cspm_project_id=""# project id where CSPM iam resources will be provisioned. If not set, it will be set by default to the first project in the organization
19
+
project_id="my-project-id"# This project ID is used to create CSPM IAM resources
Copy file name to clipboardExpand all lines: examples/organization-same-project/README.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,26 @@ Before running this example, ensure that you have the following:
22
22
3. Run `terraform init` to initialize the Terraform working directory.
23
23
4. Run `terraform apply` to create the resources.
24
24
25
+
## Providing Project ID List
26
+
27
+
You can provide your own list of project IDs by populating the `projects_list` local. To accommodate this, ensure to remove the `module.aqua_gcp_org_projects` and then replace the local `projects_list` with your list.
28
+
29
+
```hcl
30
+
locals {
31
+
projects_list = [
32
+
"my-project-id-1",
33
+
"my-project-id-2",
34
+
// Add more project IDs as needed
35
+
]
36
+
}
37
+
```
38
+
25
39
## What's Happening
26
40
27
-
1. The `aqua_gcp_onboarding` module is called for each GCP project to provision the necessary resources (service accounts, roles, networking, etc.).
28
-
2. The `aqua_gcp_project_attachment` module is called for each GCP project to create the required IAM resources and trigger the Aqua API to onboard the project.
41
+
1. The `aqua_gcp_org_projects` module is called to fetch all GCP active projects ids.
42
+
2. The `aqua_gcp_cspm_iam` module is called to create the CSPM IAM resources once per organization.
43
+
3. The `aqua_gcp_onboarding` module is called for each GCP project to provision the necessary resources (service accounts, roles, networking, etc.).
44
+
4. The `aqua_gcp_project_attachment` module is called for each GCP project to create the required IAM resources and trigger the Aqua API to onboard the project.
cspm_project_id=""# project id where CSPM iam resources will be provisioned. If not set, it will be set by default to the first project in the organization
19
+
project_id="my-project-id"# This project ID is used to run the Cloud Asset query to fetch all project IDs and create CSPM IAM resources.
0 commit comments