terraform-provider-tfe icon indicating copy to clipboard operation
terraform-provider-tfe copied to clipboard

Add `tfe_projects` data source

Open tdevelioglu opened this issue 9 months ago • 2 comments

Description

Add tfe_projects data source for retrieving organization projects.

image

Testing plan

Create and retrieve projects with the new data source.

Example configuration
resource "tfe_organization" "organization" {
  name  = "random-org"
  email = "[email protected]"
}

resource "tfe_project" "project1" {
  name         = "project1"
  description  = "Project 1"
  organization = tfe_organization.organization.name
}

resource "tfe_project" "project2" {
  name        = "project2"
  description = "Project 2"
  organization = tfe_organization.organization.name
}

resource "tfe_project" "project3" {
  name        = "project3"
  description = "Project 3"
  organization = tfe_organization.organization.name
}

data tfe_projects "all" {
  organization = tfe_organization.organization.name
}

External links

Output from acceptance tests

$ TESTARGS="-run TestAccTFEProjects" make testacc
TF_ACC=1 TF_LOG_SDK_PROTO=OFF go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFEProjects -timeout 15m
?       github.com/hashicorp/terraform-provider-tfe     [no test files]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-tfe/internal/client     (cached) [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/hashicorp/terraform-provider-tfe/internal/logging    (cached) [no tests to run]
=== RUN   TestAccTFEProjectsDataSource_basic
--- PASS: TestAccTFEProjectsDataSource_basic (4.09s)
=== RUN   TestAccTFEProjectsDataSource_basicNoProjects
--- PASS: TestAccTFEProjectsDataSource_basicNoProjects (3.70s)
PASS
ok      github.com/hashicorp/terraform-provider-tfe/internal/provider   (cached)
?       github.com/hashicorp/terraform-provider-tfe/internal/provider/validators        [no test files]
?       github.com/hashicorp/terraform-provider-tfe/version     [no test files]
...

tdevelioglu avatar Apr 26 '24 16:04 tdevelioglu