Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects data source e2e tests #2154

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading