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

Add tfe_projects data source #1339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tdevelioglu
Copy link

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 = "admin@tfe.local"
}

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 tdevelioglu requested a review from a team as a code owner April 26, 2024 16:06
Copy link

hashicorp-cla-app bot commented Apr 26, 2024

CLA assistant check
All committers have signed the CLA.

@tdevelioglu tdevelioglu force-pushed the tdevelioglu/add_data_source_projects branch from 28d86c7 to ef3e3a0 Compare April 29, 2024 09:22
@tdevelioglu tdevelioglu force-pushed the tdevelioglu/add_data_source_projects branch from ef3e3a0 to 59ab0b8 Compare May 8, 2024 16:16
Can be used to retrieve all projects in an organization.
@tdevelioglu tdevelioglu force-pushed the tdevelioglu/add_data_source_projects branch from 59ab0b8 to be24691 Compare May 16, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant