Skip to content

Commit

Permalink
Projects data source e2e tests (#2154)
Browse files Browse the repository at this point in the history
projects-data-source e2e tests
  • Loading branch information
dibaskar-google authored Mar 15, 2024
1 parent 28f0268 commit 11b9319
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions modules/projects-data-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,51 @@ A good usage pattern would be when we want all the projects under a specific fol

```hcl
module "my-org" {
source = "./fabric/modules/projects-data-source"
parent = "organizations/123456789"
source = "./fabric/modules/projects-data-source"
parent = var.organization_id
}
output "project_numbers" {
value = module.my-org.project_numbers
}
# tftest skip (uses data sources)
# tftest skip (uses data sources) e2e
```

### My dev projects based on parent and label

```hcl
module "my-dev" {
source = "./fabric/modules/projects-data-source"
parent = "folders/123456789"
query = "labels.env:DEV state:ACTIVE"
parent = var.folder_id
query = "labels.env:DEV state:ACTIVE"
}
output "dev-projects" {
value = module.my-dev.projects
}
# tftest skip (uses data sources)
# tftest skip (uses data sources) e2e
```

### Projects under org with folder/project exclusions
```hcl
module "my-filtered" {
source = "./fabric/modules/projects-data-source"
parent = "organizations/123456789"
parent = var.organization_id
ignore_projects = [
"sandbox-*", # wildcard ignore
"project-full-id", # specific project id
"0123456789" # specific project number
]
include_projects = [
"sandbox-114", # include specific project which was excluded by wildcard
"415216609246" # include specific project which was excluded by wildcard (by project number)
"sandbox-114", # include specific project which was excluded by wildcard
"415216609246" # include specific project which was excluded by wildcard (by project number)
]
ignore_folders = [ # subfolders are ingoner as well
"343991594985",
ignore_folders = [ # subfolders are ingoner as well
"343991594985",
"437102807785",
"345245235245"
]
Expand All @@ -70,8 +70,7 @@ output "filtered-projects" {
value = module.my-filtered.projects
}
# tftest skip (uses data sources)
# tftest skip (uses data sources) e2e
```
<!-- BEGIN TFDOC -->

Expand Down

0 comments on commit 11b9319

Please sign in to comment.